@evergis/react 3.1.83 → 3.1.85
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { LayerReferenceConfigurationDc } from '@evergis/api';
|
|
3
|
-
import { LayerInfo, SelectedFeature } from '../../types';
|
|
4
3
|
import { ClientFeatureAttribute, ConfigContainer, SelectedFilters, WidgetDataSource } from '../../components';
|
|
4
|
+
import { LayerInfo, SelectedFeature } from '../../types';
|
|
5
5
|
export type FeatureCardContextSettings = PropsWithChildren<{
|
|
6
6
|
config?: ConfigContainer;
|
|
7
7
|
attributes?: ClientFeatureAttribute[];
|
package/dist/index.js
CHANGED
|
@@ -7778,7 +7778,7 @@ const ElementControl = ({ elementConfig }) => {
|
|
|
7778
7778
|
const { dataSources, controls, changeControls } = useWidgetContext(exports.WidgetType.FeatureCard);
|
|
7779
7779
|
const [value, setValue] = React.useState();
|
|
7780
7780
|
const { options, attributeName } = elementConfig || {};
|
|
7781
|
-
const { relatedDataSource,
|
|
7781
|
+
const { relatedDataSource, label, width, placeholder = t("selectValue", { ns: "dashboard", defaultValue: "Выберите значение" }) } = options || {};
|
|
7782
7782
|
const dataSource = React.useMemo(() => getDataSource(relatedDataSource, dataSources), [relatedDataSource, dataSources]);
|
|
7783
7783
|
const items = React.useMemo(() => {
|
|
7784
7784
|
if (!dataSource?.features?.length || !attributeName) {
|
|
@@ -7791,13 +7791,13 @@ const ElementControl = ({ elementConfig }) => {
|
|
|
7791
7791
|
}, [dataSource?.features, attributeName]);
|
|
7792
7792
|
const handleChange = React.useCallback(([option]) => {
|
|
7793
7793
|
setValue(option?.value);
|
|
7794
|
-
if (
|
|
7794
|
+
if (attributeName && changeControls) {
|
|
7795
7795
|
changeControls({
|
|
7796
|
-
[
|
|
7796
|
+
[attributeName]: option?.value,
|
|
7797
7797
|
});
|
|
7798
7798
|
}
|
|
7799
|
-
}, [changeControls,
|
|
7800
|
-
return (jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: 1000, width: `${width ?? DEFAULT_DROPDOWN_WIDTH}px`, label: label, options: items, value: controls?.[
|
|
7799
|
+
}, [changeControls, attributeName]);
|
|
7800
|
+
return (jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: 1000, width: `${width ?? DEFAULT_DROPDOWN_WIDTH}px`, label: label, options: items, value: controls?.[attributeName] ?? value, placeholder: placeholder, onChange: handleChange }));
|
|
7801
7801
|
};
|
|
7802
7802
|
|
|
7803
7803
|
const StyledIconFontSizeMixin = styled.css `
|
package/dist/react.esm.js
CHANGED
|
@@ -7776,7 +7776,7 @@ const ElementControl = ({ elementConfig }) => {
|
|
|
7776
7776
|
const { dataSources, controls, changeControls } = useWidgetContext(WidgetType.FeatureCard);
|
|
7777
7777
|
const [value, setValue] = useState();
|
|
7778
7778
|
const { options, attributeName } = elementConfig || {};
|
|
7779
|
-
const { relatedDataSource,
|
|
7779
|
+
const { relatedDataSource, label, width, placeholder = t("selectValue", { ns: "dashboard", defaultValue: "Выберите значение" }) } = options || {};
|
|
7780
7780
|
const dataSource = useMemo(() => getDataSource(relatedDataSource, dataSources), [relatedDataSource, dataSources]);
|
|
7781
7781
|
const items = useMemo(() => {
|
|
7782
7782
|
if (!dataSource?.features?.length || !attributeName) {
|
|
@@ -7789,13 +7789,13 @@ const ElementControl = ({ elementConfig }) => {
|
|
|
7789
7789
|
}, [dataSource?.features, attributeName]);
|
|
7790
7790
|
const handleChange = useCallback(([option]) => {
|
|
7791
7791
|
setValue(option?.value);
|
|
7792
|
-
if (
|
|
7792
|
+
if (attributeName && changeControls) {
|
|
7793
7793
|
changeControls({
|
|
7794
|
-
[
|
|
7794
|
+
[attributeName]: option?.value,
|
|
7795
7795
|
});
|
|
7796
7796
|
}
|
|
7797
|
-
}, [changeControls,
|
|
7798
|
-
return (jsx(Dropdown, { zIndex: 1000, width: `${width ?? DEFAULT_DROPDOWN_WIDTH}px`, label: label, options: items, value: controls?.[
|
|
7797
|
+
}, [changeControls, attributeName]);
|
|
7798
|
+
return (jsx(Dropdown, { zIndex: 1000, width: `${width ?? DEFAULT_DROPDOWN_WIDTH}px`, label: label, options: items, value: controls?.[attributeName] ?? value, placeholder: placeholder, onChange: handleChange }));
|
|
7799
7799
|
};
|
|
7800
7800
|
|
|
7801
7801
|
const StyledIconFontSizeMixin = css `
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.1.
|
|
2
|
+
"version": "3.1.85",
|
|
3
3
|
"name": "@evergis/react",
|
|
4
4
|
"author": "Everpoint",
|
|
5
5
|
"license": "MIT",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"swiper": "^8.3.2",
|
|
84
84
|
"wkt": "^0.1.1"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "fa8e49621199da7b5d1ff9818e048cc675a9fbae"
|
|
87
87
|
}
|