namespace formgen.ioc { /** */ export class class_ioc_map extends class_ioc_wrapper, Record> implements interface_ioc> { /** */ public constructor( element_input_factory : (() => interface_ioc), { "label": label = null, "handlers": handlers = [], } : { label ?: (null | string); handlers ?: Array>>; } = { } ) { super( new class_ioc_list<{first : string; second : type_value;}>( () => new class_ioc_wrapper< Record, {first : string; second : type_value;} >( new class_ioc_group( [ { "name": "key", "ioc": new class_ioc_text( { /** * @todo parametrize */ "label": "Schlüssel", } ), "marked": true, }, { "name": "value", "ioc": element_input_factory(), "marked": true, }, ] ), (value_inner) => ({"first": value_inner["key"], "second": value_inner["value"]}), (value_outer) => ({"key": value_outer.first, "value": value_outer.second}), ), { "label": label, /** * @todo */ "handlers": [], } ), (value_inner) => Object.fromEntries( value_inner.map( entry => ([entry.first, entry.second]) ) ), (value_outer) => ( Object.entries(value_outer).map( ([key, value]) => ({"first": key, "second": (value as type_value)}) ) ) ); /* this.element_input_factory = element_input_factory; this.label = label; this.notification = new trait_notification(handlers); */ } } }