template "widget[@type='ForEach']", mode="widget_defs" {
const "widgets", "func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]";
| dispatch: function(value) {
foreach "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]" {
| id("«@id»").addEventListener(
| evt => {let new_val = "«func:escape_quotes(@inkscape:label)»");
| // do something with new_val
const "labels_regex","concat('^',arg[1]/@value,':[0-9]+')";
foreach "$hmi_element/*[regexp:test(@inkscape:label, $labels_regex)]" {
| [ /* «@inkscape:label» */
//foreach "$hmi_elements[ancestor::svg:*/@id = $_id]" {
foreach "func:refered_elements(.)[@id = $hmi_elements/@id][not(@id = $elt/@id)]" {
| hmi_widgets["«@id»"]`if "position()!=last()" > ,`
| ]`if "position()!=last()" > ,`
template "widget[@type='ForEach']", mode="widget_subscribe"{
| subscribe.call(this,off);
| unsubscribe.call(this);