@wg-npm/survey-response 0.3.22657 → 0.3.22704
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/survey-response.esm.js +13 -18
- package/package.json +5 -5
- package/src/components/question/type/fill-blank.vue +3 -2
- package/src/components/question/type/multi-selection.vue +1 -6
- package/src/components/question/type/short-answer.vue +3 -2
- package/src/components/question/type/single-selection.vue +1 -6
- package/src/components/survey-response.vue +1 -0
|
@@ -300,16 +300,12 @@ var script$c = Vue.extend({
|
|
|
300
300
|
data() {
|
|
301
301
|
return {
|
|
302
302
|
value: this.answer,
|
|
303
|
-
isReadOnly: false,
|
|
304
303
|
};
|
|
305
304
|
},
|
|
306
305
|
watch: {
|
|
307
306
|
answer(n) {
|
|
308
307
|
this.value = n;
|
|
309
308
|
},
|
|
310
|
-
question(q) {
|
|
311
|
-
this.isReadOnly = !!_.find(this.question.choices, (choice) => choice.readonly);
|
|
312
|
-
},
|
|
313
309
|
},
|
|
314
310
|
methods: {
|
|
315
311
|
setCheckboxStatus() {
|
|
@@ -360,7 +356,7 @@ const __vue_script__$c = script$c;
|
|
|
360
356
|
|
|
361
357
|
/* template */
|
|
362
358
|
var __vue_render__$c = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('FormItem',{attrs:{"prop":("answers[" + _vm.index + "].answer"),"rules":{
|
|
363
|
-
required: _vm.question.options.required
|
|
359
|
+
required: _vm.question.options.required,
|
|
364
360
|
type: 'array',
|
|
365
361
|
min: 1,
|
|
366
362
|
message: _vm.t('survey_response.question.question_required'),
|
|
@@ -435,7 +431,8 @@ var script$b = Vue.extend({
|
|
|
435
431
|
},
|
|
436
432
|
},
|
|
437
433
|
methods: {
|
|
438
|
-
decodeHTML(
|
|
434
|
+
decodeHTML(value) {
|
|
435
|
+
const str = value.processedAnswer ? value.processedAnswer : value.answer;
|
|
439
436
|
if (typeof str == "string") {
|
|
440
437
|
return str.replace(/<|>|&/g, function (matches) {
|
|
441
438
|
return {
|
|
@@ -454,7 +451,7 @@ var script$b = Vue.extend({
|
|
|
454
451
|
const __vue_script__$b = script$b;
|
|
455
452
|
|
|
456
453
|
/* template */
|
|
457
|
-
var __vue_render__$b = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.readonly)?_c('div',{staticClass:"processed-answer",domProps:{"innerHTML":_vm._s(_vm.decodeHTML(_vm.value
|
|
454
|
+
var __vue_render__$b = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.readonly)?_c('div',{staticClass:"processed-answer",domProps:{"innerHTML":_vm._s(_vm.decodeHTML(_vm.value))}}):_c('FormItem',{attrs:{"prop":("answers[" + _vm.index + "].answer"),"rules":{
|
|
458
455
|
required: _vm.question.options.required,
|
|
459
456
|
message: _vm.t('survey_response.question.question_required'),
|
|
460
457
|
}}},[(_vm.question.options && _vm.question.options.wordLimit)?_c('Input',{attrs:{"type":"textarea","rows":4,"show-word-limit":"","placeholder":_vm.placeholder,"maxlength":_vm.question.options.wordLimit,"disabled":_vm.question.options.readonly},model:{value:(_vm.value.answer),callback:function ($$v) {_vm.$set(_vm.value, "answer", (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"value.answer"}}):_c('Input',{attrs:{"type":"textarea","rows":4,"placeholder":_vm.placeholder,"disabled":_vm.question.options.readonly},model:{value:(_vm.value.answer),callback:function ($$v) {_vm.$set(_vm.value, "answer", (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"value.answer"}})],1)],1)};
|
|
@@ -463,11 +460,11 @@ var __vue_staticRenderFns__$b = [];
|
|
|
463
460
|
/* style */
|
|
464
461
|
const __vue_inject_styles__$b = function (inject) {
|
|
465
462
|
if (!inject) return
|
|
466
|
-
inject("data-v-
|
|
463
|
+
inject("data-v-484436b8_0", { source: ".processed-answer[data-v-484436b8]{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc;width:100%;min-height:94px;border:1px solid #dcdee2;border-radius:4px;padding:4px 8px;line-height:1.5}", map: undefined, media: undefined });
|
|
467
464
|
|
|
468
465
|
};
|
|
469
466
|
/* scoped */
|
|
470
|
-
const __vue_scope_id__$b = "data-v-
|
|
467
|
+
const __vue_scope_id__$b = "data-v-484436b8";
|
|
471
468
|
/* module identifier */
|
|
472
469
|
const __vue_module_identifier__$b = undefined;
|
|
473
470
|
/* functional template */
|
|
@@ -520,7 +517,6 @@ var script$a = Vue.extend({
|
|
|
520
517
|
return {
|
|
521
518
|
value: this.answer,
|
|
522
519
|
choiceClasses: this.buildChoiceClasses(),
|
|
523
|
-
isReadOnly: false,
|
|
524
520
|
};
|
|
525
521
|
},
|
|
526
522
|
watch: {
|
|
@@ -530,9 +526,6 @@ var script$a = Vue.extend({
|
|
|
530
526
|
answer(n) {
|
|
531
527
|
this.value = n;
|
|
532
528
|
},
|
|
533
|
-
question(q) {
|
|
534
|
-
this.isReadOnly = !!_.find(this.question.choices, (choice) => choice.readonly);
|
|
535
|
-
},
|
|
536
529
|
},
|
|
537
530
|
methods: {
|
|
538
531
|
selChange(id) {
|
|
@@ -577,7 +570,7 @@ const __vue_script__$a = script$a;
|
|
|
577
570
|
|
|
578
571
|
/* template */
|
|
579
572
|
var __vue_render__$a = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('FormItem',{attrs:{"prop":("answers[" + _vm.index + "].answer"),"rules":{
|
|
580
|
-
required: _vm.question.options.required
|
|
573
|
+
required: _vm.question.options.required,
|
|
581
574
|
message: _vm.t('survey_response.question.question_required'),
|
|
582
575
|
}}},[_c('RadioGroup',{staticClass:"question-choice",on:{"on-change":_vm.selChange},model:{value:(_vm.value.answer),callback:function ($$v) {_vm.$set(_vm.value, "answer", $$v);},expression:"value.answer"}},[_c('Row',{attrs:{"type":"flex","justify":"start","gutter":60}},_vm._l((_vm.question.choices),function(choice){return _c('Col',{key:choice.id,class:_vm.optionLayout},[_c('Radio',{key:choice.id,attrs:{"disabled":_vm.question.options.readonly || choice.readonly,"label":choice.id},nativeOn:{"click":function($event){return _vm.toggleAnswer(choice.id, choice.readonly)}}},[(_vm.haveStar(choice))?_c('span',[_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1):_vm._e(),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.i18nText(choice.text)))])])],1)}),1)],1)],1)};
|
|
583
576
|
var __vue_staticRenderFns__$a = [];
|
|
@@ -799,7 +792,8 @@ var script$7 = Vue.extend({
|
|
|
799
792
|
},
|
|
800
793
|
},
|
|
801
794
|
methods: {
|
|
802
|
-
decodeHTML(
|
|
795
|
+
decodeHTML(value) {
|
|
796
|
+
const str = value.processedAnswer ? value.processedAnswer : value.answer;
|
|
803
797
|
if (typeof str == "string") {
|
|
804
798
|
return str.replace(/<|>|&/g, function (matches) {
|
|
805
799
|
return {
|
|
@@ -818,7 +812,7 @@ var script$7 = Vue.extend({
|
|
|
818
812
|
const __vue_script__$7 = script$7;
|
|
819
813
|
|
|
820
814
|
/* template */
|
|
821
|
-
var __vue_render__$7 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.readonly)?_c('div',{staticClass:"processed-answer",domProps:{"innerHTML":_vm._s(_vm.decodeHTML(_vm.value
|
|
815
|
+
var __vue_render__$7 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.readonly)?_c('div',{staticClass:"processed-answer",domProps:{"innerHTML":_vm._s(_vm.decodeHTML(_vm.value))}}):_c('FormItem',{attrs:{"prop":("answers[" + _vm.index + "].answer"),"rules":{
|
|
822
816
|
required: _vm.question.options.required,
|
|
823
817
|
message: _vm.t('survey_response.question.question_required'),
|
|
824
818
|
}}},[_c('Input',{attrs:{"placeholder":_vm.placeholder,"disabled":_vm.question.options.readonly},model:{value:(_vm.value.answer),callback:function ($$v) {_vm.$set(_vm.value, "answer", (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"value.answer"}})],1)],1)};
|
|
@@ -827,11 +821,11 @@ var __vue_staticRenderFns__$7 = [];
|
|
|
827
821
|
/* style */
|
|
828
822
|
const __vue_inject_styles__$7 = function (inject) {
|
|
829
823
|
if (!inject) return
|
|
830
|
-
inject("data-v-
|
|
824
|
+
inject("data-v-0a565942_0", { source: ".processed-answer[data-v-0a565942]{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc;width:100%;height:32px;border:1px solid #dcdee2;border-radius:4px;padding:4px 8px;line-height:1.5}", map: undefined, media: undefined });
|
|
831
825
|
|
|
832
826
|
};
|
|
833
827
|
/* scoped */
|
|
834
|
-
const __vue_scope_id__$7 = "data-v-
|
|
828
|
+
const __vue_scope_id__$7 = "data-v-0a565942";
|
|
835
829
|
/* module identifier */
|
|
836
830
|
const __vue_module_identifier__$7 = undefined;
|
|
837
831
|
/* functional template */
|
|
@@ -1555,6 +1549,7 @@ var script = Vue.extend({
|
|
|
1555
1549
|
item.choices.forEach((_item) => {
|
|
1556
1550
|
this.$set(_item, "readonly", disabled);
|
|
1557
1551
|
});
|
|
1552
|
+
this.$set(item.options, "required", !disabled);
|
|
1558
1553
|
}
|
|
1559
1554
|
else {
|
|
1560
1555
|
this.$set(item.options, "readonly", disabled);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wg-npm/survey-response",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.22704",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"lint-fix": "eslint \"**/*.ts\" \"**/*.vue\" --fix --no-error-on-unmatched-pattern"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@wg-npm/survey-core": "0.3.
|
|
16
|
-
"@wg-npm/survey-service-api": "0.3.
|
|
15
|
+
"@wg-npm/survey-core": "0.3.22704",
|
|
16
|
+
"@wg-npm/survey-service-api": "0.3.22704",
|
|
17
17
|
"axios": "^0.19.2",
|
|
18
18
|
"deepmerge": "^4.2.2",
|
|
19
19
|
"lodash": "^4.17.15",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@typescript-eslint/parser": "^3.6.0",
|
|
35
35
|
"@vue/eslint-config-prettier": "^6.0.0",
|
|
36
36
|
"@vue/eslint-config-typescript": "^5.0.2",
|
|
37
|
-
"@wg-npm/survey-core": "0.3.
|
|
38
|
-
"@wg-npm/survey-service-api": "0.3.
|
|
37
|
+
"@wg-npm/survey-core": "0.3.22704",
|
|
38
|
+
"@wg-npm/survey-service-api": "0.3.22704",
|
|
39
39
|
"acorn": "^7.3.1",
|
|
40
40
|
"axios": "^0.19.2",
|
|
41
41
|
"babelrc-rollup": "^3.0.0",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div
|
|
4
4
|
v-if="readonly"
|
|
5
5
|
class="processed-answer"
|
|
6
|
-
v-html="decodeHTML(value
|
|
6
|
+
v-html="decodeHTML(value)"
|
|
7
7
|
/>
|
|
8
8
|
<FormItem
|
|
9
9
|
v-else
|
|
@@ -63,7 +63,8 @@ export default Vue.extend({
|
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
methods: {
|
|
66
|
-
decodeHTML(
|
|
66
|
+
decodeHTML(value) {
|
|
67
|
+
const str = value.processedAnswer ? value.processedAnswer: value.answer;
|
|
67
68
|
if (typeof str == "string") {
|
|
68
69
|
return str.replace(/<|>|&/g, function (matches) {
|
|
69
70
|
return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<FormItem
|
|
3
3
|
:prop="`answers[${index}].answer`"
|
|
4
4
|
:rules="{
|
|
5
|
-
required: question.options.required
|
|
5
|
+
required: question.options.required,
|
|
6
6
|
type: 'array',
|
|
7
7
|
min: 1,
|
|
8
8
|
message: t('survey_response.question.question_required'),
|
|
@@ -58,17 +58,12 @@ export default Vue.extend({
|
|
|
58
58
|
data() {
|
|
59
59
|
return {
|
|
60
60
|
value: this.answer,
|
|
61
|
-
isReadOnly: false,
|
|
62
61
|
};
|
|
63
62
|
},
|
|
64
63
|
watch: {
|
|
65
64
|
answer(n) {
|
|
66
65
|
this.value = n;
|
|
67
66
|
},
|
|
68
|
-
question(q) {
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
this.isReadOnly = !!_.find(this.question.choices, (choice) => choice.readonly);
|
|
71
|
-
},
|
|
72
67
|
},
|
|
73
68
|
methods: {
|
|
74
69
|
setCheckboxStatus() {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div
|
|
4
4
|
v-if="readonly"
|
|
5
5
|
class="processed-answer"
|
|
6
|
-
v-html="decodeHTML(value
|
|
6
|
+
v-html="decodeHTML(value)"
|
|
7
7
|
/>
|
|
8
8
|
<FormItem
|
|
9
9
|
v-else
|
|
@@ -76,7 +76,8 @@ export default Vue.extend({
|
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
methods: {
|
|
79
|
-
decodeHTML(
|
|
79
|
+
decodeHTML(value) {
|
|
80
|
+
const str = value.processedAnswer ? value.processedAnswer: value.answer;
|
|
80
81
|
if (typeof str == "string") {
|
|
81
82
|
return str.replace(/<|>|&/g, function (matches) {
|
|
82
83
|
return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<FormItem
|
|
3
3
|
:prop="`answers[${index}].answer`"
|
|
4
4
|
:rules="{
|
|
5
|
-
required: question.options.required
|
|
5
|
+
required: question.options.required,
|
|
6
6
|
message: t('survey_response.question.question_required'),
|
|
7
7
|
}"
|
|
8
8
|
>
|
|
@@ -69,7 +69,6 @@ export default Vue.extend({
|
|
|
69
69
|
value: this.answer,
|
|
70
70
|
// @ts-ignore
|
|
71
71
|
choiceClasses: this.buildChoiceClasses(),
|
|
72
|
-
isReadOnly: false,
|
|
73
72
|
};
|
|
74
73
|
},
|
|
75
74
|
watch: {
|
|
@@ -78,10 +77,6 @@ export default Vue.extend({
|
|
|
78
77
|
},
|
|
79
78
|
answer(n) {
|
|
80
79
|
this.value = n;
|
|
81
|
-
},
|
|
82
|
-
question(q) {
|
|
83
|
-
// @ts-ignore
|
|
84
|
-
this.isReadOnly = !!_.find(this.question.choices, (choice) => choice.readonly);
|
|
85
80
|
},
|
|
86
81
|
},
|
|
87
82
|
methods: {
|