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