@evergis/react 4.0.36 → 4.0.37
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/headers/FeatureCardIconHeader/styled.d.ts +1 -0
- package/dist/index.js +18 -20
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +18 -20
- package/dist/react.esm.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/Dashboard/containers/TaskContainer/utils/buildEmptyFiltersFromResponse.d.ts +0 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const LayerIconClickable: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
1
2
|
export declare const HeaderIcon: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
|
2
3
|
export declare const IconHeaderWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
3
4
|
$fontColor?: string;
|
package/dist/index.js
CHANGED
|
@@ -9,9 +9,9 @@ var api = require('@evergis/api');
|
|
|
9
9
|
var Gradient = require('javascript-color-gradient');
|
|
10
10
|
var color$1 = require('@evergis/color');
|
|
11
11
|
var dateFns = require('date-fns');
|
|
12
|
+
var lodash = require('lodash');
|
|
12
13
|
var ru = require('date-fns/locale/ru');
|
|
13
14
|
var enUS = require('date-fns/locale/en-US');
|
|
14
|
-
var lodash = require('lodash');
|
|
15
15
|
var signalr = require('@microsoft/signalr');
|
|
16
16
|
var findAnd = require('find-and');
|
|
17
17
|
var jspdf = require('jspdf');
|
|
@@ -3829,15 +3829,16 @@ const formatNumberValue = (stringFormat, value, type, noUnits = false) => {
|
|
|
3829
3829
|
return currentValue?.toString() || "";
|
|
3830
3830
|
};
|
|
3831
3831
|
const formatAttributeValue = ({ t, type, value, stringFormat, noUnits = false }) => {
|
|
3832
|
+
const isNilValue = lodash.isNil(value);
|
|
3832
3833
|
if (type === api.AttributeType.Point) {
|
|
3833
|
-
if (!stringFormat?.format ||
|
|
3834
|
+
if (!stringFormat?.format || isNilValue) {
|
|
3834
3835
|
return null;
|
|
3835
3836
|
}
|
|
3836
3837
|
const { coordinates } = value;
|
|
3837
3838
|
return formatPointValue({ t, stringFormat, value: coordinates });
|
|
3838
3839
|
}
|
|
3839
3840
|
if (type === api.AttributeType.DateTime) {
|
|
3840
|
-
if (!stringFormat?.format ||
|
|
3841
|
+
if (!stringFormat?.format || isNilValue)
|
|
3841
3842
|
return null;
|
|
3842
3843
|
return formatDateValue(stringFormat, value);
|
|
3843
3844
|
}
|
|
@@ -3858,12 +3859,12 @@ const formatAttributeValue = ({ t, type, value, stringFormat, noUnits = false })
|
|
|
3858
3859
|
return formatNumberValue(stringFormat, value, type, noUnits);
|
|
3859
3860
|
}
|
|
3860
3861
|
if (type === api.AttributeType.Json) {
|
|
3861
|
-
if (
|
|
3862
|
+
if (isNilValue || value?.length === 0) {
|
|
3862
3863
|
return "";
|
|
3863
3864
|
}
|
|
3864
3865
|
return `${t("total", { ns: "table" })} ${value.length}`;
|
|
3865
3866
|
}
|
|
3866
|
-
return
|
|
3867
|
+
return !isNilValue ? value.toString() : "";
|
|
3867
3868
|
};
|
|
3868
3869
|
const formatNumber = (number) => {
|
|
3869
3870
|
let result = "";
|
|
@@ -6344,18 +6345,7 @@ const DataSourceInnerContainer = React.memo(({ config, elementConfig, feature, m
|
|
|
6344
6345
|
setSelectedTabId,
|
|
6345
6346
|
pageIndex,
|
|
6346
6347
|
type,
|
|
6347
|
-
}), [
|
|
6348
|
-
getRenderElement,
|
|
6349
|
-
config,
|
|
6350
|
-
elementConfig,
|
|
6351
|
-
attributes,
|
|
6352
|
-
layerInfo,
|
|
6353
|
-
expandedContainers,
|
|
6354
|
-
selectedTabId,
|
|
6355
|
-
setSelectedTabId,
|
|
6356
|
-
pageIndex,
|
|
6357
|
-
type,
|
|
6358
|
-
]);
|
|
6348
|
+
}), [config, elementConfig, attributes, layerInfo, expandedContainers, selectedTabId, setSelectedTabId, pageIndex, type]);
|
|
6359
6349
|
if (!InnerContainer) {
|
|
6360
6350
|
return null;
|
|
6361
6351
|
}
|
|
@@ -8150,6 +8140,11 @@ const FeatureCardGradientHeader = ({ isRow }) => {
|
|
|
8150
8140
|
}) })] }), jsxRuntime.jsx(FeatureCardButtons, {})] }) }) }) }));
|
|
8151
8141
|
};
|
|
8152
8142
|
|
|
8143
|
+
const LayerIconClickable = styled.div `
|
|
8144
|
+
display: flex;
|
|
8145
|
+
align-items: center;
|
|
8146
|
+
cursor: pointer;
|
|
8147
|
+
`;
|
|
8153
8148
|
const HeaderFontColorMixin = styled.css `
|
|
8154
8149
|
${HeaderTitleContainer}, ${HeaderTitleContainer} *, ${LayerDescription} {
|
|
8155
8150
|
color: ${({ $fontColor }) => $fontColor};
|
|
@@ -8227,13 +8222,16 @@ const IconHeaderWrapper = styled.div `
|
|
|
8227
8222
|
`;
|
|
8228
8223
|
|
|
8229
8224
|
const FeatureCardIconHeader = ({ isRow }) => {
|
|
8230
|
-
const {
|
|
8225
|
+
const { t } = useGlobalContext();
|
|
8226
|
+
const { layerInfo, feature } = useWidgetContext(exports.WidgetType.FeatureCard);
|
|
8231
8227
|
const { config } = useWidgetConfig(exports.WidgetType.FeatureCard);
|
|
8228
|
+
const zoomToFeatures = useZoomToFeatures();
|
|
8232
8229
|
const { header } = config || {};
|
|
8233
8230
|
const { options } = header || {};
|
|
8234
8231
|
const { fontColor, bgColor, bigIcon } = options || {};
|
|
8235
8232
|
const renderElement = useHeaderRender(header);
|
|
8236
|
-
|
|
8233
|
+
const handleIconClick = React.useCallback(() => zoomToFeatures([feature]), [zoomToFeatures, feature]);
|
|
8234
|
+
return (jsxRuntime.jsx(IconHeaderWrapper, { "$fontColor": fontColor, "$bgColor": bgColor, "$bigIcon": bigIcon, children: jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: uilibGl.defaultTheme, children: jsxRuntime.jsxs(Header, { "$isRow": isRow, children: [jsxRuntime.jsxs(HeaderFrontView, { children: [jsxRuntime.jsxs(HeaderContainer, { children: [jsxRuntime.jsx(uilibGl.Tooltip, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard", defaultValue: "Приблизить к объекту" }), delay: [600, 0], children: ref => (jsxRuntime.jsx(LayerIconClickable, { ref: ref, onClick: handleIconClick, children: jsxRuntime.jsx(LayerIcon, { layerInfo: layerInfo }) })) }), jsxRuntime.jsx(FeatureCardTitle, { title: renderElement({
|
|
8237
8235
|
id: "title",
|
|
8238
8236
|
wrap: false,
|
|
8239
8237
|
}), description: renderElement({
|
|
@@ -9535,7 +9533,7 @@ function getFeatureAttributes(feature = {}, layer, dataSource) {
|
|
|
9535
9533
|
readOnly: true,
|
|
9536
9534
|
}
|
|
9537
9535
|
: {
|
|
9538
|
-
value: currentAttributes?.[attributeName]
|
|
9536
|
+
value: currentAttributes?.[attributeName] ?? dataSource?.features?.[0]?.properties?.[attributeName],
|
|
9539
9537
|
readOnly: attributeConfigurationType === api.AttributeConfigurationType.Calculated || !isEditable,
|
|
9540
9538
|
};
|
|
9541
9539
|
const clientData = layer?.configuration?.attributesConfiguration?.attributes?.find(layerAttribute => layerAttribute.attributeName === attributeName)?.clientData;
|