@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
package/dist/react.esm.js
CHANGED
|
@@ -3944,13 +3944,18 @@ const useWidgetContext = (type = WidgetType.Dashboard) => {
|
|
|
3944
3944
|
|
|
3945
3945
|
const useGlobalContext = () => {
|
|
3946
3946
|
const { t, language, themeName, api, ewktGeometry } = useContext(GlobalContext) || {};
|
|
3947
|
+
const translate = useCallback((value, options) => {
|
|
3948
|
+
if (t)
|
|
3949
|
+
return t(value, options);
|
|
3950
|
+
return options?.defaultValue ?? value;
|
|
3951
|
+
}, [t]);
|
|
3947
3952
|
return useMemo(() => ({
|
|
3948
|
-
t,
|
|
3953
|
+
t: translate,
|
|
3949
3954
|
language,
|
|
3950
3955
|
themeName,
|
|
3951
3956
|
api,
|
|
3952
3957
|
ewktGeometry,
|
|
3953
|
-
}), [language,
|
|
3958
|
+
}), [language, translate, api, ewktGeometry, themeName]);
|
|
3954
3959
|
};
|
|
3955
3960
|
|
|
3956
3961
|
const HEIGHT_OFFSET = 20;
|
|
@@ -5668,7 +5673,7 @@ const DataSourceProgressContainer = memo(({ config, elementConfig, type, innerCo
|
|
|
5668
5673
|
return jsx(DataSourceError, { name: elementConfig.templateName });
|
|
5669
5674
|
}
|
|
5670
5675
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
5671
|
-
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" }) : t("showAll", { ns: "dashboard" }) })), showTotal && (jsxs(Fragment$1, { children: [jsx(Divider, {}), jsxs(ProgressTotal, { children: [jsx(ProgressTotalTitle, { children: t("total", { ns: "dashboard" }) }), jsxs(ProgressValue, { children: [totalValue, jsx(ProgressUnits, { children: totalUnits })] })] })] }))] })) : (jsx(ContainerLoading, {})), jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type })] }));
|
|
5676
|
+
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 })] }));
|
|
5672
5677
|
});
|
|
5673
5678
|
|
|
5674
5679
|
const ProgressContainer = memo(({ type, elementConfig, feature, maxValue, index, renderElement }) => {
|
|
@@ -5703,7 +5708,7 @@ const ProgressContainer = memo(({ type, elementConfig, feature, maxValue, index,
|
|
|
5703
5708
|
id: "icon",
|
|
5704
5709
|
wrap: false
|
|
5705
5710
|
}), [renderElement]);
|
|
5706
|
-
const renderTooltip = useMemo(() => (jsxs(Fragment$1, { children: [jsx(ProgressTooltipAlias, { children: renderTooltipAlias }), jsxs(ProgressTooltipValueContainer, { children: [jsx(ProgressTooltipValue, { children: renderTooltipValue }), jsx(ProgressTooltipValueOf, { children: t("of", { ns: "dashboard" }) }), jsx("div", { children: formatAttributeValue({ t, type: valueType, value: currentMaxValue, stringFormat }) })] })] })), [currentMaxValue, renderTooltipAlias, renderTooltipValue, stringFormat, t, valueType]);
|
|
5711
|
+
const renderTooltip = useMemo(() => (jsxs(Fragment$1, { children: [jsx(ProgressTooltipAlias, { children: renderTooltipAlias }), jsxs(ProgressTooltipValueContainer, { children: [jsx(ProgressTooltipValue, { children: renderTooltipValue }), jsx(ProgressTooltipValueOf, { children: t("of", { ns: "dashboard", defaultValue: "из" }) }), jsx("div", { children: formatAttributeValue({ t, type: valueType, value: currentMaxValue, stringFormat }) })] })] })), [currentMaxValue, renderTooltipAlias, renderTooltipValue, stringFormat, t, valueType]);
|
|
5707
5712
|
const color = useMemo(() => colorAttribute
|
|
5708
5713
|
? attributes?.find(({ name }) => name === colorAttribute)?.value
|
|
5709
5714
|
: colors?.[index] || bgColor, [attributes, bgColor, colorAttribute, colors, index]);
|
|
@@ -6460,16 +6465,22 @@ const RoundedBackgroundContainer = memo(({ type, elementConfig, feature, renderE
|
|
|
6460
6465
|
});
|
|
6461
6466
|
const { options, style, children } = elementConfig || {};
|
|
6462
6467
|
const { maxLength, center, fontColor, innerTemplateStyle, inlineUnits, big, bigIcon, hideEmpty, colorAttribute } = options || {};
|
|
6468
|
+
const iconElement = children?.find(({ id }) => id === "icon");
|
|
6463
6469
|
const aliasElement = children?.find(({ id }) => id === "alias");
|
|
6464
6470
|
const unitsElement = children?.find(({ id }) => id === "units");
|
|
6465
6471
|
const valueElement = children?.find(({ id }) => id === "value");
|
|
6466
6472
|
const value = renderElement({ id: "value" });
|
|
6467
6473
|
const color = useMemo(() => attributes?.find(({ name }) => name === colorAttribute)?.value || fontColor, [attributes, colorAttribute, fontColor]);
|
|
6474
|
+
const renderIcon = useMemo(() => {
|
|
6475
|
+
if (!iconElement)
|
|
6476
|
+
return null;
|
|
6477
|
+
return (jsx(FlexSpan, { width: iconElement.options?.width || "1rem", alignItems: "center", mr: "0.5rem", children: renderElement({ id: "icon", wrap: false }) }));
|
|
6478
|
+
}, [iconElement, renderElement]);
|
|
6468
6479
|
const renderAlias = useMemo(() => (jsx(ContainerAlias, { style: aliasElement?.style, children: jsx(TextTrim, { maxLength: maxLength || ALIAS_DEFAULT_MAX_LENGTH, children: renderElement({ id: "alias", wrap: false }) }) })), [aliasElement?.style, maxLength, renderElement]);
|
|
6469
6480
|
const renderValue = useMemo(() => (jsxs(ContainerValue, { style: valueElement?.style, big: true, children: [value, !!unitsElement && (jsx(ContainerUnits, { style: unitsElement?.style, children: renderElement({ id: "units" }) }))] })), [valueElement?.style, value, unitsElement, renderElement]);
|
|
6470
6481
|
if (!value && hideEmpty)
|
|
6471
6482
|
return null;
|
|
6472
|
-
return (jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxs(ContainerIconValue, { children: [
|
|
6483
|
+
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] }));
|
|
6473
6484
|
});
|
|
6474
6485
|
|
|
6475
6486
|
const AddFeatureContainer = memo(({ elementConfig }) => {
|
|
@@ -6757,7 +6768,7 @@ const HeaderTitle = ({ noFeature }) => {
|
|
|
6757
6768
|
})) ||
|
|
6758
6769
|
feature?.id);
|
|
6759
6770
|
}, [attributes, feature, layerDefinition]);
|
|
6760
|
-
return (jsxs(HeaderTitleContainer, { children: [noFeature ? (jsx(FeatureTitleContainer, { children: t("noObjectFound", { ns: "dashboard" }) })) : (jsx(FeatureTitleContainer, { clickable: true, children: jsx(Tooltip$1, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard" }), delay: [600, 0], children: ref => (jsx(FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) })), jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
6771
|
+
return (jsxs(HeaderTitleContainer, { children: [noFeature ? (jsx(FeatureTitleContainer, { children: t("noObjectFound", { ns: "dashboard", defaultValue: "Объектов не найдено" }) })) : (jsx(FeatureTitleContainer, { clickable: true, children: jsx(Tooltip$1, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard", defaultValue: "Приблизить к объекту" }), delay: [600, 0], children: ref => (jsx(FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) })), jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
6761
6772
|
};
|
|
6762
6773
|
|
|
6763
6774
|
const LayerIconContainer = styled.div `
|
|
@@ -7167,7 +7178,7 @@ const SmallPreview = ({ images, totalCount, currentIndex, isLoading, setCurrentI
|
|
|
7167
7178
|
onNextPage();
|
|
7168
7179
|
}
|
|
7169
7180
|
}, [currentIndex, images, isNextDisabled, onNextPage, setCurrentIndex]);
|
|
7170
|
-
return (jsxs(SmallPreviewContainer$1, { currentIndex: currentIndex + 1, prevIndex: prevIndex + 1, children: [isLoading && jsx(LinearProgress, {}), images.length > 1 && (jsxs(Fragment$1, { children: [jsx(SmallPreviewLeft, { "$isDisabled": isPrevDisabled, onClick: prev }), jsx(SmallPreviewRight, { "$isDisabled": isNextDisabled, onClick: next }), jsx(SmallPreviewCounter, { children: jsxs("div", { children: [currentIndex + 1, " ", t("of", { ns: "dashboard" }), " ", total] }) })] })), jsx(SmallPreviewImages, { onClick: onClick, children: images.map(image => (jsx("img", { src: image.src, alt: "" }, image.src))) })] }));
|
|
7181
|
+
return (jsxs(SmallPreviewContainer$1, { currentIndex: currentIndex + 1, prevIndex: prevIndex + 1, children: [isLoading && jsx(LinearProgress, {}), images.length > 1 && (jsxs(Fragment$1, { children: [jsx(SmallPreviewLeft, { "$isDisabled": isPrevDisabled, onClick: prev }), jsx(SmallPreviewRight, { "$isDisabled": isNextDisabled, onClick: next }), jsx(SmallPreviewCounter, { children: jsxs("div", { children: [currentIndex + 1, " ", t("of", { ns: "dashboard", defaultValue: "из" }), " ", total] }) })] })), jsx(SmallPreviewImages, { onClick: onClick, children: images.map(image => (jsx("img", { src: image.src, alt: "" }, image.src))) })] }));
|
|
7171
7182
|
};
|
|
7172
7183
|
|
|
7173
7184
|
const DEFAULT_ARCHIVED_PERIOD = "#24h";
|
|
@@ -7436,7 +7447,7 @@ const LocalLink = memo(({ link }) => {
|
|
|
7436
7447
|
navigator.clipboard.writeText(link);
|
|
7437
7448
|
toggleOpen();
|
|
7438
7449
|
}, [link, toggleOpen]);
|
|
7439
|
-
return (jsx(Popover, { open: isOpen, zIndex: 10, onRequestClose: toggleOpen, anchorOrigin: "bottom-right", targetOrigin: "top-right", anchor: jsx(LocalLinkButton, { onClick: toggleOpen }), children: jsxs(LocalLinkBlank, { children: [jsx("a", { href: link, target: "_blank", rel: "noreferrer", children: link }), jsx(LocalLinkCopy, { children: jsx(IconButton, { kind: "copy", onClick: onCopy, children: t("copy", { ns: "dashboard" }) }) })] }) }));
|
|
7450
|
+
return (jsx(Popover, { open: isOpen, zIndex: 10, onRequestClose: toggleOpen, anchorOrigin: "bottom-right", targetOrigin: "top-right", anchor: jsx(LocalLinkButton, { onClick: toggleOpen }), children: jsxs(LocalLinkBlank, { children: [jsx("a", { href: link, target: "_blank", rel: "noreferrer", children: link }), jsx(LocalLinkCopy, { children: jsx(IconButton, { kind: "copy", onClick: onCopy, children: t("copy", { ns: "dashboard", defaultValue: "Копировать" }) }) })] }) }));
|
|
7440
7451
|
});
|
|
7441
7452
|
|
|
7442
7453
|
const ElementLink = memo(({ type, elementConfig }) => {
|
|
@@ -7631,7 +7642,7 @@ const getDataFromAttributes = (t, config, attributes) => {
|
|
|
7631
7642
|
return [
|
|
7632
7643
|
...data?.slice(0, config.options?.otherItems),
|
|
7633
7644
|
{
|
|
7634
|
-
name: t("other", { ns: "dashboard" }),
|
|
7645
|
+
name: t("other", { ns: "dashboard", defaultValue: "Другое" }),
|
|
7635
7646
|
color: FEATURE_CARD_OTHER_COLOR,
|
|
7636
7647
|
value: Number(otherValue)
|
|
7637
7648
|
}
|
|
@@ -7694,7 +7705,7 @@ const getDataFromRelatedFeatures = ({ t, config, filters, relatedConfig, dataSou
|
|
|
7694
7705
|
}, []);
|
|
7695
7706
|
if (isOtherSliced) {
|
|
7696
7707
|
result.push({
|
|
7697
|
-
name: t("other", { ns: "dashboard" }),
|
|
7708
|
+
name: t("other", { ns: "dashboard", defaultValue: "Другое" }),
|
|
7698
7709
|
color: FEATURE_CARD_OTHER_COLOR,
|
|
7699
7710
|
value: Number(otherValue)
|
|
7700
7711
|
});
|
|
@@ -7843,7 +7854,7 @@ const RangeNumberFilter = ({ type, filter }) => {
|
|
|
7843
7854
|
const configFilter = getConfigFilter(filterName, configFilters);
|
|
7844
7855
|
if (!configFilter)
|
|
7845
7856
|
return null;
|
|
7846
|
-
return (jsx(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 }));
|
|
7857
|
+
return (jsx(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 }));
|
|
7847
7858
|
};
|
|
7848
7859
|
|
|
7849
7860
|
const TextFilter = ({ type, filter, config }) => {
|
|
@@ -8023,7 +8034,7 @@ const CheckboxFilter = ({ type, filter, elementConfig }) => {
|
|
|
8023
8034
|
});
|
|
8024
8035
|
changeFilters({ [filterName]: { value } });
|
|
8025
8036
|
} }, optionIndex));
|
|
8026
|
-
}), showMoreBtn && (jsx(LegendToggler, { onClick: onShowMore, toggled: showMore, children: showMore ? t("hide", { ns: "dashboard" }) : t("showAll", { ns: "dashboard" }) }))] }));
|
|
8037
|
+
}), showMoreBtn && (jsx(LegendToggler, { onClick: onShowMore, toggled: showMore, children: showMore ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("showAll", { ns: "dashboard", defaultValue: "Показать все" }) }))] }));
|
|
8027
8038
|
};
|
|
8028
8039
|
|
|
8029
8040
|
const ChartLoading = ({ column }) => (jsx(Flex, { position: "absolute", width: "100%", height: "inherit", children: jsx(Flex, { justifyContent: "center", alignContent: "center", alignItems: "center", width: "100%", height: "inherit", marginRight: column || column === undefined ? 0 : "-2rem", children: jsx(CircularProgress, { diameter: 1.5, mono: true }) }) }));
|
|
@@ -8315,7 +8326,7 @@ const RangeDateFilter = ({ type, filter }) => {
|
|
|
8315
8326
|
}, [value]); // eslint-disable-line
|
|
8316
8327
|
if (!configFilter)
|
|
8317
8328
|
return null;
|
|
8318
|
-
return (jsx(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: jsx(Icon, { kind: "date", disabled: true }), suffix: !isEmpty && !isDefault && jsx(StyledIconButton, { kind: "error", onClick: reset }), withTime: withTime, isDate: true, onChange: onChange }));
|
|
8329
|
+
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 }));
|
|
8319
8330
|
};
|
|
8320
8331
|
|
|
8321
8332
|
const getFilterComponent = (filterType) => {
|
|
@@ -8384,8 +8395,8 @@ const getFormattedAttributes = (t, data, attributes, config) => {
|
|
|
8384
8395
|
...attributes,
|
|
8385
8396
|
{
|
|
8386
8397
|
...otherAttribute,
|
|
8387
|
-
name: t("other", { ns: "dashboard" }),
|
|
8388
|
-
alias: t("other", { ns: "dashboard" })
|
|
8398
|
+
name: t("other", { ns: "dashboard", defaultValue: "Другое" }),
|
|
8399
|
+
alias: t("other", { ns: "dashboard", defaultValue: "Другое" })
|
|
8389
8400
|
}
|
|
8390
8401
|
]
|
|
8391
8402
|
: attributes;
|
|
@@ -8630,7 +8641,7 @@ const useWidgetPage = (type = WidgetType.Dashboard) => {
|
|
|
8630
8641
|
const pages = getPagesFromProjectInfo(newProjectInfo);
|
|
8631
8642
|
if (!pages)
|
|
8632
8643
|
return;
|
|
8633
|
-
pages.push(createConfigPage({ pages, defaultTitle: t("page", { ns: "dashboard" }) }));
|
|
8644
|
+
pages.push(createConfigPage({ pages, defaultTitle: t("page", { ns: "dashboard", defaultValue: "Страница" }) }));
|
|
8634
8645
|
updateProject(newProjectInfo);
|
|
8635
8646
|
changePage(pages.length);
|
|
8636
8647
|
}, [changePage, projectInfo, t, updateProject]);
|
|
@@ -9288,7 +9299,7 @@ const ChartLegend = ({ data, chartElement, type, twoColumns, loading }) => {
|
|
|
9288
9299
|
const showMoreBtn = !!shownItems && data.length > shownItems;
|
|
9289
9300
|
if (!loading && !data?.length && !!hideEmpty)
|
|
9290
9301
|
return null;
|
|
9291
|
-
return (jsxs(Flex, { flexDirection: "column", opacity: loading ? FILTERED_VALUE_OPACITY / 100 : 1, children: [jsx(ChartLegendContainer, { twoColumns: twoColumns, children: sliceItems(data)?.map(({ name, color }, index) => (jsxs(ChartLegendItem, { hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: axes?.[0]?.filterName ? () => onFilter(name) : undefined, children: [jsx(ChartLegendColor, { color: color }), jsx(ChartLegendName, { "$fontColor": fontColor, children: name })] }, index))) }), showMoreBtn && (jsx(LegendToggler, { onClick: onShowMore, toggled: showMore, children: t("other", { ns: "dashboard" }) }))] }));
|
|
9302
|
+
return (jsxs(Flex, { flexDirection: "column", opacity: loading ? FILTERED_VALUE_OPACITY / 100 : 1, children: [jsx(ChartLegendContainer, { twoColumns: twoColumns, children: sliceItems(data)?.map(({ name, color }, index) => (jsxs(ChartLegendItem, { hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: axes?.[0]?.filterName ? () => onFilter(name) : undefined, children: [jsx(ChartLegendColor, { color: color }), jsx(ChartLegendName, { "$fontColor": fontColor, children: name })] }, index))) }), showMoreBtn && (jsx(LegendToggler, { onClick: onShowMore, toggled: showMore, children: t("other", { ns: "dashboard", defaultValue: "Другое" }) }))] }));
|
|
9292
9303
|
};
|
|
9293
9304
|
|
|
9294
9305
|
const ContainerChildren = memo(({ items, isColumn, isMain, renderElement }) => {
|
|
@@ -9337,7 +9348,7 @@ const DashboardHeader = memo(() => {
|
|
|
9337
9348
|
|
|
9338
9349
|
const DataSourceError = ({ name }) => {
|
|
9339
9350
|
const { t } = useGlobalContext();
|
|
9340
|
-
return (jsxs(DataSourceErrorContainer, { children: [jsx(Icon, { kind: "alert" }), jsxs("div", { children: [t("block", { ns: "dashboard" }), " \"", name, "\" ", t("isNotLoaded", { ns: "dashboard" })] })] }));
|
|
9351
|
+
return (jsxs(DataSourceErrorContainer, { children: [jsx(Icon, { kind: "alert" }), jsxs("div", { children: [t("block", { ns: "dashboard", defaultValue: "Блок" }), " \"", name, "\" ", t("isNotLoaded", { ns: "dashboard", defaultValue: "не загружен" })] })] }));
|
|
9341
9352
|
};
|
|
9342
9353
|
|
|
9343
9354
|
const ExpandableTitle = memo(({ elementConfig, type, renderElement }) => {
|
|
@@ -9392,7 +9403,7 @@ const FeatureCardTitle = ({ title, description }) => {
|
|
|
9392
9403
|
})) ||
|
|
9393
9404
|
feature?.id);
|
|
9394
9405
|
}, [attributes, feature?.id, layerDefinition, title, titleAttribute]);
|
|
9395
|
-
return (jsxs(HeaderTitleContainer, { children: [jsx(FeatureTitleContainer, { clickable: true, children: jsx(Tooltip$1, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard" }), delay: [600, 0], children: ref => (jsx(FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) }), jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
9406
|
+
return (jsxs(HeaderTitleContainer, { children: [jsx(FeatureTitleContainer, { clickable: true, children: jsx(Tooltip$1, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard", defaultValue: "Приблизить к объекту" }), delay: [600, 0], children: ref => (jsx(FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) }), jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
9396
9407
|
};
|
|
9397
9408
|
|
|
9398
9409
|
const HiddenFilters = styled(Flex) `
|
|
@@ -9522,7 +9533,8 @@ const StyledSvgColorMixin = css `
|
|
|
9522
9533
|
}
|
|
9523
9534
|
}
|
|
9524
9535
|
`;
|
|
9525
|
-
const StyledSvg = styled
|
|
9536
|
+
const StyledSvg = styled(Flex) `
|
|
9537
|
+
align-items: center;
|
|
9526
9538
|
${({ $width }) => !!$width && StyledSvgWidthMixin};
|
|
9527
9539
|
${({ $height }) => !!$height && StyledSvgHeightMixin};
|
|
9528
9540
|
${({ $fontColor }) => !!$fontColor && StyledSvgColorMixin};
|
|
@@ -9546,8 +9558,6 @@ const SvgImage = memo(({ url, width, height, fontColor }) => {
|
|
|
9546
9558
|
useEffect(() => () => {
|
|
9547
9559
|
setSvg(null);
|
|
9548
9560
|
}, []);
|
|
9549
|
-
// Todo remove the test info
|
|
9550
|
-
console.info("svg", svg);
|
|
9551
9561
|
const regexp = /<\/svg>\s*$/im;
|
|
9552
9562
|
if (!regexp.test(svg))
|
|
9553
9563
|
return null;
|
|
@@ -9567,7 +9577,7 @@ const TextTrim = memo(({ maxLength, expandable, lineBreak, children }) => {
|
|
|
9567
9577
|
return jsx(Fragment$1, { children: formatValue(text) });
|
|
9568
9578
|
const substring = `${text.substring(0, maxLength)}...`;
|
|
9569
9579
|
if (expandable) {
|
|
9570
|
-
return (jsxs(Fragment$1, { children: [formatValue(expanded ? text : substring), jsx(LegendToggler, { toggled: expanded, onClick: toggleExpanded, children: expanded ? t("hide", { ns: "dashboard" }) : t("more", { ns: "dashboard" }) })] }));
|
|
9580
|
+
return (jsxs(Fragment$1, { children: [formatValue(expanded ? text : substring), jsx(LegendToggler, { toggled: expanded, onClick: toggleExpanded, children: expanded ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("more", { ns: "dashboard", defaultValue: "Подробнее" }) })] }));
|
|
9571
9581
|
}
|
|
9572
9582
|
return (jsx(Tooltip$1, { placement: "top", arrow: true, content: text, children: ref => jsx("div", { ref: ref, children: formatValue(substring) }) }));
|
|
9573
9583
|
});
|