@wg-npm/survey-creator 0.3.22615 → 0.3.22650

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.
@@ -1,6 +1,6 @@
1
1
  import Vue from 'vue';
2
2
  import _ from 'lodash';
3
- import { Dropdown, DropdownMenu, DropdownItem, Button, Row, Col, Icon, Tooltip, Badge, Modal, Radio, RadioGroup, Checkbox, CheckboxGroup, Input, Divider, Card, Form, FormItem, ButtonGroup, Select, Option, InputNumber, Table, OptionGroup, Message, Drawer, Tabs, TabPane, Scroll } from 'view-design';
3
+ import { Dropdown, DropdownMenu, DropdownItem, Button, Row, Col, Icon, Tooltip, Badge, Modal, Radio, RadioGroup, Input, Checkbox, CheckboxGroup, Divider, Card, Form, FormItem, ButtonGroup, InputNumber, Select, Option, Table, OptionGroup, Message, Drawer, Tabs, TabPane, Scroll } from 'view-design';
4
4
  import deepmerge from 'deepmerge';
5
5
  import draggable from 'vuedraggable';
6
6
 
@@ -1251,7 +1251,7 @@ var __vue_staticRenderFns__$D = [];
1251
1251
 
1252
1252
  var script$C = Vue.extend({
1253
1253
  name: "single-selection",
1254
- components: { Row, Col, Radio, RadioGroup, Icon },
1254
+ components: { Row, Col, Radio, RadioGroup, Icon, Input },
1255
1255
  mixins: [LocaleMixin],
1256
1256
  inject: ["$rootComponent"],
1257
1257
  props: {
@@ -1311,22 +1311,26 @@ var script$C = Vue.extend({
1311
1311
  const __vue_script__$C = script$C;
1312
1312
 
1313
1313
  /* template */
1314
- var __vue_render__$C = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('RadioGroup',{attrs:{"vertical":_vm.vertical}},[_c('Row',{attrs:{"type":"flex","justify":"start","gutter":50}},_vm._l((_vm.question.choices),function(choice){return _c('Col',{key:choice.id,class:_vm.choiceClasses},[_c('Radio',{attrs:{"label":choice.id,"disabled":_vm.question.options.readonly},nativeOn:{"click":function($event){return _vm.toggleAnswer(choice.id)}}},[(_vm.haveStar(choice))?_c('span',[_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1):_vm._e(),_vm._v(" "),_c('span',{staticClass:"choice-title"},[_vm._v(_vm._s(_vm._f("translate")(choice.text,true)))]),_vm._v(" "),(_vm.haveMaxScore)?_c('span',{staticClass:"choice-score"},[_vm._v(_vm._s(("(" + (choice.options.score || 0) + " " + (_vm.t(
1314
+ var __vue_render__$C = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('RadioGroup',{attrs:{"vertical":_vm.vertical}},[_c('Row',{attrs:{"type":"flex","justify":"start","gutter":50}},_vm._l((_vm.question.choices),function(choice){return _c('Col',{key:choice.id,class:_vm.choiceClasses},[_c('Radio',{attrs:{"label":choice.id,"disabled":_vm.question.options.readonly},nativeOn:{"click":function($event){return _vm.toggleAnswer(choice.id)}}},[(_vm.haveStar(choice))?_c('span',[_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1):_vm._e(),_vm._v(" "),_c('span',{staticClass:"choice-title"},[_vm._v(_vm._s(_vm._f("translate")(choice.text,true)))]),_vm._v(" "),(_vm.haveMaxScore)?_c('span',{staticClass:"choice-score mr-small"},[_vm._v(_vm._s(("(" + (choice.options.score || 0) + " " + (_vm.t(
1315
1315
  "survey_creator.question.scores",
1316
1316
  _vm.$rootComponent.currentLanguage
1317
- )) + ")")))]):_vm._e(),_vm._v(" "),_c('span',{staticClass:"jump-desc"},[_vm._v(_vm._s(_vm.getJumpDesc(choice.id)))])])],1)}),1)],1)};
1317
+ )) + ")")))]):_vm._e(),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(
1318
+ choice.options.inputEnabled && _vm.question.options.inputtedEnabled
1319
+ ),expression:"\n choice.options.inputEnabled && question.options.inputtedEnabled\n "}],staticClass:"mr-small"},[_c('Input')],1),_vm._v(" "),_c('span',{staticClass:"jump-desc"},[_vm._v(_vm._s(_vm.getJumpDesc(choice.id)))])])],1)}),1)],1)};
1318
1320
  var __vue_staticRenderFns__$C = [];
1319
1321
 
1320
1322
  /* style */
1321
- const __vue_inject_styles__$C = undefined;
1323
+ const __vue_inject_styles__$C = function (inject) {
1324
+ if (!inject) return
1325
+ inject("data-v-2244be1a_0", { source: ".ivu-row-flex-start[data-v-2244be1a]{align-items:center}.ivu-radio-group-item[data-v-2244be1a]{display:flex;flex-direction:row;align-items:center}.choice-title[data-v-2244be1a]{margin-left:8px;margin-right:8px}.mr-small[data-v-2244be1a]{margin-right:8px}", map: undefined, media: undefined });
1326
+
1327
+ };
1322
1328
  /* scoped */
1323
- const __vue_scope_id__$C = undefined;
1329
+ const __vue_scope_id__$C = "data-v-2244be1a";
1324
1330
  /* module identifier */
1325
1331
  const __vue_module_identifier__$C = undefined;
1326
1332
  /* functional template */
1327
1333
  const __vue_is_functional_template__$C = false;
1328
- /* style inject */
1329
-
1330
1334
  /* style inject SSR */
1331
1335
 
1332
1336
  /* style inject shadow dom */
@@ -1341,7 +1345,7 @@ var __vue_staticRenderFns__$C = [];
1341
1345
  __vue_is_functional_template__$C,
1342
1346
  __vue_module_identifier__$C,
1343
1347
  false,
1344
- undefined,
1348
+ createInjector,
1345
1349
  undefined,
1346
1350
  undefined
1347
1351
  );
@@ -1350,7 +1354,7 @@ var __vue_staticRenderFns__$C = [];
1350
1354
 
1351
1355
  var script$B = Vue.extend({
1352
1356
  name: "multi-selection",
1353
- components: { Row, Col, Checkbox, CheckboxGroup },
1357
+ components: { Row, Col, Checkbox, CheckboxGroup, Input },
1354
1358
  mixins: [LocaleMixin],
1355
1359
  inject: ["$rootComponent"],
1356
1360
  props: {
@@ -1362,7 +1366,7 @@ var script$B = Vue.extend({
1362
1366
  data() {
1363
1367
  return {
1364
1368
  choiceClasses: this.buildChoiceClasses(),
1365
- value: { answer: [] }
1369
+ value: { answer: [] },
1366
1370
  };
1367
1371
  },
1368
1372
  computed: {
@@ -1426,19 +1430,23 @@ const __vue_script__$B = script$B;
1426
1430
  var __vue_render__$B = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('CheckboxGroup',{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":50}},_vm._l((_vm.question.choices),function(choice){return _c('Col',{key:choice.id,class:_vm.choiceClasses},[_c('Checkbox',{attrs:{"label":choice.id,"disabled":_vm.question.options.readonly || choice.readonly}},[_c('span',{staticClass:"choice-title"},[_vm._v(_vm._s(_vm._f("translate")(choice.text,true)))]),_vm._v(" "),(_vm.haveMaxScore)?_c('span',{staticClass:"choice-score"},[_vm._v(_vm._s(("(" + (choice.options.score || 0) + " " + (_vm.t(
1427
1431
  "survey_creator.question.scores",
1428
1432
  _vm.$rootComponent.currentLanguage
1429
- )) + ")")))]):_vm._e()])],1)}),1)],1)};
1433
+ )) + ")")))]):_vm._e(),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(
1434
+ choice.options.inputEnabled && _vm.question.options.inputtedEnabled
1435
+ ),expression:"\n choice.options.inputEnabled && question.options.inputtedEnabled\n "}]},[_c('Input')],1)])],1)}),1)],1)};
1430
1436
  var __vue_staticRenderFns__$B = [];
1431
1437
 
1432
1438
  /* style */
1433
- const __vue_inject_styles__$B = undefined;
1439
+ const __vue_inject_styles__$B = function (inject) {
1440
+ if (!inject) return
1441
+ inject("data-v-15309904_0", { source: ".ivu-row-flex-start[data-v-15309904]{align-items:center}.ivu-checkbox-group-item[data-v-15309904]{display:flex;flex-direction:row;align-items:center}.choice-title[data-v-15309904]{margin-left:8px;margin-right:8px}.choice-score[data-v-15309904]{margin-right:8px}", map: undefined, media: undefined });
1442
+
1443
+ };
1434
1444
  /* scoped */
1435
- const __vue_scope_id__$B = undefined;
1445
+ const __vue_scope_id__$B = "data-v-15309904";
1436
1446
  /* module identifier */
1437
1447
  const __vue_module_identifier__$B = undefined;
1438
1448
  /* functional template */
1439
1449
  const __vue_is_functional_template__$B = false;
1440
- /* style inject */
1441
-
1442
1450
  /* style inject SSR */
1443
1451
 
1444
1452
  /* style inject shadow dom */
@@ -1453,7 +1461,7 @@ var __vue_staticRenderFns__$B = [];
1453
1461
  __vue_is_functional_template__$B,
1454
1462
  __vue_module_identifier__$B,
1455
1463
  false,
1456
- undefined,
1464
+ createInjector,
1457
1465
  undefined,
1458
1466
  undefined
1459
1467
  );
@@ -2405,6 +2413,7 @@ var script$o = Vue.extend({
2405
2413
  Icon,
2406
2414
  draggable,
2407
2415
  Modal,
2416
+ InputNumber,
2408
2417
  },
2409
2418
  mixins: [questionFormMixin],
2410
2419
  data() {
@@ -2450,6 +2459,19 @@ var script$o = Vue.extend({
2450
2459
  });
2451
2460
  }
2452
2461
  },
2462
+ inputEnabledChange() {
2463
+ if (!this.editQuestion.options.inputtedEnabled) {
2464
+ this.editQuestion.options.inputtedDefaultValue = null;
2465
+ }
2466
+ else {
2467
+ this.editQuestion.options.inputtedDefaultValue = 10;
2468
+ }
2469
+ if (!this.editQuestion.options.inputtedEnabled) {
2470
+ _.each(this.editQuestion.choices, (choice) => {
2471
+ choice.options.inputEnabled = false;
2472
+ });
2473
+ }
2474
+ },
2453
2475
  starChange(id) {
2454
2476
  _.each(this.editQuestion.choices, (choice) => {
2455
2477
  if (choice.id == id) {
@@ -2479,13 +2501,13 @@ var script$o = Vue.extend({
2479
2501
  const __vue_script__$o = script$o;
2480
2502
 
2481
2503
  /* template */
2482
- var __vue_render__$o = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Form',{ref:"questionForm",attrs:{"model":_vm.editQuestion,"label-colon":false}},[_c('Row',{staticClass:"question-options"},[_c('Checkbox',{model:{value:(_vm.editQuestion.options.required),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "required", $$v);},expression:"editQuestion.options.required"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.questionRequired"))+"\n ")]),_vm._v(" "),_c('Checkbox',{on:{"on-change":_vm.scoringEnabledChange},model:{value:(_vm.editQuestion.options.scoringEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "scoringEnabled", $$v);},expression:"editQuestion.options.scoringEnabled"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.scoringEnabled"))+"\n ")]),_vm._v(" "),_c('Checkbox',{on:{"on-change":_vm.starEnabledChange},model:{value:(_vm.editQuestion.options.starEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "starEnabled", $$v);},expression:"editQuestion.options.starEnabled"}},[_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starEnabled"))+"\n "),_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1)])],1),_vm._v(" "),_c('Row',[_c('Form-item',{attrs:{"label-width":80,"label":_vm.t('survey_creator.page.question'),"prop":'header.text.' + _vm.primaryLanguage,"rules":{
2504
+ var __vue_render__$o = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Form',{ref:"questionForm",attrs:{"model":_vm.editQuestion,"label-colon":false}},[_c('div',{staticClass:"options-container"},[_c('div',{staticClass:"options-row"},[_c('div',{staticClass:"options"},[_c('Checkbox',{model:{value:(_vm.editQuestion.options.required),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "required", $$v);},expression:"editQuestion.options.required"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.questionRequired"))+"\n ")]),_vm._v(" "),_c('Checkbox',{staticClass:"option",on:{"on-change":_vm.scoringEnabledChange},model:{value:(_vm.editQuestion.options.scoringEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "scoringEnabled", $$v);},expression:"editQuestion.options.scoringEnabled"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.scoringEnabled"))+"\n ")])],1)]),_vm._v(" "),_c('div',{staticClass:"options-row before-border"},[_c('div',{staticClass:"options"},[_c('Checkbox',{on:{"on-change":_vm.starEnabledChange},model:{value:(_vm.editQuestion.options.starEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "starEnabled", $$v);},expression:"editQuestion.options.starEnabled"}},[_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starEnabled"))+"\n "),_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1)]),_vm._v(" "),_c('Checkbox',{staticClass:"option",on:{"on-change":_vm.inputEnabledChange},model:{value:(_vm.editQuestion.options.inputtedEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "inputtedEnabled", $$v);},expression:"editQuestion.options.inputtedEnabled"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.inputted_enabled"))+"\n ")]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"option-expand"},[_c('span',[_vm._v(_vm._s(_vm.t("survey_creator.question.inputted_enabled_prefix")))]),_vm._v(" "),_c('InputNumber',{staticClass:"inputing",attrs:{"max":999,"min":0},model:{value:(_vm.editQuestion.options.inputtedDefaultValue),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "inputtedDefaultValue", $$v);},expression:"editQuestion.options.inputtedDefaultValue"}}),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.t("survey_creator.question.inputted_enabled_suffix")))])],1)],1)])]),_vm._v(" "),_c('Row',[_c('Form-item',{attrs:{"label-width":80,"label":_vm.t('survey_creator.page.question'),"prop":'header.text.' + _vm.primaryLanguage,"rules":{
2483
2505
  required: true,
2484
2506
  message: _vm.t('survey_creator.question.titleRequiredTip'),
2485
- }}},[_c('Row',[_c('Col',{attrs:{"span":"23"}},[_c('Input',{attrs:{"maxlength":500,"placeholder":_vm.t('survey_creator.question.titleRequiredTip')},model:{value:(_vm.editQuestion.header.text[_vm.primaryLanguage]),callback:function ($$v) {_vm.$set(_vm.editQuestion.header.text, _vm.primaryLanguage, $$v);},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1)],1)],1),_vm._v(" "),_c('draggable',{staticClass:"question-choices-wrapper",attrs:{"draggable":".question-choice"},on:{"start":function($event){_vm.drag = true;},"end":function($event){_vm.drag = false;}},model:{value:(_vm.editQuestion.choices),callback:function ($$v) {_vm.$set(_vm.editQuestion, "choices", $$v);},expression:"editQuestion.choices"}},_vm._l((_vm.editQuestion.choices),function(option,index){return _c('div',{key:index,staticClass:"question-choice"},[_c('FormItem',{attrs:{"label-width":80,"label":_vm.t('survey_creator.question.optional'),"prop":'choices.' + index + '.text.' + _vm.primaryLanguage,"rules":{
2507
+ }}},[_c('Row',[_c('Col',{attrs:{"span":"23"}},[_c('Input',{attrs:{"maxlength":500,"placeholder":_vm.t('survey_creator.question.titleRequiredTip')},model:{value:(_vm.editQuestion.header.text[_vm.primaryLanguage]),callback:function ($$v) {_vm.$set(_vm.editQuestion.header.text, _vm.primaryLanguage, $$v);},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1)],1)],1),_vm._v(" "),_c('div',{staticClass:"option-header"},[_c('div',{staticClass:"choice"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.option_header_choice"))+"\n ")]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.scoringEnabled),expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.option_header_scoring"))+"\n ")]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.option_header_inputing"))+"\n ")]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.starEnabled),expression:"editQuestion.options.starEnabled"}],staticClass:"inputing"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starEnabled"))+"\n ")])]),_vm._v(" "),_c('draggable',{staticClass:"question-choices-wrapper",attrs:{"draggable":".question-choice"},on:{"start":function($event){_vm.drag = true;},"end":function($event){_vm.drag = false;}},model:{value:(_vm.editQuestion.choices),callback:function ($$v) {_vm.$set(_vm.editQuestion, "choices", $$v);},expression:"editQuestion.choices"}},_vm._l((_vm.editQuestion.choices),function(option,index){return _c('div',{key:index},[_c('FormItem',{attrs:{"label-width":80,"label":_vm.t('survey_creator.question.optional'),"prop":'choices.' + index + '.text.' + _vm.primaryLanguage,"rules":{
2486
2508
  required: true,
2487
2509
  message: _vm.t('survey_creator.question.optionalRequiredTip'),
2488
- }}},[_c('Row',[_c('Col',{attrs:{"span":"12"}},[_c('Input',{model:{value:(option.text[_vm.primaryLanguage]),callback:function ($$v) {_vm.$set(option.text, _vm.primaryLanguage, (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"option.text[primaryLanguage]"}})],1),_vm._v(" "),_c('Col',{attrs:{"span":"3"}},[_c('ButtonGroup',[(_vm.editQuestion.choices.length < _vm.choiceLimit.max)?_c('Button',{attrs:{"icon":"md-add"},nativeOn:{"click":function($event){return _vm.addOption()}}}):_vm._e(),_vm._v(" "),(_vm.editQuestion.choices.length > _vm.choiceLimit.min)?_c('Button',{attrs:{"icon":"md-remove"},nativeOn:{"click":function($event){return _vm.deleteOption(index, option.id)}}}):_vm._e()],1)],1),_vm._v(" "),_c('Col',{attrs:{"span":"4"}},[_c('Form-item',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.scoringEnabled),expression:"editQuestion.options.scoringEnabled"}],attrs:{"prop":'choices.' + index + '.options.score',"label-width":80,"rules":[
2510
+ }}},[_c('div',{staticClass:"question-choice"},[_c('div',{staticClass:"choice"},[_c('Input',{model:{value:(option.text[_vm.primaryLanguage]),callback:function ($$v) {_vm.$set(option.text, _vm.primaryLanguage, (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"option.text[primaryLanguage]"}}),_vm._v(" "),(_vm.editQuestion.choices.length < _vm.choiceLimit.max)?_c('Button',{staticClass:"button",attrs:{"icon":"md-add"},nativeOn:{"click":function($event){return _vm.addOption()}}}):_vm._e(),_vm._v(" "),(_vm.editQuestion.choices.length > _vm.choiceLimit.min)?_c('Button',{staticClass:"button",attrs:{"icon":"md-remove"},nativeOn:{"click":function($event){return _vm.deleteOption(index, option.id)}}}):_vm._e()],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.scoringEnabled),expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[_c('Form-item',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.scoringEnabled),expression:"editQuestion.options.scoringEnabled"}],attrs:{"prop":'choices.' + index + '.options.score',"label-width":80,"rules":[
2489
2511
  {
2490
2512
  required: _vm.editQuestion.options.scoringEnabled,
2491
2513
  message: _vm.t('survey_creator.question.scoreRequiredTip'),
@@ -2494,21 +2516,17 @@ var __vue_render__$o = function () {var _vm=this;var _h=_vm.$createElement;var _
2494
2516
  pattern:
2495
2517
  /^(([1-9][0-9][0-9]|[1-9][0-9]|[0-9])(\.\d{1,2})?|0\.\d{1,2})$/,
2496
2518
  message: _vm.t('survey_creator.question.scoreErrorTip'),
2497
- } ]}},[_c('Input',{staticStyle:{"width":"95%"},attrs:{"type":"number"},model:{value:(option.options.score),callback:function ($$v) {_vm.$set(option.options, "score", $$v);},expression:"option.options.score"}},[_c('span',{attrs:{"slot":"prepend"},slot:"prepend"},[_vm._v(_vm._s(_vm.t("survey_creator.question.score")))])])],1)],1),_vm._v(" "),_c('Col',{attrs:{"span":"4"}},[_c('Form-item',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.starEnabled),expression:"editQuestion.options.starEnabled"}],attrs:{"prop":'choices.' + index + '.options.star',"label-width":80,"rules":[
2498
- {
2499
- message: _vm.t('survey_creator.question.starLeastOneTip'),
2500
- validator: _vm.validatedStar,
2501
- } ]}},[_c('Checkbox',{on:{"on-change":function($event){return _vm.starChange(option.id)}},model:{value:(option.options.star),callback:function ($$v) {_vm.$set(option.options, "star", $$v);},expression:"option.options.star"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.optionalStarTip"))+"\n ")])],1)],1)],1)],1)],1)}),0)],1)};
2519
+ } ]}},[_c('Input',{attrs:{"type":"number"},model:{value:(option.options.score),callback:function ($$v) {_vm.$set(option.options, "score", $$v);},expression:"option.options.score"}})],1)],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[_c('Checkbox',{model:{value:(option.options.inputEnabled),callback:function ($$v) {_vm.$set(option.options, "inputEnabled", $$v);},expression:"option.options.inputEnabled"}})],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.starEnabled),expression:"editQuestion.options.starEnabled"}],staticClass:"inputing"},[_c('Checkbox',{on:{"on-change":function($event){return _vm.starChange(option.id)}},model:{value:(option.options.star),callback:function ($$v) {_vm.$set(option.options, "star", $$v);},expression:"option.options.star"}})],1)])]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(option.options.inputEnabled),expression:"option.options.inputEnabled"}],staticClass:"option-input"},[_c('Input',{attrs:{"disabled":""}})],1)],1)}),0)],1)};
2502
2520
  var __vue_staticRenderFns__$o = [];
2503
2521
 
2504
2522
  /* style */
2505
2523
  const __vue_inject_styles__$o = function (inject) {
2506
2524
  if (!inject) return
2507
- inject("data-v-12b5f3c0_0", { source: ".question-options[data-v-12b5f3c0]{padding-bottom:10px;padding-left:80px}[data-v-12b5f3c0] .ivu-form-item{width:100%}", map: undefined, media: undefined });
2525
+ inject("data-v-86fe7a7c_0", { source: ".options-container[data-v-86fe7a7c]{margin:0 8px 16px;border-bottom:1px solid #e8eaec;display:grid;grid-template-columns:50% 50%}.options-container .options-row[data-v-86fe7a7c]{display:flex;flex-direction:row;margin-bottom:16px}.options-container .options-row .options[data-v-86fe7a7c]{display:flex;flex-direction:column}.options-container .options-row .options .option[data-v-86fe7a7c]{margin-top:24px}.options-container .options-row .options .option-expand[data-v-86fe7a7c]{display:flex;align-items:center;margin-top:10px;padding:8px;border-radius:4px;background:#f7f7f7}.options-container .options-row .options .option-expand .inputing[data-v-86fe7a7c]{width:64px}.options-container .before-border[data-v-86fe7a7c]{border-left:1px solid #e8eaec;padding-left:16px}.option-header[data-v-86fe7a7c]{background:#f0f1f3;border-radius:4px;width:100%;height:32px;margin-bottom:24px;display:flex;flex-direction:row;color:#70748c;align-items:center;padding:0 8px 0 16px}.option-header .choice[data-v-86fe7a7c]{width:100%}.option-header .scoring[data-v-86fe7a7c]{width:100px;display:flex;justify-content:center}.option-header .inputing[data-v-86fe7a7c]{width:80px;min-width:42px;display:flex;justify-content:center}.question-choice[data-v-86fe7a7c]{display:flex;flex-direction:row;align-items:center;padding-right:8px}.question-choice .choice[data-v-86fe7a7c]{display:flex;flex-direction:row;width:100%;margin-right:8px}.question-choice .choice .button[data-v-86fe7a7c]{margin-left:8px}.question-choice .scoring[data-v-86fe7a7c]{width:85px}.question-choice .inputing[data-v-86fe7a7c]{margin-left:32px;margin-right:6px}[data-v-86fe7a7c] .ivu-form-item{width:100%}.option-input[data-v-86fe7a7c]{margin:-14px 16px 16px 80px}", map: undefined, media: undefined });
2508
2526
 
2509
2527
  };
2510
2528
  /* scoped */
2511
- const __vue_scope_id__$o = "data-v-12b5f3c0";
2529
+ const __vue_scope_id__$o = "data-v-86fe7a7c";
2512
2530
  /* module identifier */
2513
2531
  const __vue_module_identifier__$o = undefined;
2514
2532
  /* functional template */
@@ -2550,6 +2568,7 @@ var script$n = Vue.extend({
2550
2568
  Option,
2551
2569
  Tooltip,
2552
2570
  draggable,
2571
+ InputNumber,
2553
2572
  },
2554
2573
  mixins: [questionFormMixin],
2555
2574
  data() {
@@ -2603,6 +2622,19 @@ var script$n = Vue.extend({
2603
2622
  this.editQuestion.options.starMinCount = 1;
2604
2623
  }
2605
2624
  },
2625
+ inputEnabledChange() {
2626
+ if (!this.editQuestion.options.inputtedEnabled) {
2627
+ this.editQuestion.options.inputtedDefaultValue = null;
2628
+ }
2629
+ else {
2630
+ this.editQuestion.options.inputtedDefaultValue = 10;
2631
+ }
2632
+ if (!this.editQuestion.options.inputtedEnabled) {
2633
+ _.each(this.editQuestion.choices, (choice) => {
2634
+ choice.options.inputEnabled = false;
2635
+ });
2636
+ }
2637
+ },
2606
2638
  resetStarList() {
2607
2639
  this.selectStarList = [];
2608
2640
  _.each(this.editQuestion.choices, (choices, index) => {
@@ -2631,7 +2663,7 @@ var script$n = Vue.extend({
2631
2663
  const __vue_script__$n = script$n;
2632
2664
 
2633
2665
  /* template */
2634
- var __vue_render__$n = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Form',{ref:"questionForm",staticClass:"multi-selection-form",attrs:{"model":_vm.editQuestion,"label-colon":false}},[_c('div',{staticClass:"options-container"},[_c('div',{staticClass:"options-row"},[_c('div',{staticClass:"options"},[_c('Checkbox',{model:{value:(_vm.editQuestion.options.required),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "required", $$v);},expression:"editQuestion.options.required"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.questionRequired"))+"\n ")]),_vm._v(" "),_c('Checkbox',{staticClass:"option",on:{"on-change":_vm.scoringEnabledChange},model:{value:(_vm.editQuestion.options.scoringEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "scoringEnabled", $$v);},expression:"editQuestion.options.scoringEnabled"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.scoringEnabled"))+"\n ")])],1)]),_vm._v(" "),_c('div',{staticClass:"options-row before-border"},[_c('div',{staticClass:"options"},[_c('Checkbox',{on:{"on-change":_vm.starEnabledChange},model:{value:(_vm.editQuestion.options.starEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "starEnabled", $$v);},expression:"editQuestion.options.starEnabled"}},[_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starEnabled"))+"\n "),_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1)]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.starEnabled),expression:"editQuestion.options.starEnabled"}],staticClass:"option-expand"},[_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starMinCountPrefix"))+"\n ")]),_vm._v(" "),_c('Select',{staticStyle:{"width":"50px"},attrs:{"size":"small"},model:{value:(_vm.editQuestion.options.starMinCount),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "starMinCount", $$v);},expression:"editQuestion.options.starMinCount"}},_vm._l((_vm.selectStarList),function(item){return _c('Option',{key:item.value,attrs:{"value":item.value}},[_vm._v(_vm._s(item.label)+"\n ")])}),1),_vm._v(" "),_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starMinCountSuffix"))+"\n ")])],1),_vm._v(" "),_c('Checkbox',{staticClass:"option",model:{value:(_vm.editQuestion.options.inputtedEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "inputtedEnabled", $$v);},expression:"editQuestion.options.inputtedEnabled"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.inputted_enabled"))+"\n ")]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"option-expand"},[_c('span',[_vm._v(_vm._s(_vm.t("survey_creator.question.inputted_enabled_prefix")))]),_vm._v(" "),_c('Input',{staticClass:"inputing",attrs:{"type":"number"},model:{value:(_vm.editQuestion.options.inputtedDefaultValue),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "inputtedDefaultValue", $$v);},expression:"editQuestion.options.inputtedDefaultValue"}}),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.t("survey_creator.question.inputted_enabled_suffix")))])],1)],1)]),_vm._v(" "),(_vm.enabledExclusiveChoice)?_c('div',{staticClass:"options-row before-border"},[_c('div',{staticClass:"options"},[_c('Checkbox',{on:{"on-change":_vm.exclusiveEnabledChange},model:{value:(_vm.editQuestion.options.exclusiveEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "exclusiveEnabled", $$v);},expression:"editQuestion.options.exclusiveEnabled"}},[_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.exclusive_enabled"))+"\n "),_c('Tooltip',{attrs:{"max-width":"200","content":_vm.t('survey_creator.question.exclusive_option_tooltip'),"placement":"bottom"}},[_c('Icon',{attrs:{"custom":"i-icon icon-exclamation-mark-outline","size":"16"}})],1)],1)])],1)]):_vm._e()]),_vm._v(" "),_c('Row',[_c('Form-item',{attrs:{"label-width":60,"label":_vm.t('survey_creator.page.question'),"prop":'header.text.' + _vm.primaryLanguage,"rules":{
2666
+ var __vue_render__$n = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Form',{ref:"questionForm",staticClass:"multi-selection-form",attrs:{"model":_vm.editQuestion,"label-colon":false}},[_c('div',{staticClass:"options-container"},[_c('div',{staticClass:"options-row"},[_c('div',{staticClass:"options"},[_c('Checkbox',{model:{value:(_vm.editQuestion.options.required),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "required", $$v);},expression:"editQuestion.options.required"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.questionRequired"))+"\n ")]),_vm._v(" "),_c('Checkbox',{staticClass:"option",on:{"on-change":_vm.scoringEnabledChange},model:{value:(_vm.editQuestion.options.scoringEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "scoringEnabled", $$v);},expression:"editQuestion.options.scoringEnabled"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.scoringEnabled"))+"\n ")])],1)]),_vm._v(" "),_c('div',{staticClass:"options-row before-border"},[_c('div',{staticClass:"options"},[_c('Checkbox',{on:{"on-change":_vm.starEnabledChange},model:{value:(_vm.editQuestion.options.starEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "starEnabled", $$v);},expression:"editQuestion.options.starEnabled"}},[_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starEnabled"))+"\n "),_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1)]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.starEnabled),expression:"editQuestion.options.starEnabled"}],staticClass:"option-expand"},[_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starMinCountPrefix"))+"\n ")]),_vm._v(" "),_c('Select',{staticStyle:{"width":"50px"},attrs:{"size":"small"},model:{value:(_vm.editQuestion.options.starMinCount),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "starMinCount", $$v);},expression:"editQuestion.options.starMinCount"}},_vm._l((_vm.selectStarList),function(item){return _c('Option',{key:item.value,attrs:{"value":item.value}},[_vm._v(_vm._s(item.label)+"\n ")])}),1),_vm._v(" "),_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.starMinCountSuffix"))+"\n ")])],1),_vm._v(" "),_c('Checkbox',{staticClass:"option",on:{"on-change":_vm.inputEnabledChange},model:{value:(_vm.editQuestion.options.inputtedEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "inputtedEnabled", $$v);},expression:"editQuestion.options.inputtedEnabled"}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.inputted_enabled"))+"\n ")]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"option-expand"},[_c('span',[_vm._v(_vm._s(_vm.t("survey_creator.question.inputted_enabled_prefix")))]),_vm._v(" "),_c('InputNumber',{staticClass:"inputing",attrs:{"max":999,"min":0},model:{value:(_vm.editQuestion.options.inputtedDefaultValue),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "inputtedDefaultValue", $$v);},expression:"editQuestion.options.inputtedDefaultValue"}}),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.t("survey_creator.question.inputted_enabled_suffix")))])],1)],1)]),_vm._v(" "),(_vm.enabledExclusiveChoice)?_c('div',{staticClass:"options-row before-border"},[_c('div',{staticClass:"options"},[_c('Checkbox',{on:{"on-change":_vm.exclusiveEnabledChange},model:{value:(_vm.editQuestion.options.exclusiveEnabled),callback:function ($$v) {_vm.$set(_vm.editQuestion.options, "exclusiveEnabled", $$v);},expression:"editQuestion.options.exclusiveEnabled"}},[_c('span',[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.exclusive_enabled"))+"\n "),_c('Tooltip',{attrs:{"max-width":"200","content":_vm.t('survey_creator.question.exclusive_option_tooltip'),"placement":"bottom"}},[_c('Icon',{attrs:{"custom":"i-icon icon-exclamation-mark-outline","size":"16"}})],1)],1)])],1)]):_vm._e()]),_vm._v(" "),_c('Row',[_c('Form-item',{attrs:{"label-width":60,"label":_vm.t('survey_creator.page.question'),"prop":'header.text.' + _vm.primaryLanguage,"rules":{
2635
2667
  required: true,
2636
2668
  message: _vm.t('survey_creator.question.titleRequiredTip'),
2637
2669
  }}},[_c('Row',[_c('Col',{attrs:{"span":"24"}},[_c('Input',{attrs:{"maxlength":500,"placeholder":_vm.t('survey_creator.question.titleRequiredTip')},model:{value:(_vm.editQuestion.header.text[_vm.primaryLanguage]),callback:function ($$v) {_vm.$set(_vm.editQuestion.header.text, _vm.primaryLanguage, $$v);},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1)],1)],1),_vm._v(" "),_c('div',{staticClass:"option-header"},[_c('div',{staticClass:"choice"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.option_header_choice"))+"\n ")]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.scoringEnabled),expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.option_header_scoring"))+"\n ")]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.option_header_inputing"))+"\n ")])]),_vm._v(" "),_c('draggable',{staticClass:"question-choices-wrapper",attrs:{"draggable":".question-choice"},on:{"start":function($event){_vm.drag = true;},"end":function($event){_vm.drag = false;}},model:{value:(_vm.editQuestion.choices),callback:function ($$v) {_vm.$set(_vm.editQuestion, "choices", $$v);},expression:"editQuestion.choices"}},_vm._l((_vm.editQuestion.choices),function(option,index){return _c('div',{key:index},[(!option.options.exclusiveEnabled)?_c('div',{staticClass:"choice-row"},[_c('FormItem',{attrs:{"label-width":60,"label":_vm.t('survey_creator.question.optional'),"prop":'choices.' + index + '.text.' + _vm.primaryLanguage,"rules":{
@@ -2646,7 +2678,7 @@ var __vue_render__$n = function () {var _vm=this;var _h=_vm.$createElement;var _
2646
2678
  pattern:
2647
2679
  /^(([1-9][0-9][0-9]|[1-9][0-9]|[0-9])(\.\d{1,2})?|0\.\d{1,2})$/,
2648
2680
  message: _vm.t('survey_creator.question.scoreErrorTip'),
2649
- } ]}},[_c('Input',{attrs:{"type":"number"},model:{value:(option.options.score),callback:function ($$v) {_vm.$set(option.options, "score", $$v);},expression:"option.options.score"}})],1)],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[_c('Checkbox')],1)])])],1):_c('div',{staticClass:"choice-row exclusive-choice"},[_c('FormItem',{attrs:{"label-width":60,"label":_vm.t('survey_creator.question.optional'),"prop":'choices.' + index + '.text.' + _vm.primaryLanguage,"rules":{
2681
+ } ]}},[_c('Input',{attrs:{"type":"number"},model:{value:(option.options.score),callback:function ($$v) {_vm.$set(option.options, "score", $$v);},expression:"option.options.score"}})],1)],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[_c('Checkbox',{model:{value:(option.options.inputEnabled),callback:function ($$v) {_vm.$set(option.options, "inputEnabled", $$v);},expression:"option.options.inputEnabled"}})],1)])]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(option.options.inputEnabled),expression:"option.options.inputEnabled"}],staticClass:"option-input"},[_c('Input',{attrs:{"disabled":""}})],1)],1):_c('div',{staticClass:"choice-row exclusive-choice"},[_c('FormItem',{attrs:{"label-width":60,"label":_vm.t('survey_creator.question.optional'),"prop":'choices.' + index + '.text.' + _vm.primaryLanguage,"rules":{
2650
2682
  required: true,
2651
2683
  message: _vm.t('survey_creator.question.optionalRequiredTip'),
2652
2684
  }}},[_c('div',{staticClass:"question-choice"},[_c('div',{staticClass:"choice"},[_c('Input',{model:{value:(option.text[_vm.primaryLanguage]),callback:function ($$v) {_vm.$set(option.text, _vm.primaryLanguage, (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"option.text[primaryLanguage]"}})],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.scoringEnabled),expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[_c('Form-item',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.scoringEnabled),expression:"editQuestion.options.scoringEnabled"}],attrs:{"prop":'choices.' + index + '.options.score',"label-width":60,"rules":[
@@ -2658,17 +2690,17 @@ var __vue_render__$n = function () {var _vm=this;var _h=_vm.$createElement;var _
2658
2690
  pattern:
2659
2691
  /^(([1-9][0-9][0-9]|[1-9][0-9]|[0-9])(\.\d{1,2})?|0\.\d{1,2})$/,
2660
2692
  message: _vm.t('survey_creator.question.scoreErrorTip'),
2661
- } ]}},[_c('Input',{attrs:{"type":"number"},model:{value:(option.options.score),callback:function ($$v) {_vm.$set(option.options, "score", $$v);},expression:"option.options.score"}})],1)],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[_c('Checkbox')],1)])])],1)])}),0)],1)};
2693
+ } ]}},[_c('Input',{attrs:{"type":"number"},model:{value:(option.options.score),callback:function ($$v) {_vm.$set(option.options, "score", $$v);},expression:"option.options.score"}})],1)],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.editQuestion.options.inputtedEnabled),expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[_c('Checkbox',{model:{value:(option.options.inputEnabled),callback:function ($$v) {_vm.$set(option.options, "inputEnabled", $$v);},expression:"option.options.inputEnabled"}})],1)])]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(option.options.inputEnabled),expression:"option.options.inputEnabled"}],staticClass:"option-input"},[_c('Input',{attrs:{"disabled":""}})],1)],1)])}),0)],1)};
2662
2694
  var __vue_staticRenderFns__$n = [];
2663
2695
 
2664
2696
  /* style */
2665
2697
  const __vue_inject_styles__$n = function (inject) {
2666
2698
  if (!inject) return
2667
- inject("data-v-c5592948_0", { source: ".multi-selection-form .options-container[data-v-c5592948]{margin:0 8px 16px;border-bottom:1px solid #e8eaec;display:grid;grid-template-columns:30% 40% 30%}.multi-selection-form .options-container .options-row[data-v-c5592948]{display:flex;flex-direction:row;margin-bottom:16px}.multi-selection-form .options-container .options-row .options[data-v-c5592948]{display:flex;flex-direction:column}.multi-selection-form .options-container .options-row .options .option[data-v-c5592948]{margin-top:24px}.multi-selection-form .options-container .options-row .options .option-expand[data-v-c5592948]{display:flex;align-items:center;margin-top:10px;padding:8px;border-radius:4px;background:#f7f7f7}.multi-selection-form .options-container .options-row .options .option-expand .inputing[data-v-c5592948]{width:64px}.multi-selection-form .options-container .before-border[data-v-c5592948]{border-left:1px solid #e8eaec;padding-left:16px}.multi-selection-form .question-options[data-v-c5592948]{padding-bottom:10px;padding-left:80px}.multi-selection-form[data-v-c5592948] .ivu-form-item{width:100%}.multi-selection-form[data-v-c5592948] .ivu-form-item .ivu-form-item-content{line-height:0}.multi-selection-form .option-header[data-v-c5592948]{background:#f0f1f3;border-radius:4px;width:100%;height:32px;margin-bottom:24px;display:flex;flex-direction:row;color:#70748c;align-items:center;padding:0 8px 0 16px}.multi-selection-form .option-header .choice[data-v-c5592948]{width:100%}.multi-selection-form .option-header .scoring[data-v-c5592948]{width:100px;display:flex;justify-content:center}.multi-selection-form .option-header .inputing[data-v-c5592948]{width:56px;min-width:42px;display:flex;justify-content:center}.multi-selection-form .choice-row .question-choice[data-v-c5592948]{display:flex;flex-direction:row;align-items:center;padding-right:8px}.multi-selection-form .choice-row .question-choice .choice[data-v-c5592948]{display:flex;flex-direction:row;width:100%;margin-right:8px}.multi-selection-form .choice-row .question-choice .choice .button[data-v-c5592948]{margin-left:8px}.multi-selection-form .choice-row .question-choice .scoring[data-v-c5592948]{width:85px}.multi-selection-form .choice-row .question-choice .inputing[data-v-c5592948]{margin-left:25px}.multi-selection-form .exclusive-choice[data-v-c5592948]{border-top:1px solid #e8eaec;padding-top:16px}", map: undefined, media: undefined });
2699
+ inject("data-v-f12fce9c_0", { source: ".multi-selection-form .options-container[data-v-f12fce9c]{margin:0 8px 16px;border-bottom:1px solid #e8eaec;display:grid;grid-template-columns:30% 40% 30%}.multi-selection-form .options-container .options-row[data-v-f12fce9c]{display:flex;flex-direction:row;margin-bottom:16px}.multi-selection-form .options-container .options-row .options[data-v-f12fce9c]{display:flex;flex-direction:column}.multi-selection-form .options-container .options-row .options .option[data-v-f12fce9c]{margin-top:24px}.multi-selection-form .options-container .options-row .options .option-expand[data-v-f12fce9c]{display:flex;align-items:center;margin-top:10px;padding:8px;border-radius:4px;background:#f7f7f7}.multi-selection-form .options-container .options-row .options .option-expand .inputing[data-v-f12fce9c]{width:64px}.multi-selection-form .options-container .before-border[data-v-f12fce9c]{border-left:1px solid #e8eaec;padding-left:16px}.multi-selection-form .question-options[data-v-f12fce9c]{padding-bottom:10px;padding-left:80px}.multi-selection-form[data-v-f12fce9c] .ivu-form-item{width:100%}.multi-selection-form[data-v-f12fce9c] .ivu-form-item .ivu-form-item-content{line-height:0}.multi-selection-form .option-header[data-v-f12fce9c]{background:#f0f1f3;border-radius:4px;width:100%;height:32px;margin-bottom:24px;display:flex;flex-direction:row;color:#70748c;align-items:center;padding:0 8px 0 16px}.multi-selection-form .option-header .choice[data-v-f12fce9c]{width:100%}.multi-selection-form .option-header .scoring[data-v-f12fce9c]{width:100px;display:flex;justify-content:center}.multi-selection-form .option-header .inputing[data-v-f12fce9c]{width:56px;min-width:42px;display:flex;justify-content:center}.multi-selection-form .choice-row .question-choice[data-v-f12fce9c]{display:flex;flex-direction:row;align-items:center;padding-right:8px}.multi-selection-form .choice-row .question-choice .choice[data-v-f12fce9c]{display:flex;flex-direction:row;width:100%;margin-right:8px}.multi-selection-form .choice-row .question-choice .choice .button[data-v-f12fce9c]{margin-left:8px}.multi-selection-form .choice-row .question-choice .scoring[data-v-f12fce9c]{width:85px}.multi-selection-form .choice-row .question-choice .inputing[data-v-f12fce9c]{margin-left:25px}.multi-selection-form .exclusive-choice[data-v-f12fce9c]{border-top:1px solid #e8eaec;padding-top:16px}.multi-selection-form .option-input[data-v-f12fce9c]{margin:-14px 10px 16px 60px}", map: undefined, media: undefined });
2668
2700
 
2669
2701
  };
2670
2702
  /* scoped */
2671
- const __vue_scope_id__$n = "data-v-c5592948";
2703
+ const __vue_scope_id__$n = "data-v-f12fce9c";
2672
2704
  /* module identifier */
2673
2705
  const __vue_module_identifier__$n = undefined;
2674
2706
  /* functional template */
@@ -4452,7 +4484,9 @@ var script$5 = Vue.extend({
4452
4484
  if (Array.isArray(currentSingleQuestion.jumps) &&
4453
4485
  currentSingleQuestion.jumps.length > 0) {
4454
4486
  let target = currentSingleQuestion.jumps.find((item) => item.choiceId === selected.choiceId);
4455
- let disabledArr = currentSingleQuestion.jumps.filter((item) => item.choiceId !== selected.choiceId);
4487
+ let disabledArr = currentSingleQuestion.jumps
4488
+ .filter((item) => item.choiceId !== selected.choiceId)
4489
+ .filter((item) => target.toQuestionId !== item.toQuestionId);
4456
4490
  if (target) {
4457
4491
  if (this.recordQuestionId === selected.questionId) {
4458
4492
  let resetItem = this.sortQuestions.find((item) => item.id === target.toQuestionId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wg-npm/survey-creator",
3
- "version": "0.3.22615",
3
+ "version": "0.3.22650",
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.22615",
16
- "@wg-npm/survey-service-api": "0.3.22615",
15
+ "@wg-npm/survey-core": "0.3.22650",
16
+ "@wg-npm/survey-service-api": "0.3.22650",
17
17
  "axios": "^0.19.2",
18
18
  "camelcase": "^6.0.0",
19
19
  "deepmerge": "^4.2.2",
@@ -38,8 +38,8 @@
38
38
  "@typescript-eslint/eslint-plugin": "^3.6.0",
39
39
  "@typescript-eslint/parser": "^3.6.0",
40
40
  "@vue/eslint-config-prettier": "^6.0.0",
41
- "@wg-npm/survey-core": "0.3.22615",
42
- "@wg-npm/survey-service-api": "0.3.22615",
41
+ "@wg-npm/survey-core": "0.3.22650",
42
+ "@wg-npm/survey-service-api": "0.3.22650",
43
43
  "acorn": "^7.3.1",
44
44
  "axios": "^0.19.2",
45
45
  "babelrc-rollup": "^3.0.0",
@@ -6,7 +6,10 @@
6
6
  :key="choice.id"
7
7
  :class="choiceClasses"
8
8
  >
9
- <Checkbox :label="choice.id" :disabled="question.options.readonly || choice.readonly">
9
+ <Checkbox
10
+ :label="choice.id"
11
+ :disabled="question.options.readonly || choice.readonly"
12
+ >
10
13
  <span class="choice-title">{{ choice.text | translate(true) }}</span>
11
14
  <span v-if="haveMaxScore" class="choice-score">{{
12
15
  `(${choice.options.score || 0} ${t(
@@ -14,6 +17,13 @@
14
17
  $rootComponent.currentLanguage
15
18
  )})`
16
19
  }}</span>
20
+ <div
21
+ v-show="
22
+ choice.options.inputEnabled && question.options.inputtedEnabled
23
+ "
24
+ >
25
+ <Input />
26
+ </div>
17
27
  </Checkbox>
18
28
  </Col>
19
29
  </Row>
@@ -23,13 +33,13 @@
23
33
  <script lang="ts">
24
34
  import Vue from "vue";
25
35
  import _ from "lodash";
26
- import { Checkbox, Col, Row, CheckboxGroup } from "view-design";
36
+ import { Checkbox, Col, Row, CheckboxGroup, Input } from "view-design";
27
37
  import LocaleMixin from "../../../mixins/locale-mixin";
28
38
  import { BaseQuestionModel, SurveyLayout } from "@wg-npm/survey-core";
29
39
 
30
40
  export default Vue.extend({
31
41
  name: "multi-selection",
32
- components: { Row, Col, Checkbox, CheckboxGroup },
42
+ components: { Row, Col, Checkbox, CheckboxGroup, Input },
33
43
  mixins: [LocaleMixin],
34
44
  inject: ["$rootComponent"],
35
45
  props: {
@@ -42,7 +52,7 @@ export default Vue.extend({
42
52
  return {
43
53
  // @ts-ignore
44
54
  choiceClasses: this.buildChoiceClasses(),
45
- value: { answer: [] }
55
+ value: { answer: [] },
46
56
  };
47
57
  },
48
58
  computed: {
@@ -106,3 +116,22 @@ export default Vue.extend({
106
116
  },
107
117
  });
108
118
  </script>
119
+ <style lang="less" scoped>
120
+ .ivu-row-flex-start {
121
+ align-items: center;
122
+ }
123
+ .ivu-checkbox-group-item {
124
+ display: flex;
125
+ flex-direction: row;
126
+ align-items: center;
127
+ }
128
+
129
+ .choice-title {
130
+ margin-left: 8px;
131
+ margin-right: 8px;
132
+ }
133
+
134
+ .choice-score {
135
+ margin-right: 8px;
136
+ }
137
+ </style>
@@ -15,12 +15,20 @@
15
15
  <Icon type="md-star" color="orange" :size="16" />
16
16
  </span>
17
17
  <span class="choice-title">{{ choice.text | translate(true) }}</span>
18
- <span class="choice-score" v-if="haveMaxScore">{{
18
+ <span class="choice-score mr-small" v-if="haveMaxScore">{{
19
19
  `(${choice.options.score || 0} ${t(
20
20
  "survey_creator.question.scores",
21
21
  $rootComponent.currentLanguage
22
22
  )})`
23
23
  }}</span>
24
+ <div
25
+ class="mr-small"
26
+ v-show="
27
+ choice.options.inputEnabled && question.options.inputtedEnabled
28
+ "
29
+ >
30
+ <Input />
31
+ </div>
24
32
  <span class="jump-desc">{{ getJumpDesc(choice.id) }}</span>
25
33
  </Radio>
26
34
  </Col>
@@ -31,7 +39,7 @@
31
39
  <script lang="ts">
32
40
  import Vue from "vue";
33
41
  import _ from "lodash";
34
- import { Col, Radio, Row, RadioGroup, Icon } from "view-design";
42
+ import { Col, Radio, Row, RadioGroup, Icon, Input } from "view-design";
35
43
  import LocaleMixin from "../../../mixins/locale-mixin";
36
44
  import {
37
45
  BaseQuestionModel,
@@ -41,7 +49,7 @@ import {
41
49
 
42
50
  export default Vue.extend({
43
51
  name: "single-selection",
44
- components: { Row, Col, Radio, RadioGroup, Icon },
52
+ components: { Row, Col, Radio, RadioGroup, Icon, Input },
45
53
  mixins: [LocaleMixin],
46
54
  inject: ["$rootComponent"],
47
55
  props: {
@@ -104,3 +112,22 @@ export default Vue.extend({
104
112
  },
105
113
  });
106
114
  </script>
115
+ <style lang="less" scoped>
116
+ .ivu-row-flex-start {
117
+ align-items: center;
118
+ }
119
+ .ivu-radio-group-item {
120
+ display: flex;
121
+ flex-direction: row;
122
+ align-items: center;
123
+ }
124
+
125
+ .choice-title {
126
+ margin-left: 8px;
127
+ margin-right: 8px;
128
+ }
129
+
130
+ .mr-small {
131
+ margin-right: 8px;
132
+ }
133
+ </style>
@@ -53,6 +53,7 @@
53
53
  </div>
54
54
  <Checkbox
55
55
  class="option"
56
+ @on-change="inputEnabledChange"
56
57
  v-model="editQuestion.options.inputtedEnabled"
57
58
  >
58
59
  {{ t("survey_creator.question.inputted_enabled") }}
@@ -64,10 +65,11 @@
64
65
  <span>{{
65
66
  t("survey_creator.question.inputted_enabled_prefix")
66
67
  }}</span>
67
- <Input
68
+ <InputNumber
69
+ :max="999"
70
+ :min="0"
68
71
  class="inputing"
69
72
  v-model="editQuestion.options.inputtedDefaultValue"
70
- type="number"
71
73
  />
72
74
  <span>{{
73
75
  t("survey_creator.question.inputted_enabled_suffix")
@@ -181,11 +183,17 @@
181
183
  <Input v-model="option.options.score" type="number" />
182
184
  </Form-item>
183
185
  </div>
184
- <div class="inputing" v-show="editQuestion.options.inputtedEnabled">
185
- <Checkbox />
186
+ <div
187
+ class="inputing"
188
+ v-show="editQuestion.options.inputtedEnabled"
189
+ >
190
+ <Checkbox v-model="option.options.inputEnabled" />
186
191
  </div>
187
192
  </div>
188
193
  </FormItem>
194
+ <div class="option-input" v-show="option.options.inputEnabled">
195
+ <Input disabled />
196
+ </div>
189
197
  </div>
190
198
  <div v-else class="choice-row exclusive-choice">
191
199
  <FormItem
@@ -221,11 +229,17 @@
221
229
  <Input v-model="option.options.score" type="number" />
222
230
  </Form-item>
223
231
  </div>
224
- <div class="inputing" v-show="editQuestion.options.inputtedEnabled">
225
- <Checkbox />
232
+ <div
233
+ class="inputing"
234
+ v-show="editQuestion.options.inputtedEnabled"
235
+ >
236
+ <Checkbox v-model="option.options.inputEnabled" />
226
237
  </div>
227
238
  </div>
228
239
  </FormItem>
240
+ <div class="option-input" v-show="option.options.inputEnabled">
241
+ <Input disabled />
242
+ </div>
229
243
  </div>
230
244
  </div>
231
245
  </draggable>
@@ -247,6 +261,7 @@ import {
247
261
  Select,
248
262
  Option,
249
263
  Tooltip,
264
+ InputNumber,
250
265
  } from "view-design";
251
266
  import { SurveyLayout, QuestionFactory } from "@wg-npm/survey-core";
252
267
  import draggable from "vuedraggable";
@@ -268,6 +283,7 @@ export default Vue.extend({
268
283
  Option,
269
284
  Tooltip,
270
285
  draggable,
286
+ InputNumber,
271
287
  },
272
288
  mixins: [questionFormMixin],
273
289
  data() {
@@ -283,7 +299,11 @@ export default Vue.extend({
283
299
  },
284
300
  created() {
285
301
  this.resetStarList();
286
- this.enabledExclusiveChoice = _.get(this.$rootComponent, "surveyExtendOptions.enabledExclusiveChoice", false);
302
+ this.enabledExclusiveChoice = _.get(
303
+ this.$rootComponent,
304
+ "surveyExtendOptions.enabledExclusiveChoice",
305
+ false
306
+ );
287
307
  },
288
308
  methods: {
289
309
  handleExclusiveChoice(callback) {
@@ -321,6 +341,19 @@ export default Vue.extend({
321
341
  this.editQuestion.options.starMinCount = 1;
322
342
  }
323
343
  },
344
+ inputEnabledChange() {
345
+ if (!this.editQuestion.options.inputtedEnabled) {
346
+ this.editQuestion.options.inputtedDefaultValue = null;
347
+ } else {
348
+ this.editQuestion.options.inputtedDefaultValue = 10;
349
+ }
350
+
351
+ if (!this.editQuestion.options.inputtedEnabled) {
352
+ _.each(this.editQuestion.choices, (choice) => {
353
+ choice.options.inputEnabled = false;
354
+ });
355
+ }
356
+ },
324
357
  resetStarList() {
325
358
  this.selectStarList = [];
326
359
  _.each(this.editQuestion.choices, (choices, index) => {
@@ -332,8 +365,12 @@ export default Vue.extend({
332
365
  this.editQuestion.options.starMinCount = 1;
333
366
  },
334
367
  exclusiveEnabledChange() {
335
- const exclusiveChoice = QuestionFactory.createExclusiveChoice(this.$rootComponent.primaryLanguage);
336
- exclusiveChoice.text[this.$rootComponent.primaryLanguage] = this.t("survey_creator.question.exclusive_choice");
368
+ const exclusiveChoice = QuestionFactory.createExclusiveChoice(
369
+ this.$rootComponent.primaryLanguage
370
+ );
371
+ exclusiveChoice.text[this.$rootComponent.primaryLanguage] = this.t(
372
+ "survey_creator.question.exclusive_choice"
373
+ );
337
374
  if (this.editQuestion.options.exclusiveEnabled) {
338
375
  this.editQuestion.choices.push(exclusiveChoice);
339
376
  } else {
@@ -435,22 +472,22 @@ export default Vue.extend({
435
472
  flex-direction: row;
436
473
  align-items: center;
437
474
  padding-right: 8px;
438
-
475
+
439
476
  .choice {
440
477
  display: flex;
441
478
  flex-direction: row;
442
479
  width: 100%;
443
480
  margin-right: 8px;
444
-
481
+
445
482
  .button {
446
483
  margin-left: 8px;
447
484
  }
448
485
  }
449
-
486
+
450
487
  .scoring {
451
488
  width: 85px;
452
489
  }
453
-
490
+
454
491
  .inputing {
455
492
  margin-left: 25px;
456
493
  }
@@ -461,5 +498,9 @@ export default Vue.extend({
461
498
  border-top: 1px solid #e8eaec;
462
499
  padding-top: 16px;
463
500
  }
501
+
502
+ .option-input {
503
+ margin: -14px 10px 16px 60px;
504
+ }
464
505
  }
465
506
  </style>
@@ -1,25 +1,58 @@
1
1
  <template>
2
2
  <Form ref="questionForm" :model="editQuestion" :label-colon="false">
3
- <Row class="question-options">
4
- <Checkbox v-model="editQuestion.options.required">
5
- {{ t("survey_creator.question.questionRequired") }}
6
- </Checkbox>
7
- <Checkbox
8
- @on-change="scoringEnabledChange"
9
- v-model="editQuestion.options.scoringEnabled"
10
- >
11
- {{ t("survey_creator.question.scoringEnabled") }}
12
- </Checkbox>
13
- <Checkbox
14
- @on-change="starEnabledChange"
15
- v-model="editQuestion.options.starEnabled"
16
- >
17
- <span>
18
- {{ t("survey_creator.question.starEnabled") }}
19
- <Icon type="md-star" color="orange" :size="16" />
20
- </span>
21
- </Checkbox>
22
- </Row>
3
+ <div class="options-container">
4
+ <div class="options-row">
5
+ <div class="options">
6
+ <Checkbox v-model="editQuestion.options.required">
7
+ {{ t("survey_creator.question.questionRequired") }}
8
+ </Checkbox>
9
+ <Checkbox
10
+ class="option"
11
+ @on-change="scoringEnabledChange"
12
+ v-model="editQuestion.options.scoringEnabled"
13
+ >
14
+ {{ t("survey_creator.question.scoringEnabled") }}
15
+ </Checkbox>
16
+ </div>
17
+ </div>
18
+ <div class="options-row before-border">
19
+ <div class="options">
20
+ <Checkbox
21
+ @on-change="starEnabledChange"
22
+ v-model="editQuestion.options.starEnabled"
23
+ >
24
+ <span>
25
+ {{ t("survey_creator.question.starEnabled") }}
26
+ <Icon type="md-star" color="orange" :size="16" />
27
+ </span>
28
+ </Checkbox>
29
+ <Checkbox
30
+ class="option"
31
+ @on-change="inputEnabledChange"
32
+ v-model="editQuestion.options.inputtedEnabled"
33
+ >
34
+ {{ t("survey_creator.question.inputted_enabled") }}
35
+ </Checkbox>
36
+ <div
37
+ v-show="editQuestion.options.inputtedEnabled"
38
+ class="option-expand"
39
+ >
40
+ <span>{{
41
+ t("survey_creator.question.inputted_enabled_prefix")
42
+ }}</span>
43
+ <InputNumber
44
+ :max="999"
45
+ :min="0"
46
+ class="inputing"
47
+ v-model="editQuestion.options.inputtedDefaultValue"
48
+ />
49
+ <span>{{
50
+ t("survey_creator.question.inputted_enabled_suffix")
51
+ }}</span>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ </div>
23
56
  <Row>
24
57
  <Form-item
25
58
  :label-width="80"
@@ -41,6 +74,20 @@
41
74
  </Row>
42
75
  </Form-item>
43
76
  </Row>
77
+ <div class="option-header">
78
+ <div class="choice">
79
+ {{ t("survey_creator.question.option_header_choice") }}
80
+ </div>
81
+ <div class="scoring" v-show="editQuestion.options.scoringEnabled">
82
+ {{ t("survey_creator.question.option_header_scoring") }}
83
+ </div>
84
+ <div class="inputing" v-show="editQuestion.options.inputtedEnabled">
85
+ {{ t("survey_creator.question.option_header_inputing") }}
86
+ </div>
87
+ <div class="inputing" v-show="editQuestion.options.starEnabled">
88
+ {{ t("survey_creator.question.starEnabled") }}
89
+ </div>
90
+ </div>
44
91
  <draggable
45
92
  v-model="editQuestion.choices"
46
93
  class="question-choices-wrapper"
@@ -48,11 +95,7 @@
48
95
  @start="drag = true"
49
96
  @end="drag = false"
50
97
  >
51
- <div
52
- v-for="(option, index) in editQuestion.choices"
53
- :key="index"
54
- class="question-choice"
55
- >
98
+ <div v-for="(option, index) in editQuestion.choices" :key="index">
56
99
  <FormItem
57
100
  :label-width="80"
58
101
  :label="t('survey_creator.question.optional')"
@@ -62,25 +105,23 @@
62
105
  message: t('survey_creator.question.optionalRequiredTip'),
63
106
  }"
64
107
  >
65
- <Row>
66
- <Col span="12">
108
+ <div class="question-choice">
109
+ <div class="choice">
67
110
  <Input v-model.trim="option.text[primaryLanguage]" />
68
- </Col>
69
- <Col span="3">
70
- <ButtonGroup>
71
- <Button
72
- @click.native="addOption()"
73
- v-if="editQuestion.choices.length < choiceLimit.max"
74
- icon="md-add"
75
- ></Button>
76
- <Button
77
- @click.native="deleteOption(index, option.id)"
78
- v-if="editQuestion.choices.length > choiceLimit.min"
79
- icon="md-remove"
80
- ></Button>
81
- </ButtonGroup>
82
- </Col>
83
- <Col span="4">
111
+ <Button
112
+ class="button"
113
+ @click.native="addOption()"
114
+ v-if="editQuestion.choices.length < choiceLimit.max"
115
+ icon="md-add"
116
+ ></Button>
117
+ <Button
118
+ class="button"
119
+ @click.native="deleteOption(index, option.id)"
120
+ v-if="editQuestion.choices.length > choiceLimit.min"
121
+ icon="md-remove"
122
+ ></Button>
123
+ </div>
124
+ <div class="scoring" v-show="editQuestion.options.scoringEnabled">
84
125
  <Form-item
85
126
  :prop="'choices.' + index + '.options.score'"
86
127
  :label-width="80"
@@ -97,39 +138,23 @@
97
138
  },
98
139
  ]"
99
140
  >
100
- <Input
101
- v-model="option.options.score"
102
- type="number"
103
- style="width: 95%"
104
- >
105
- <span slot="prepend">{{
106
- t("survey_creator.question.score")
107
- }}</span>
108
- </Input>
109
- </Form-item>
110
- </Col>
111
- <Col span="4">
112
- <Form-item
113
- :prop="'choices.' + index + '.options.star'"
114
- :label-width="80"
115
- v-show="editQuestion.options.starEnabled"
116
- :rules="[
117
- {
118
- message: t('survey_creator.question.starLeastOneTip'),
119
- validator: validatedStar,
120
- },
121
- ]"
122
- >
123
- <Checkbox
124
- v-model="option.options.star"
125
- @on-change="starChange(option.id)"
126
- >
127
- {{ t("survey_creator.question.optionalStarTip") }}
128
- </Checkbox>
141
+ <Input v-model="option.options.score" type="number"> </Input>
129
142
  </Form-item>
130
- </Col>
131
- </Row>
143
+ </div>
144
+ <div class="inputing" v-show="editQuestion.options.inputtedEnabled">
145
+ <Checkbox v-model="option.options.inputEnabled" />
146
+ </div>
147
+ <div class="inputing" v-show="editQuestion.options.starEnabled">
148
+ <Checkbox
149
+ v-model="option.options.star"
150
+ @on-change="starChange(option.id)"
151
+ />
152
+ </div>
153
+ </div>
132
154
  </FormItem>
155
+ <div class="option-input" v-show="option.options.inputEnabled">
156
+ <Input disabled />
157
+ </div>
133
158
  </div>
134
159
  </draggable>
135
160
  </Form>
@@ -148,6 +173,7 @@ import {
148
173
  Input,
149
174
  Row,
150
175
  Modal,
176
+ InputNumber,
151
177
  } from "view-design";
152
178
  import { QuestionFactory, SurveyLayout } from "@wg-npm/survey-core";
153
179
  import draggable from "vuedraggable";
@@ -167,6 +193,7 @@ export default Vue.extend({
167
193
  Icon,
168
194
  draggable,
169
195
  Modal,
196
+ InputNumber,
170
197
  },
171
198
  mixins: [questionFormMixin],
172
199
  data() {
@@ -217,6 +244,18 @@ export default Vue.extend({
217
244
  });
218
245
  }
219
246
  },
247
+ inputEnabledChange() {
248
+ if (!this.editQuestion.options.inputtedEnabled) {
249
+ this.editQuestion.options.inputtedDefaultValue = null;
250
+ } else {
251
+ this.editQuestion.options.inputtedDefaultValue = 10;
252
+ }
253
+ if (!this.editQuestion.options.inputtedEnabled) {
254
+ _.each(this.editQuestion.choices, (choice) => {
255
+ choice.options.inputEnabled = false;
256
+ });
257
+ }
258
+ },
220
259
  starChange(id) {
221
260
  _.each(this.editQuestion.choices, (choice) => {
222
261
  if (choice.id == id) {
@@ -242,13 +281,108 @@ export default Vue.extend({
242
281
  },
243
282
  });
244
283
  </script>
245
- <style scoped>
246
- .question-options {
247
- padding-bottom: 10px;
248
- padding-left: 80px;
284
+ <style lang="less" scoped>
285
+ .options-container {
286
+ margin: 0 8px 16px;
287
+ border-bottom: 1px solid #e8eaec;
288
+ display: grid;
289
+ grid-template-columns: 50% 50%;
290
+
291
+ .options-row {
292
+ display: flex;
293
+ flex-direction: row;
294
+ margin-bottom: 16px;
295
+
296
+ .options {
297
+ display: flex;
298
+ flex-direction: column;
299
+
300
+ .option {
301
+ margin-top: 24px;
302
+ }
303
+
304
+ .option-expand {
305
+ display: flex;
306
+ align-items: center;
307
+ margin-top: 10px;
308
+ padding: 8px;
309
+ border-radius: 4px;
310
+ background: #f7f7f7;
311
+
312
+ .inputing {
313
+ width: 64px;
314
+ }
315
+ }
316
+ }
317
+ }
318
+
319
+ .before-border {
320
+ border-left: 1px solid #e8eaec;
321
+ padding-left: 16px;
322
+ }
249
323
  }
250
324
 
325
+ .option-header {
326
+ background: #f0f1f3;
327
+ border-radius: 4px;
328
+ width: 100%;
329
+ height: 32px;
330
+ margin-bottom: 24px;
331
+ display: flex;
332
+ flex-direction: row;
333
+ color: #70748c;
334
+ align-items: center;
335
+ padding: 0 8px 0 16px;
336
+
337
+ .choice {
338
+ width: 100%;
339
+ }
340
+
341
+ .scoring {
342
+ width: 100px;
343
+ display: flex;
344
+ justify-content: center;
345
+ }
346
+
347
+ .inputing {
348
+ width: 80px;
349
+ min-width: 42px;
350
+ display: flex;
351
+ justify-content: center;
352
+ }
353
+ }
354
+
355
+ .question-choice {
356
+ display: flex;
357
+ flex-direction: row;
358
+ align-items: center;
359
+ padding-right: 8px;
360
+
361
+ .choice {
362
+ display: flex;
363
+ flex-direction: row;
364
+ width: 100%;
365
+ margin-right: 8px;
366
+
367
+ .button {
368
+ margin-left: 8px;
369
+ }
370
+ }
371
+
372
+ .scoring {
373
+ width: 85px;
374
+ }
375
+
376
+ .inputing {
377
+ margin-left: 32px;
378
+ margin-right: 6px;
379
+ }
380
+ }
251
381
  /deep/ .ivu-form-item {
252
382
  width: 100%;
253
383
  }
384
+
385
+ .option-input {
386
+ margin: -14px 16px 16px 80px;
387
+ }
254
388
  </style>
@@ -25,7 +25,11 @@
25
25
  import Vue from "vue";
26
26
  import { Card, Col, Divider, Row } from "view-design";
27
27
  import LocaleMixin from "../../mixins/locale-mixin";
28
- import { BaseQuestionModel, QuestionType, SurveyModel } from "@wg-npm/survey-core";
28
+ import {
29
+ BaseQuestionModel,
30
+ QuestionType,
31
+ SurveyModel,
32
+ } from "@wg-npm/survey-core";
29
33
  import QuestionTitle from "../common/question-title.vue";
30
34
  import SingleSelection from "../common/question/single-selection.vue";
31
35
  import MultiSelection from "../common/question/multi-selection.vue";
@@ -50,9 +50,9 @@ export default Vue.extend({
50
50
  let target = currentSingleQuestion.jumps.find(
51
51
  (item) => item.choiceId === selected.choiceId
52
52
  );
53
- let disabledArr = currentSingleQuestion.jumps.filter(
54
- (item) => item.choiceId !== selected.choiceId
55
- );
53
+ let disabledArr = currentSingleQuestion.jumps
54
+ .filter((item) => item.choiceId !== selected.choiceId)
55
+ .filter((item) => target.toQuestionId !== item.toQuestionId);
56
56
  if (target) {
57
57
  if (this.recordQuestionId === selected.questionId) {
58
58
  let resetItem = this.sortQuestions.find(
@@ -163,6 +163,7 @@
163
163
 
164
164
  .question-choice-horizontal {
165
165
  width: fit-content;
166
+ margin-bottom: 8px;
166
167
  }
167
168
 
168
169
  .question-choice-vertical {
@@ -97,6 +97,11 @@
97
97
  font-size: @survey-creator-font-size-small;
98
98
  color: rgba(0, 0, 0, 0.45);
99
99
  }
100
+
101
+ .jump-desc {
102
+ font-size: @survey-creator-font-size;
103
+ color: #FF7800;
104
+ }
100
105
  }
101
106
 
102
107
  .question-choice-horizontal {