@evergis/react 4.0.21-alpha.0 → 4.0.22-alpha.0

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/react.esm.js CHANGED
@@ -7514,7 +7514,8 @@ const useEditControl = (type, elementConfig) => {
7514
7514
  attributes,
7515
7515
  ]);
7516
7516
  const dataSource = useMemo(() => dataSources?.find(({ name }) => name === control.relatedDataSource), [control.relatedDataSource, dataSources]);
7517
- const items = useMemo(() => dataSource?.features.map(item => item.properties[control?.attributeName] || null) || [], [dataSource?.features, control?.attributeName]);
7517
+ const items = useMemo(() => control?.variants?.map(v => String(v.text || v.value)) ||
7518
+ dataSource?.features.map(item => item.properties[control?.attributeName] || null) || [], [control?.variants, dataSource?.features, control?.attributeName]);
7518
7519
  const onChange = useCallback((newValue) => {
7519
7520
  changeControls({
7520
7521
  [control?.targetAttributeName]: newValue,
@@ -8520,11 +8521,7 @@ const ElementControl = ({ elementConfig }) => {
8520
8521
  const isDisabled = useMemo(() => {
8521
8522
  const attr = layerInfo?.configuration?.attributesConfiguration?.attributes?.find(item => item.attributeName === control?.targetAttributeName);
8522
8523
  return !attr?.isEditable;
8523
- }, [
8524
- control?.targetAttributeName,
8525
- layerInfo?.configuration
8526
- ?.attributesConfiguration?.attributes,
8527
- ]);
8524
+ }, [control?.targetAttributeName, layerInfo?.configuration]);
8528
8525
  const currentValue = controls?.[control?.targetAttributeName] ??
8529
8526
  attribute?.value ??
8530
8527
  defaultValue;