@@ -61,8 +61,8 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
6161 </ div>
6262 <div class= "vertical-grid" style = "margin-top: 10px;" >
6363 <div>
64- <div class= "input-headline" >
65- <span> converter </ span> :
64+ <div class= "input-headline" style = "display: flex;align-items: center;" >
65+ <span> converter </ span> : <input id = "namedConverterInput" style = "width: 100%; margin-left: 15px;" value = "{{?this.convertersString::change}}" >
6666 </ div>
6767 </ div>
6868 </ div>
@@ -190,18 +190,19 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
190190 public events : string = '' ;
191191 public invert : boolean = false ;
192192 public converters : { key : string , value : any } [ ] = [ ] ;
193+ public convertersString : string ;
193194 public objectValueType : string ;
194195
195196 protected _property : IProperty ;
196- protected _binding : IBinding & { converter : Record < string , any > } ;
197+ protected _binding : IBinding & { converter : Record < string , any > | string } ;
197198 protected _bindingTarget : BindingTarget ;
198199 protected _serviceContainer : ServiceContainer ;
199200 protected _instanceServiceContainer : InstanceServiceContainer ;
200201 protected _shell : VisualizationShell
201202 protected _activeRow : number = - 1 ;
202203 protected _objNmInput : HTMLInputElement ;
203204
204- constructor ( property : IProperty , binding : IBinding & { converter : Record < string , any > } , bindingTarget : BindingTarget , serviceContainer : ServiceContainer , instanceServiceContainer : InstanceServiceContainer , shell : VisualizationShell ) {
205+ constructor ( property : IProperty , binding : IBinding & { converter : Record < string , any > } , bindingTarget : BindingTarget , serviceContainer : ServiceContainer , instanceServiceContainer : InstanceServiceContainer , shell : VisualizationShell , config = { namedConverters : true } ) {
205206 super ( ) ;
206207 super . _restoreCachedInititalValues ( ) ;
207208
@@ -213,6 +214,10 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
213214 this . _serviceContainer = serviceContainer ;
214215 this . _instanceServiceContainer = instanceServiceContainer ;
215216 this . _shell = shell ;
217+
218+ if ( ! config ?. namedConverters ) {
219+ this . _getDomElement < HTMLInputElement > ( 'namedConverterInput' ) . style . display = 'none' ;
220+ }
216221 }
217222
218223 ready ( ) {
@@ -234,8 +239,12 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
234239 if ( this . _binding . bindableObjectNames )
235240 this . objectNames = this . _binding . bindableObjectNames . join ( ';' ) ;
236241 if ( this . _binding . converter ) {
237- for ( let c in this . _binding . converter ) {
238- this . converters . push ( { key : c , value : this . _binding . converter [ c ] } ) ;
242+ if ( typeof this . _binding . converter === 'string' ) {
243+ this . convertersString = this . _binding . converter ;
244+ } else {
245+ for ( let c in this . _binding . converter ) {
246+ this . converters . push ( { key : c , value : this . _binding . converter [ c ] } ) ;
247+ }
239248 }
240249 }
241250 if ( this . _binding . changedEvents && this . _binding . changedEvents . length )
0 commit comments