@@ -14,7 +14,9 @@ import {
14
14
arrayStringExposingStateControl ,
15
15
withMethodExposing ,
16
16
AutoHeightControl ,
17
+ changeValueAction ,
17
18
} from "lowcoder-sdk" ;
19
+ //import { changeValueAction } from "lowcoder-core";
18
20
import styles from "./styles.module.css" ;
19
21
import { i18nObjs , trans } from "./i18n/comps" ;
20
22
import { Geo } from "./vendors" ;
@@ -25,6 +27,7 @@ import { useResizeDetector } from "react-resize-detector";
25
27
import Notification from 'ol-ext/control/Notification'
26
28
import { featureControl } from './FeaturesControl' ;
27
29
import { geoContext } from './GEOContext' ;
30
+ import { deepMerge } from './vendors/helpers/DeepMerge' ;
28
31
29
32
export const CompStyles = [
30
33
{
@@ -547,15 +550,9 @@ GEOComp = withMethodExposing(GEOComp, [
547
550
}
548
551
}
549
552
}
550
- for ( const [ key , value ] of Object . entries ( data ) ) {
551
- var child = comp . children [ key ]
552
- console . log ( key , child )
553
- if ( child . value ) {
554
- child . value ( value )
555
- } else {
556
- console . debug ( "setConfig not supported for " , child )
557
- }
558
- }
553
+ //Load by the new values dispatching them,
554
+ //first merging the current values with the new values
555
+ comp . dispatch ( changeValueAction ( deepMerge ( comp . toJsonValue ( ) , data ) , true ) )
559
556
} catch ( e ) {
560
557
console . error ( "Failed to parse config data" , e )
561
558
return false
@@ -590,7 +587,6 @@ GEOComp = withMethodExposing(GEOComp, [
590
587
}
591
588
}
592
589
}
593
-
594
590
//Should we convert the data into string
595
591
data = params [ 1 ] !== true ? data : JSON . stringify ( data , null )
596
592
if ( geoContext . previewMode )
0 commit comments