@evergis/react 4.0.28 → 4.0.30
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.
|
@@ -16,4 +16,5 @@ export declare const elementComponents: {
|
|
|
16
16
|
readonly markdown: import('react').FC<import('..').ContainerProps>;
|
|
17
17
|
readonly uploader: import('react').FC<import('..').ContainerProps>;
|
|
18
18
|
readonly modal: import('react').FC<import('..').ContainerProps>;
|
|
19
|
+
readonly layerName: import('react').FC<import('..').ContainerProps>;
|
|
19
20
|
};
|
package/dist/index.js
CHANGED
|
@@ -4443,6 +4443,10 @@ const applyQueryFilters = ({ parameters: configParameters, filters: configFilter
|
|
|
4443
4443
|
return result;
|
|
4444
4444
|
}
|
|
4445
4445
|
if (typeof configParameters[key] === "string" && configParameters[key].includes("{") && attributes?.length) {
|
|
4446
|
+
const exactAttr = attributes.find(({ attributeName }) => configParameters[key] === `{${attributeName}}`);
|
|
4447
|
+
if (exactAttr) {
|
|
4448
|
+
return { ...result, [key]: exactAttr.value ?? "" };
|
|
4449
|
+
}
|
|
4446
4450
|
let interpolated = configParameters[key];
|
|
4447
4451
|
attributes.forEach(({ attributeName, value: attrValue }) => {
|
|
4448
4452
|
interpolated = interpolated.replace(new RegExp(`\\{${attributeName}\\}`, "g"), attrValue?.toString() ?? "");
|
|
@@ -9391,6 +9395,13 @@ const ElementModal = React.memo(({ type = exports.WidgetType.Dashboard, elementC
|
|
|
9391
9395
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalIcon, { kind: icon || "new_window", onClick: handleOpen }), jsxRuntime.jsxs(uilibGl.Dialog, { isOpen: isOpen, onCloseRequest: handleClose, modal: true, maxWidth: maxWidth, minWidth: minWidth, minHeight: minHeight, style: { paddingBottom: "2rem" }, children: [jsxRuntime.jsx(uilibGl.DialogTitle, { children: jsxRuntime.jsxs(uilibGl.Flex, { justifyContent: "space-between", alignItems: "center", children: [!!title && jsxRuntime.jsx("span", { children: title }), jsxRuntime.jsx(uilibGl.IconButton, { kind: "close", onClick: handleClose })] }) }), jsxRuntime.jsx(uilibGl.DialogContent, { children: isLoading ? (jsxRuntime.jsx(DashboardLoading, {})) : (jsxRuntime.jsx(Container, { isColumn: true, noBorders: true, children: jsxRuntime.jsx(ContainerChildren, { type: type, items: modalContent, isMain: true, renderElement: renderElement }) })) })] })] }));
|
|
9392
9396
|
});
|
|
9393
9397
|
|
|
9398
|
+
const ElementLayerName = React.memo(({ type }) => {
|
|
9399
|
+
const { layerInfo } = useWidgetContext(type);
|
|
9400
|
+
if (!layerInfo?.name)
|
|
9401
|
+
return null;
|
|
9402
|
+
return jsxRuntime.jsx("span", { children: layerInfo.name });
|
|
9403
|
+
});
|
|
9404
|
+
|
|
9394
9405
|
const elementComponents = {
|
|
9395
9406
|
control: ElementControl,
|
|
9396
9407
|
image: ElementImage,
|
|
@@ -9407,6 +9418,7 @@ const elementComponents = {
|
|
|
9407
9418
|
markdown: ElementMarkdown,
|
|
9408
9419
|
uploader: ElementUploader,
|
|
9409
9420
|
modal: ElementModal,
|
|
9421
|
+
layerName: ElementLayerName,
|
|
9410
9422
|
};
|
|
9411
9423
|
|
|
9412
9424
|
const getElementValue = ({ getDefaultContainer, ...props }) => {
|
|
@@ -9468,7 +9480,7 @@ function getFeatureAttributes(feature = {}, layer, dataSource) {
|
|
|
9468
9480
|
const isIdAttribute = attributeName === idAttribute;
|
|
9469
9481
|
const additionalProps = isIdAttribute
|
|
9470
9482
|
? {
|
|
9471
|
-
value: idValue,
|
|
9483
|
+
value: currentAttributes?.[attributeName] ?? idValue,
|
|
9472
9484
|
readOnly: true,
|
|
9473
9485
|
}
|
|
9474
9486
|
: {
|