diff --git a/babel.config.js b/babel.config.js index 397abca8..3f453d44 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,5 @@ module.exports = { - presets: ["@vue/cli-plugin-babel/preset"] + presets: [ + '@vue/cli-plugin-babel/preset' + ] }; diff --git a/package-lock.json b/package-lock.json index bc4eacce..aa0f5c87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "schema-ui", + "name": "reproschema-ui", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "schema-ui", + "name": "reproschema-ui", "version": "0.1.0", "dependencies": { "@adapttive/vue-markdown": "^4.0.2", diff --git a/src/components/CanvasInput.vue b/src/components/CanvasInput.vue new file mode 100644 index 00000000..3af8749c --- /dev/null +++ b/src/components/CanvasInput.vue @@ -0,0 +1,183 @@ + + + + + \ No newline at end of file diff --git a/src/components/InputSelector/InputSelector.vue b/src/components/InputSelector/InputSelector.vue index ced222d0..b4e71338 100644 --- a/src/components/InputSelector/InputSelector.vue +++ b/src/components/InputSelector/InputSelector.vue @@ -172,6 +172,16 @@ :init="init" v-on:valueChanged="sendData"/> + +
+ +
+
({}) + } }, components: { ParticipantId, @@ -328,7 +342,7 @@ export default { TimeRange, SelectInput, StaticReadOnly, - // Static, + CanvasInput, }, data() { return { diff --git a/src/components/Inputs/CanvasInput/CanvasInput.vue b/src/components/Inputs/CanvasInput/CanvasInput.vue new file mode 100644 index 00000000..e9073d91 --- /dev/null +++ b/src/components/Inputs/CanvasInput/CanvasInput.vue @@ -0,0 +1,203 @@ + + + + + \ No newline at end of file diff --git a/src/components/Inputs/CanvasInput/index.js b/src/components/Inputs/CanvasInput/index.js new file mode 100644 index 00000000..c6d3ddd1 --- /dev/null +++ b/src/components/Inputs/CanvasInput/index.js @@ -0,0 +1,2 @@ +import CanvasInput from './CanvasInput.vue'; +export default CanvasInput; \ No newline at end of file diff --git a/src/components/StudySign/index.js b/src/components/StudySign/index.js index e69de29b..85320efd 100644 --- a/src/components/StudySign/index.js +++ b/src/components/StudySign/index.js @@ -0,0 +1,2 @@ +import StudySign from './StudySign.vue'; +export default StudySign; diff --git a/src/components/SurveyItem/SurveyItem.vue b/src/components/SurveyItem/SurveyItem.vue index c9ab2b8b..c7f53f0a 100644 --- a/src/components/SurveyItem/SurveyItem.vue +++ b/src/components/SurveyItem/SurveyItem.vue @@ -18,6 +18,7 @@ :ipAddress="clientIp" :showPassOptions="showPassOptions" :showItemPassOptions="itemAllow" + :ui="uiConfig" v-on:skip="sendSkip" v-on:dontKnow="sendDontKnow" v-on:next="sendNext" @@ -181,6 +182,19 @@ return 'N/A'; /* eslint-enable */ }, + uiConfig() { + const config = {}; + if (this.data['http://schema.repronim.org/inputType']) { + config.inputType = this.data['http://schema.repronim.org/inputType'][0]['@value']; + } + if (this.data['http://schema.repronim.org/backgroundImage']) { + config.backgroundImage = this.data['http://schema.repronim.org/backgroundImage'][0]['@value']; + } + if (this.data['http://schema.repronim.org/allow']) { + config.allow = this.data['http://schema.repronim.org/allow'].map(a => a['@id']); + } + return config; + }, widgetType() { if (this.data['http://schema.org/readonlyValue']) { return this.data['http://schema.org/readonlyValue'][0]['@value'];