diff --git a/ESPD/examples/startComponent.js b/ESPD/examples/startComponent.js index 07bca9d..81ad800 100644 --- a/ESPD/examples/startComponent.js +++ b/ESPD/examples/startComponent.js @@ -106,15 +106,15 @@ Vue.component("startComponent", { - + - + - + diff --git a/ESPD/model/espd_common.js b/ESPD/model/espd_common.js index 21f04f6..0c7f229 100644 --- a/ESPD/model/espd_common.js +++ b/ESPD/model/espd_common.js @@ -32,16 +32,16 @@ Vue.component("PI-SA", { template: `
- + - + - + - +
` @@ -93,35 +93,35 @@ Vue.component("PI-SB", { template: `
- + - + - + - + - + - + - + - + - + - +
` @@ -154,16 +154,16 @@ Vue.component("PI-SC", { template: `
- + - + - + - +
` @@ -202,35 +202,35 @@ Vue.component("PII-SA", { template: `
- + - + - + - + - + - + - + - + - + - +
` @@ -272,44 +272,44 @@ Vue.component("PII-SB", { template: `
- + - + - + - + - + - + - + - + - + - + - + - + - +
` diff --git a/src/js/espd.js b/src/js/espd.js index c4769ae..10671d2 100644 --- a/src/js/espd.js +++ b/src/js/espd.js @@ -711,13 +711,13 @@ function json2ESPD_v4(fragment, result = { sel_count: 0, template: ''}) { case 'QUESTION_GROUP': let local_indicator = '' - result.template += ` -
` + result.template += `
` if (fragment[el].cardinality.toString().trim().endsWith('..n')) { result.data_part[`html_${stringToProperty(fragment[el].requestpath)}`] = '' result.template += `
` } + if (Object.hasOwn(fragment[el], 'components')) { for (const e in fragment[el].components) { if (Object.hasOwn(fragment[el].components, e)) { @@ -774,12 +774,12 @@ function json2ESPD_v4(fragment, result = { sel_count: 0, template: ''}) { ` } - result.template += ` -
` + result.template += '
' break; case 'QUESTION_SUBGROUP': let local_indicator_qsg = '' + result.template += `
` if (fragment[el].cardinality.toString().trim().endsWith('..n')) { result.data_part[`html_${stringToProperty(fragment[el].responsepath)}`] = '' result.template += `
@@ -790,15 +790,14 @@ function json2ESPD_v4(fragment, result = { sel_count: 0, template: ''}) { for (const e in fragment[el].components) { if (Object.hasOwn(fragment[el].components, e)) { let tmp_cmp = fragment[el].components[e] + if (tmp_cmp.type == 'QUESTION') { if (tmp_cmp.propertydatatype == 'INDICATOR') { result.exp[`${stringToProperty(tmp_cmp.responsepath)}`] = false local_indicator_qsg = `${stringToProperty(tmp_cmp.responsepath)}` - result.template += ` - - [Q] ${tmp_cmp.description} [{{ exp['${local_indicator_qsg}']?'Yes':'No' }}] - - ` + result.template += ` + [Q] ${tmp_cmp.description} [{{ exp['${local_indicator_qsg}']?'Yes':'No' }}] + ` } else { //render as usual result = json2ESPD_v4({ e: tmp_cmp }, result) @@ -807,18 +806,15 @@ function json2ESPD_v4(fragment, result = { sel_count: 0, template: ''}) { if (['QUESTION_GROUP', 'QUESTION_SUBGROUP'].indexOf(tmp_cmp.type) != -1) { if (['ONTRUE', 'ONFALSE'].indexOf(tmp_cmp.elementcode) != -1) { - result.template += ` -
- ` + result.template += `
` result = json2ESPD_v4({ e: tmp_cmp }, result) - result.template += ` -
` } if (tmp_cmp.elementcode == 'ON*') { - result.template += `
` + result.template += `
` result = json2ESPD_v4({ e: tmp_cmp }, result) - result.template += '
' } + result.template += '
' + } if (tmp_cmp.type == 'CAPTION') { @@ -838,6 +834,7 @@ function json2ESPD_v4(fragment, result = { sel_count: 0, template: ''}) { ` } + result.template += `
` break; case 'QUESTION': @@ -847,12 +844,12 @@ function json2ESPD_v4(fragment, result = { sel_count: 0, template: ''}) { if (fragment[el].cardinality.toString().trim().endsWith('..n')) { result.template += ` - ` + ` } else { result.template += ` - + ` } } else { @@ -911,7 +908,7 @@ function json2ESPD_v4(fragment, result = { sel_count: 0, template: ''}) { result.template += ` - + ` }