@evergis/react 3.1.88 → 3.1.89

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.
@@ -160,6 +160,7 @@ export interface ConfigDataSource {
160
160
  resourceId?: string;
161
161
  url?: string;
162
162
  type?: string;
163
+ autoSyncLayer?: boolean;
163
164
  }
164
165
  export interface EqlDataSource {
165
166
  items: FeatureDc[];
package/dist/index.js CHANGED
@@ -7780,7 +7780,7 @@ const ElementControl = ({ elementConfig }) => {
7780
7780
  const { t } = useGlobalContext();
7781
7781
  const { attributes, layerInfo, dataSources, controls, changeControls } = useWidgetContext(exports.WidgetType.FeatureCard);
7782
7782
  const [value, setValue] = React.useState();
7783
- const { options, attributeName } = elementConfig || {};
7783
+ const { options, attributeName, defaultValue } = elementConfig || {};
7784
7784
  const { relatedDataSource, label, width, control, placeholder = t("selectValue", { ns: "dashboard", defaultValue: "Выберите значение" }) } = options || {};
7785
7785
  const attribute = React.useMemo(() => attributes?.find(({ name }) => name === attributeName), [attributes, attributeName]);
7786
7786
  const dataSource = React.useMemo(() => getDataSource(relatedDataSource, dataSources), [relatedDataSource, dataSources]);
@@ -7794,9 +7794,9 @@ const ElementControl = ({ elementConfig }) => {
7794
7794
  }));
7795
7795
  }, [control?.attributeAlias, dataSource?.features, attributeName]);
7796
7796
  const isDisabled = React.useMemo(() => {
7797
- const attr = layerInfo?.configuration?.attributesConfiguration?.attributes?.find(item => item.attributeName === attributeName);
7797
+ const attr = layerInfo?.configuration?.attributesConfiguration?.attributes?.find(item => item.attributeName === control?.targetAttributeName);
7798
7798
  return !attr?.isEditable;
7799
- }, [attributeName, layerInfo?.configuration?.attributesConfiguration?.attributes]);
7799
+ }, [control?.targetAttributeName, layerInfo?.configuration?.attributesConfiguration?.attributes]);
7800
7800
  const handleChange = React.useCallback(([option]) => {
7801
7801
  setValue(option?.value);
7802
7802
  if (attributeName && changeControls) {
@@ -7805,7 +7805,7 @@ const ElementControl = ({ elementConfig }) => {
7805
7805
  });
7806
7806
  }
7807
7807
  }, [changeControls, attributeName]);
7808
- return (jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: 1000, width: `${width ?? DEFAULT_DROPDOWN_WIDTH}px`, label: label, options: items, value: controls?.[attributeName] ?? value ?? attribute?.value, placeholder: placeholder, disabled: isDisabled, onChange: handleChange }));
7808
+ return (jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: 1000, width: `${width ?? DEFAULT_DROPDOWN_WIDTH}px`, label: label, options: items, value: controls?.[attributeName] ?? value ?? attribute?.value ?? defaultValue, placeholder: placeholder, disabled: isDisabled, onChange: handleChange }));
7809
7809
  };
7810
7810
 
7811
7811
  const StyledIconFontSizeMixin = styled.css `
package/dist/react.esm.js CHANGED
@@ -7778,7 +7778,7 @@ const ElementControl = ({ elementConfig }) => {
7778
7778
  const { t } = useGlobalContext();
7779
7779
  const { attributes, layerInfo, dataSources, controls, changeControls } = useWidgetContext(WidgetType.FeatureCard);
7780
7780
  const [value, setValue] = useState();
7781
- const { options, attributeName } = elementConfig || {};
7781
+ const { options, attributeName, defaultValue } = elementConfig || {};
7782
7782
  const { relatedDataSource, label, width, control, placeholder = t("selectValue", { ns: "dashboard", defaultValue: "Выберите значение" }) } = options || {};
7783
7783
  const attribute = useMemo(() => attributes?.find(({ name }) => name === attributeName), [attributes, attributeName]);
7784
7784
  const dataSource = useMemo(() => getDataSource(relatedDataSource, dataSources), [relatedDataSource, dataSources]);
@@ -7792,9 +7792,9 @@ const ElementControl = ({ elementConfig }) => {
7792
7792
  }));
7793
7793
  }, [control?.attributeAlias, dataSource?.features, attributeName]);
7794
7794
  const isDisabled = useMemo(() => {
7795
- const attr = layerInfo?.configuration?.attributesConfiguration?.attributes?.find(item => item.attributeName === attributeName);
7795
+ const attr = layerInfo?.configuration?.attributesConfiguration?.attributes?.find(item => item.attributeName === control?.targetAttributeName);
7796
7796
  return !attr?.isEditable;
7797
- }, [attributeName, layerInfo?.configuration?.attributesConfiguration?.attributes]);
7797
+ }, [control?.targetAttributeName, layerInfo?.configuration?.attributesConfiguration?.attributes]);
7798
7798
  const handleChange = useCallback(([option]) => {
7799
7799
  setValue(option?.value);
7800
7800
  if (attributeName && changeControls) {
@@ -7803,7 +7803,7 @@ const ElementControl = ({ elementConfig }) => {
7803
7803
  });
7804
7804
  }
7805
7805
  }, [changeControls, attributeName]);
7806
- return (jsx(Dropdown, { zIndex: 1000, width: `${width ?? DEFAULT_DROPDOWN_WIDTH}px`, label: label, options: items, value: controls?.[attributeName] ?? value ?? attribute?.value, placeholder: placeholder, disabled: isDisabled, onChange: handleChange }));
7806
+ return (jsx(Dropdown, { zIndex: 1000, width: `${width ?? DEFAULT_DROPDOWN_WIDTH}px`, label: label, options: items, value: controls?.[attributeName] ?? value ?? attribute?.value ?? defaultValue, placeholder: placeholder, disabled: isDisabled, onChange: handleChange }));
7807
7807
  };
7808
7808
 
7809
7809
  const StyledIconFontSizeMixin = css `
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.1.88",
2
+ "version": "3.1.89",
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": "4616f8ddd2ddf9fa34336bb39dfaf754045ee7dd"
86
+ "gitHead": "2badfc31f3825666f28477a501eb7a76d34667e8"
87
87
  }