@evergis/react 3.1.113 → 3.1.118
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/EditBooleanContainer/index.d.ts +3 -0
- package/dist/components/Dashboard/containers/EditGroupContainer/index.d.ts +3 -0
- package/dist/components/Dashboard/containers/EditStringContainer/index.d.ts +3 -0
- package/dist/components/Dashboard/containers/registry.d.ts +3 -0
- package/dist/components/Dashboard/hooks/index.d.ts +0 -1
- package/dist/components/Dashboard/types.d.ts +3 -0
- package/dist/components/Dashboard/utils/getTemplateNameFromAttribute.d.ts +2 -0
- package/dist/components/Dashboard/utils/index.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +145 -127
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +145 -129
- package/dist/react.esm.js.map +1 -1
- package/package.json +4 -4
- package/dist/components/Dashboard/hooks/useMultipleAttributesRender.d.ts +0 -13
package/dist/react.esm.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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, Dialog, DialogTitle, ThemeProvider, darkTheme, DialogContent, CircularProgress, LinearProgress, H2, defaultTheme, Preview, Dropdown, Blank, Popover, UploaderItemArea, UploaderTitleWrapper, Uploader, NumberRangeSlider, useAsyncAutocomplete, AutoComplete,
|
|
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, Dialog, DialogTitle, ThemeProvider, darkTheme, DialogContent, CircularProgress, Checkbox, Input, LinearProgress, H2, defaultTheme, Preview, Dropdown, Blank, Popover, UploaderItemArea, UploaderTitleWrapper, Uploader, NumberRangeSlider, useAsyncAutocomplete, AutoComplete, RangeNumberInput, dateFormat } from '@evergis/uilib-gl';
|
|
3
3
|
import { createContext, memo, useRef, useState, useCallback, useEffect, 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';
|
|
6
6
|
import { AttributeType, generateId, GeometryType, RemoteTaskStatus } from '@evergis/api';
|
|
7
7
|
import Gradient from 'javascript-color-gradient';
|
|
8
8
|
import { Color as Color$1 } from '@evergis/color';
|
|
9
|
-
import { isValid, format, parseJSON, parseISO, toDate
|
|
9
|
+
import { isValid, format, parseJSON, parseISO, toDate } from 'date-fns';
|
|
10
10
|
import { ru } from 'date-fns/locale/ru';
|
|
11
11
|
import { enUS } from 'date-fns/locale/en-US';
|
|
12
12
|
import { uniqueId, isNil, isEmpty, isEqual, unescape } from 'lodash';
|
|
@@ -3387,7 +3387,10 @@ var ContainerTemplate;
|
|
|
3387
3387
|
ContainerTemplate["ExportPdf"] = "ExportPdf";
|
|
3388
3388
|
ContainerTemplate["Upload"] = "Upload";
|
|
3389
3389
|
ContainerTemplate["Task"] = "Task";
|
|
3390
|
+
ContainerTemplate["EditGroup"] = "EditGroup";
|
|
3390
3391
|
ContainerTemplate["Edit"] = "Edit";
|
|
3392
|
+
ContainerTemplate["EditString"] = "EditString";
|
|
3393
|
+
ContainerTemplate["EditBoolean"] = "EditBoolean";
|
|
3391
3394
|
ContainerTemplate["Divider"] = "Divider";
|
|
3392
3395
|
})(ContainerTemplate || (ContainerTemplate = {}));
|
|
3393
3396
|
var HeaderTemplate;
|
|
@@ -5520,7 +5523,7 @@ const LayerTree = ({ layers, onlyMainTools }) => {
|
|
|
5520
5523
|
if (!page) {
|
|
5521
5524
|
return;
|
|
5522
5525
|
}
|
|
5523
|
-
page.layers = treeNodesToProjectItems(page.layers, updatedNodes
|
|
5526
|
+
page.layers = treeNodesToProjectItems(page.layers, updatedNodes);
|
|
5524
5527
|
updateProject(newProjectInfo);
|
|
5525
5528
|
}, [pageIndex, projectInfo, updateProject]);
|
|
5526
5529
|
return (jsx(DraggableTree, { nodes: nodes, disableDrag: onlyMainTools, options: { pastePlaceholderHeight: "0.0625rem" }, onUpdate: onUpdate }));
|
|
@@ -6122,31 +6125,31 @@ const useRenderContainerItem = (type, renderElement) => {
|
|
|
6122
6125
|
}, []);
|
|
6123
6126
|
};
|
|
6124
6127
|
|
|
6125
|
-
const BASE_STYLE = {
|
|
6128
|
+
const BASE_STYLE$2 = {
|
|
6126
6129
|
marginBottom: "1rem",
|
|
6127
6130
|
};
|
|
6128
6131
|
const OneColumnContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
6129
6132
|
const getRenderContainerItem = useRenderContainerItem(type, renderElement);
|
|
6130
6133
|
const { options } = elementConfig || {};
|
|
6131
|
-
const { attributes: renderAttributes
|
|
6134
|
+
const { attributes: renderAttributes } = options || {};
|
|
6132
6135
|
const renderContainer = useCallback((attribute) => {
|
|
6133
6136
|
const { id, value, hideEmpty, style, hasUnits, render } = getRenderContainerItem(elementConfig, attribute);
|
|
6134
6137
|
if (!value && hideEmpty)
|
|
6135
6138
|
return null;
|
|
6136
|
-
return (jsxs(Container, { id: id, isColumn: true, style: { ...BASE_STYLE, ...
|
|
6137
|
-
}, [getRenderContainerItem, elementConfig
|
|
6139
|
+
return (jsxs(Container, { id: id, isColumn: true, style: { ...BASE_STYLE$2, ...style }, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [render({ id: "alias" }), render({ id: "tooltip" })] }), jsxs(ContainerValue, { children: [value, hasUnits && jsx(ContainerUnits, { children: render({ id: "units" }) })] })] }));
|
|
6140
|
+
}, [getRenderContainerItem, elementConfig]);
|
|
6138
6141
|
return renderAttributes?.length ? (jsx(Fragment$1, { children: renderAttributes.map(attribute => renderContainer(attribute)) })) : (renderContainer());
|
|
6139
6142
|
});
|
|
6140
6143
|
|
|
6141
6144
|
const TwoColumnContainer = memo(({ elementConfig, type, renderElement }) => {
|
|
6142
6145
|
const getRenderContainerItem = useRenderContainerItem(type, renderElement);
|
|
6143
6146
|
const { options } = elementConfig || {};
|
|
6144
|
-
const { attributes: renderAttributes
|
|
6147
|
+
const { attributes: renderAttributes } = options || {};
|
|
6145
6148
|
const renderContainer = useCallback((attribute) => {
|
|
6146
6149
|
const { id, value, hideEmpty, style, hasIcon, hasUnits, render } = getRenderContainerItem(elementConfig, attribute);
|
|
6147
6150
|
if (!value && hideEmpty)
|
|
6148
6151
|
return null;
|
|
6149
|
-
return (jsxs(TwoColumnContainerWrapper, { id: id, style:
|
|
6152
|
+
return (jsxs(TwoColumnContainerWrapper, { id: id, style: 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));
|
|
6150
6153
|
}, [getRenderContainerItem, elementConfig]);
|
|
6151
6154
|
return renderAttributes?.length ? (jsx(Fragment$1, { children: renderAttributes.map(attribute => renderContainer(attribute)) })) : (renderContainer());
|
|
6152
6155
|
});
|
|
@@ -7376,6 +7379,61 @@ const EditContainer = ({ type, elementConfig, renderElement }) => {
|
|
|
7376
7379
|
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), jsxs(Container, { id: id, isColumn: true, style: style, children: [jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsx(ContainerValue, { children: renderElement({ id: "value" }) })] })] }));
|
|
7377
7380
|
};
|
|
7378
7381
|
|
|
7382
|
+
const BASE_STYLE$1 = {
|
|
7383
|
+
marginBottom: "1rem",
|
|
7384
|
+
};
|
|
7385
|
+
const EditBooleanContainer = ({ elementConfig, renderElement }) => {
|
|
7386
|
+
const { id, style } = elementConfig || {};
|
|
7387
|
+
return (jsxs(Container, { id: id, isColumn: true, style: { ...BASE_STYLE$1, ...style }, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxs(ContainerValue, { children: [jsx(Checkbox, { label: "\u0414\u0430", checked: false, onChange: () => {
|
|
7388
|
+
console.info("onChange yes");
|
|
7389
|
+
} }), jsx(Checkbox, { label: "\u041D\u0435\u0442", checked: false, onChange: () => {
|
|
7390
|
+
console.info("onChange no");
|
|
7391
|
+
} })] })] }));
|
|
7392
|
+
};
|
|
7393
|
+
|
|
7394
|
+
const BASE_STYLE = {
|
|
7395
|
+
marginBottom: "1rem",
|
|
7396
|
+
};
|
|
7397
|
+
const EditStringContainer = ({ elementConfig, renderElement }) => {
|
|
7398
|
+
const { id, style } = elementConfig || {};
|
|
7399
|
+
return (jsxs(Container, { id: id, isColumn: true, style: { ...BASE_STYLE, ...style }, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsx(ContainerValue, { children: jsx(Input, { value: renderElement({ id: "value", wrap: false }) }) })] }));
|
|
7400
|
+
};
|
|
7401
|
+
|
|
7402
|
+
const EditGroupContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
7403
|
+
const { config, attributes, layerInfo, expandedContainers } = useWidgetContext(type);
|
|
7404
|
+
const getRenderContainerItem = useRenderContainerItem(type, renderElement);
|
|
7405
|
+
const { id, options } = elementConfig || {};
|
|
7406
|
+
const { attributes: renderAttributes } = options || {};
|
|
7407
|
+
const renderContainer = useCallback((attribute) => {
|
|
7408
|
+
const itemAttribute = attributes.find(({ name }) => name === attribute);
|
|
7409
|
+
const templateName = getTemplateNameFromAttribute(itemAttribute);
|
|
7410
|
+
const itemConfig = {
|
|
7411
|
+
...elementConfig,
|
|
7412
|
+
children: elementConfig.children.map(child => ({ ...child, attributeName: attribute })),
|
|
7413
|
+
templateName,
|
|
7414
|
+
};
|
|
7415
|
+
const { expandable, expanded } = elementConfig.options;
|
|
7416
|
+
const { id, value, style, render } = getRenderContainerItem(itemConfig, attribute);
|
|
7417
|
+
const ContainerTemplateValue = getContainerComponent(templateName);
|
|
7418
|
+
if (!ContainerTemplateValue) {
|
|
7419
|
+
return null;
|
|
7420
|
+
}
|
|
7421
|
+
return (jsx(ContainerTemplateValue, { id: attribute, type: type, config: config, elementConfig: itemConfig, layerInfo: layerInfo, attributes: attributes, innerComponent: getContainerComponent(templateName), isVisible: isVisibleContainer(id, expandable, expanded, expandedContainers), renderElement: render }, attribute));
|
|
7422
|
+
/* return (
|
|
7423
|
+
<Container id={id} isColumn style={{ ...BASE_STYLE, ...style }}>
|
|
7424
|
+
<ContainerAlias hasBottomMargin>
|
|
7425
|
+
{render({ id: "alias" })}
|
|
7426
|
+
{render({ id: "tooltip" })}
|
|
7427
|
+
</ContainerAlias>
|
|
7428
|
+
<ContainerValue>
|
|
7429
|
+
{value}
|
|
7430
|
+
</ContainerValue>
|
|
7431
|
+
</Container>
|
|
7432
|
+
);*/
|
|
7433
|
+
}, [id, attributes, elementConfig, expandedContainers]);
|
|
7434
|
+
return renderAttributes?.length ? (jsx(Fragment$1, { children: renderAttributes.map(attribute => renderContainer(attribute)) })) : (renderContainer());
|
|
7435
|
+
});
|
|
7436
|
+
|
|
7379
7437
|
const ContainerDivider = styled(Divider) `
|
|
7380
7438
|
width: 100%;
|
|
7381
7439
|
border-color: ${({ theme: { palette }, $bgColor }) => $bgColor || palette.elementDeep};
|
|
@@ -7410,6 +7468,9 @@ const containerComponents = {
|
|
|
7410
7468
|
[ContainerTemplate.Upload]: UploadContainer,
|
|
7411
7469
|
[ContainerTemplate.Task]: TaskContainer,
|
|
7412
7470
|
[ContainerTemplate.Edit]: EditContainer,
|
|
7471
|
+
[ContainerTemplate.EditBoolean]: EditBooleanContainer,
|
|
7472
|
+
[ContainerTemplate.EditString]: EditStringContainer,
|
|
7473
|
+
[ContainerTemplate.EditGroup]: EditGroupContainer,
|
|
7413
7474
|
default: ContainersGroupContainer,
|
|
7414
7475
|
};
|
|
7415
7476
|
|
|
@@ -7681,6 +7742,8 @@ const HeaderTitle = ({ noFeature }) => {
|
|
|
7681
7742
|
const LayerIconContainer = styled.div `
|
|
7682
7743
|
display: flex;
|
|
7683
7744
|
align-items: center;
|
|
7745
|
+
justify-content: center;
|
|
7746
|
+
min-width: 2rem;
|
|
7684
7747
|
margin-right: 0.75rem;
|
|
7685
7748
|
`;
|
|
7686
7749
|
const AlertIconContainer = styled(Flex) `
|
|
@@ -8089,36 +8152,39 @@ const SmallPreview = ({ images, totalCount, currentIndex, isLoading, setCurrentI
|
|
|
8089
8152
|
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))) })] }));
|
|
8090
8153
|
};
|
|
8091
8154
|
|
|
8092
|
-
const DEFAULT_ARCHIVED_PERIOD = "#24h";
|
|
8093
|
-
const SNAPSHOTS_PER_PAGE = 10;
|
|
8094
|
-
const getDuration = (archivePeriod) => {
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
};
|
|
8155
|
+
// const DEFAULT_ARCHIVED_PERIOD = "#24h";
|
|
8156
|
+
// const SNAPSHOTS_PER_PAGE = 10;
|
|
8157
|
+
/* const getDuration = (archivePeriod: string): Record<string, number> => {
|
|
8158
|
+
const lastLetter = archivePeriod[archivePeriod.length - 1];
|
|
8159
|
+
const value = archivePeriod.slice(1, -1);
|
|
8160
|
+
|
|
8161
|
+
const prop =
|
|
8162
|
+
lastLetter === "d"
|
|
8163
|
+
? "days"
|
|
8164
|
+
: lastLetter === "h"
|
|
8165
|
+
? "hours"
|
|
8166
|
+
: lastLetter === "m"
|
|
8167
|
+
? "minutes"
|
|
8168
|
+
: lastLetter === "s"
|
|
8169
|
+
? "seconds"
|
|
8170
|
+
: null;
|
|
8171
|
+
|
|
8172
|
+
if (!lastLetter || !value || !prop) return {};
|
|
8173
|
+
|
|
8174
|
+
return { [prop]: Number(value) };
|
|
8175
|
+
};*/
|
|
8110
8176
|
const useCameraAttribute = (cameraId) => {
|
|
8111
|
-
const { api } = useGlobalContext();
|
|
8177
|
+
// const { api } = useGlobalContext();
|
|
8112
8178
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
8113
8179
|
const [currentPage, setCurrentPage] = useState(0);
|
|
8114
|
-
const [timeline, setTimeline] = useState([]);
|
|
8180
|
+
const [timeline, /* setTimeline*/] = useState([]);
|
|
8115
8181
|
const [isLoadingSnapshot, setLoadingSnapshot] = useState(false);
|
|
8116
8182
|
const [isLoadingTimeline, setLoadingTimeline] = useState(false);
|
|
8117
8183
|
const [isOpenGallery, toggleGallery] = useToggle();
|
|
8118
8184
|
const [galleryImages, setGalleryImages] = useState([]);
|
|
8119
8185
|
const imagesRef = useRef([]);
|
|
8120
8186
|
// Todo get archivePeriod from project configuration
|
|
8121
|
-
const archivePeriod = /* appConfig?.settings?.cameraAttribute?.archivePeriod ||*/ DEFAULT_ARCHIVED_PERIOD;
|
|
8187
|
+
// const archivePeriod = /* appConfig?.settings?.cameraAttribute?.archivePeriod ||*/ DEFAULT_ARCHIVED_PERIOD;
|
|
8122
8188
|
const onNextPage = useCallback(() => {
|
|
8123
8189
|
setCurrentPage(currentPage + 1);
|
|
8124
8190
|
}, [currentPage]);
|
|
@@ -8143,44 +8209,53 @@ const useCameraAttribute = (cameraId) => {
|
|
|
8143
8209
|
fileName: formatDate$1(new Date()),
|
|
8144
8210
|
},
|
|
8145
8211
|
]);
|
|
8146
|
-
|
|
8147
|
-
const
|
|
8148
|
-
const
|
|
8212
|
+
// api.cameras was removed, so the next code is temporarily commented
|
|
8213
|
+
/* const formatDateOptions = { dateFormat: DateFormat.UTC };
|
|
8214
|
+
const startTime = formatDate(sub(new Date(), getDuration(archivePeriod)), formatDateOptions);
|
|
8215
|
+
const endTime = formatDate(new Date(), formatDateOptions);
|
|
8149
8216
|
const timelineResponse = await api.cameras.getArchiveTimeline({ cameraId, startTime, endTime });
|
|
8150
|
-
|
|
8151
|
-
|
|
8217
|
+
|
|
8218
|
+
if (!timelineResponse.success || !timelineResponse.timeline.length) return;
|
|
8219
|
+
|
|
8152
8220
|
timelineResponse.timeline.reverse();
|
|
8153
|
-
|
|
8221
|
+
|
|
8222
|
+
setTimeline(timelineResponse.timeline);*/
|
|
8154
8223
|
})();
|
|
8155
8224
|
}, [cameraId]);
|
|
8156
8225
|
useEffect(() => {
|
|
8157
|
-
if (!timeline.length)
|
|
8158
|
-
|
|
8226
|
+
/* if (!timeline.length) return;
|
|
8227
|
+
|
|
8159
8228
|
const timelinePage = timeline.slice(currentPage * SNAPSHOTS_PER_PAGE, (currentPage + 1) * SNAPSHOTS_PER_PAGE);
|
|
8229
|
+
|
|
8160
8230
|
for (const item of timelinePage) {
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8231
|
+
if (!item) continue;
|
|
8232
|
+
|
|
8233
|
+
api.cameras
|
|
8234
|
+
.getArchiveSnapshot({
|
|
8235
|
+
cameraId,
|
|
8236
|
+
time: item.startTime,
|
|
8167
8237
|
})
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
}
|
|
8238
|
+
.then(response => {
|
|
8239
|
+
const newImages = [
|
|
8240
|
+
...imagesRef.current,
|
|
8241
|
+
{ src: URL.createObjectURL(response), startTime: new Date(item.startTime) },
|
|
8242
|
+
];
|
|
8243
|
+
|
|
8244
|
+
newImages.sort((a, b) => (a.startTime < b.startTime ? 1 : a.startTime > b.startTime ? -1 : 0));
|
|
8245
|
+
imagesRef.current = newImages;
|
|
8246
|
+
|
|
8247
|
+
setGalleryImages(
|
|
8248
|
+
newImages.map(newImage => ({
|
|
8249
|
+
src: newImage.src,
|
|
8250
|
+
fileName: formatDate(newImage.startTime, { dateFormat: DateFormat.DateTime }),
|
|
8251
|
+
})),
|
|
8252
|
+
);
|
|
8253
|
+
|
|
8254
|
+
if (newImages.length === timelinePage.length) {
|
|
8255
|
+
setLoadingTimeline(false);
|
|
8256
|
+
}
|
|
8182
8257
|
});
|
|
8183
|
-
}
|
|
8258
|
+
}*/
|
|
8184
8259
|
}, [timeline, currentPage]);
|
|
8185
8260
|
return [
|
|
8186
8261
|
{
|
|
@@ -10017,6 +10092,16 @@ const getSvgUrl = ({ elementConfig, layerInfo, attributes, }) => {
|
|
|
10017
10092
|
return getResourceUrl(url);
|
|
10018
10093
|
};
|
|
10019
10094
|
|
|
10095
|
+
const getTemplateNameFromAttribute = (attribute) => {
|
|
10096
|
+
switch (attribute?.type) {
|
|
10097
|
+
case AttributeType.Boolean: return ContainerTemplate.EditBoolean;
|
|
10098
|
+
case AttributeType.String:
|
|
10099
|
+
case AttributeType.LineString:
|
|
10100
|
+
case AttributeType.Unknown:
|
|
10101
|
+
default: return ContainerTemplate.EditString;
|
|
10102
|
+
}
|
|
10103
|
+
};
|
|
10104
|
+
|
|
10020
10105
|
const getTotalFromAttributes = (children, attributes) => {
|
|
10021
10106
|
const total = children?.reduce((result, { attributeName }) => {
|
|
10022
10107
|
const value = attributes?.find(({ name }) => name === attributeName)?.value || 0;
|
|
@@ -10784,75 +10869,6 @@ const useUpdateDataSource = ({ dataSource, config, filters, attributes, layerPar
|
|
|
10784
10869
|
}, [dataSource, getDataSourcePromises, getUpdatedDataSources, dataSources]);
|
|
10785
10870
|
};
|
|
10786
10871
|
|
|
10787
|
-
const useMultipleAttributesRender = (config, elementConfig, type, renderElement) => {
|
|
10788
|
-
const { selectedTabId, layerInfo, attributes } = useWidgetContext(type);
|
|
10789
|
-
const { attributes: renderAttributes, attributesExclude } = elementConfig?.options || {};
|
|
10790
|
-
const getAttributesToRender = useCallback(() => {
|
|
10791
|
-
if (renderAttributes) {
|
|
10792
|
-
return renderAttributes;
|
|
10793
|
-
}
|
|
10794
|
-
if (attributesExclude) {
|
|
10795
|
-
const allAttributes = attributes?.map(attr => attr.name) || [];
|
|
10796
|
-
return allAttributes.filter(attr => !attributesExclude.includes(attr));
|
|
10797
|
-
}
|
|
10798
|
-
return null;
|
|
10799
|
-
}, [renderAttributes, attributesExclude, attributes]);
|
|
10800
|
-
const renderContainer = useCallback((attribute) => {
|
|
10801
|
-
const { id, options, style, children } = elementConfig || {};
|
|
10802
|
-
const { hideEmpty, innerTemplateStyle } = options || {};
|
|
10803
|
-
const hasUnits = children?.some(({ id }) => id === "units");
|
|
10804
|
-
const iconIndex = children?.findIndex(({ id }) => id === "icon");
|
|
10805
|
-
const icon = children?.[iconIndex];
|
|
10806
|
-
const hasIcon = !!icon;
|
|
10807
|
-
const elementChildren = elementConfig?.children?.map(child => ({
|
|
10808
|
-
type: "attributeValue",
|
|
10809
|
-
...child,
|
|
10810
|
-
attributeName: attribute,
|
|
10811
|
-
options: { noUnits: hasUnits, ...child.options },
|
|
10812
|
-
}));
|
|
10813
|
-
const attr = attribute
|
|
10814
|
-
? layerInfo?.layerAttributes?.find(({ attributeName }) => attributeName === attribute)
|
|
10815
|
-
: null;
|
|
10816
|
-
if (hasIcon) {
|
|
10817
|
-
elementChildren[iconIndex] = {
|
|
10818
|
-
...elementChildren[iconIndex],
|
|
10819
|
-
type: attr?.icon?.type?.toLowerCase(),
|
|
10820
|
-
value: attr?.icon?.resourceId || attr?.icon?.url || attr?.icon?.iconName,
|
|
10821
|
-
attributeName: null,
|
|
10822
|
-
};
|
|
10823
|
-
}
|
|
10824
|
-
const render = attribute
|
|
10825
|
-
? getRenderElement({
|
|
10826
|
-
config,
|
|
10827
|
-
elementConfig: {
|
|
10828
|
-
...elementConfig,
|
|
10829
|
-
children: elementChildren,
|
|
10830
|
-
},
|
|
10831
|
-
selectedTabId,
|
|
10832
|
-
attributes,
|
|
10833
|
-
layerInfo,
|
|
10834
|
-
type,
|
|
10835
|
-
})
|
|
10836
|
-
: renderElement;
|
|
10837
|
-
const value = render({ id: "value" });
|
|
10838
|
-
if (!value && hideEmpty)
|
|
10839
|
-
return null;
|
|
10840
|
-
return {
|
|
10841
|
-
render,
|
|
10842
|
-
value,
|
|
10843
|
-
hasUnits,
|
|
10844
|
-
id,
|
|
10845
|
-
style: innerTemplateStyle || style,
|
|
10846
|
-
hasIcon,
|
|
10847
|
-
attr,
|
|
10848
|
-
};
|
|
10849
|
-
}, [attributes, config, getRenderElement, layerInfo, renderElement, selectedTabId, type, elementConfig]);
|
|
10850
|
-
return {
|
|
10851
|
-
getAttributesToRender,
|
|
10852
|
-
renderContainer,
|
|
10853
|
-
};
|
|
10854
|
-
};
|
|
10855
|
-
|
|
10856
10872
|
const StackBar = ({ data, filterName, type, alias, options, renderElement, renderTooltip }) => {
|
|
10857
10873
|
const { height, showTotal, cornerRadius, groupTooltip } = options || {};
|
|
10858
10874
|
const { t } = useGlobalContext();
|
|
@@ -11723,5 +11739,5 @@ const Map$1 = ({ zIndex, lowerSiblings, upperSiblings, onError, children, ...res
|
|
|
11723
11739
|
}, children: children }), upperSiblings] }));
|
|
11724
11740
|
};
|
|
11725
11741
|
|
|
11726
|
-
export { AddFeatureButton, AddFeatureContainer, AttributeGalleryContainer, AttributeLabel, BaseMapTheme, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, Container, ContainerChildren, ContainerLoading, ContainerTemplate, ContainerWrapper, ContainersGroupContainer, DEFAULT_ATTRIBUTE_NAME, DEFAULT_BARCHART_RADIUS, DEFAULT_BASE_MAP, DEFAULT_CHART_ANGLE, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_CIRCLE_PAINT, DEFAULT_DASHBOARD_CONFIG, DEFAULT_DATA_SOURCE_LIMIT, DEFAULT_DROPDOWN_WIDTH, DEFAULT_FILL_EXTRUSION_PAINT, DEFAULT_FILL_PAINT, DEFAULT_FILTER_PADDING, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LAT, DEFAULT_LINE_PAINT, DEFAULT_LNG, DEFAULT_PAGES_CONFIG, DEFAULT_PIECHART_RADIUS, DEFAULT_ZOOM, Dashboard, DashboardCheckbox, DashboardChip, DashboardContent, DashboardContext, DashboardDefaultHeader, DashboardHeader, DashboardLoading, DashboardPlaceholder, DashboardPlaceholderWrap, DashboardProvider, DashboardWrapper, DataSourceContainer, DataSourceError, DataSourceErrorContainer, DataSourceInnerContainer, DataSourceProgressContainer, DateFormat, DefaultAttributesContainer, DefaultHeaderContainer, DefaultHeaderWrapper, DividerContainer, EditGeometryType, ElementButton, ElementCamera, ElementChart, ElementChips, ElementControl, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementMarkdown, ElementSlideshow, ElementSvg, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILTERED_VALUE_OPACITY, FILTER_PREFIX, 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, LogTerminal, LogoContainer, MAX_CHART_WIDTH, Map$1 as Map, MapContext, MapProvider, NO_CONTENT_VALUE, NUMERIC_ATTRIBUTE_TYPES, NoLiveSnapshotContainer, OneColumnContainer, PageNavigator, PageTitle, PageTitleContainer, PagesContainer, Pagination, PresentationHeader, PresentationHeaderButtons, PresentationHeaderTools, PresentationPanelContainer, PresentationPanelWrapper, PresentationWrapper, ProgressContainer, RoundedBackgroundContainer, SERVER_NOTIFICATION_EVENT, 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, UploadContainer, WidgetType, addDataSource, addDataSources, adjustColor, 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, parseIconNames, parseIconNamesFromClientStyle, 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, useHideIfEmptyDataSource, useIconsFromLayers, useLayerParams, useMapContext, useMapDraw, useMapImages,
|
|
11742
|
+
export { AddFeatureButton, AddFeatureContainer, AlertIconContainer, AttributeGalleryContainer, AttributeLabel, BaseMapTheme, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, Container, ContainerChildren, ContainerLoading, ContainerTemplate, ContainerWrapper, ContainersGroupContainer, DEFAULT_ATTRIBUTE_NAME, DEFAULT_BARCHART_RADIUS, DEFAULT_BASE_MAP, DEFAULT_CHART_ANGLE, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_CIRCLE_PAINT, DEFAULT_DASHBOARD_CONFIG, DEFAULT_DATA_SOURCE_LIMIT, DEFAULT_DROPDOWN_WIDTH, DEFAULT_FILL_EXTRUSION_PAINT, DEFAULT_FILL_PAINT, DEFAULT_FILTER_PADDING, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LAT, DEFAULT_LINE_PAINT, DEFAULT_LNG, DEFAULT_PAGES_CONFIG, DEFAULT_PIECHART_RADIUS, DEFAULT_ZOOM, Dashboard, DashboardCheckbox, DashboardChip, DashboardContent, DashboardContext, DashboardDefaultHeader, DashboardHeader, DashboardLoading, DashboardPlaceholder, DashboardPlaceholderWrap, DashboardProvider, DashboardWrapper, DataSourceContainer, DataSourceError, DataSourceErrorContainer, DataSourceInnerContainer, DataSourceProgressContainer, DateFormat, DefaultAttributesContainer, DefaultHeaderContainer, DefaultHeaderWrapper, DividerContainer, EditGeometryType, ElementButton, ElementCamera, ElementChart, ElementChips, ElementControl, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementMarkdown, ElementSlideshow, ElementSvg, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILTERED_VALUE_OPACITY, FILTER_PREFIX, 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, LayerIconContainer, LayerListContainer, LayerTree, LayersContainer, LayersListWrapper, LinearProgressContainer, LogTerminal, LogoContainer, MAX_CHART_WIDTH, Map$1 as Map, MapContext, MapProvider, NO_CONTENT_VALUE, NUMERIC_ATTRIBUTE_TYPES, NoLiveSnapshotContainer, OneColumnContainer, PageNavigator, PageTitle, PageTitleContainer, PagesContainer, Pagination, PresentationHeader, PresentationHeaderButtons, PresentationHeaderTools, PresentationPanelContainer, PresentationPanelWrapper, PresentationWrapper, ProgressContainer, RoundedBackgroundContainer, SERVER_NOTIFICATION_EVENT, 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, UploadContainer, WidgetType, addDataSource, addDataSources, adjustColor, 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, getTemplateNameFromAttribute, getTotalFromAttributes, getTotalFromRelatedFeatures, hexToRgba, isCompositeLayerConfiguration, isEmptyElementValue, isEmptyValue, isHiddenEmptyValue, isLayerService, isNotValidSelectedTab, isNumeric, isObject, isProxyService, isVisibleContainer, numberOptions, parseClientStyle, parseIconNames, parseIconNamesFromClientStyle, 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, useHideIfEmptyDataSource, useIconsFromLayers, useLayerParams, useMapContext, useMapDraw, useMapImages, useProjectDashboardInit, usePythonTask, useRedrawLayer, useRelatedDataSourceAttributes, useRenderElement, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useWidgetConfig, useWidgetContext, useWidgetFilters, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
|
|
11727
11743
|
//# sourceMappingURL=react.esm.js.map
|