@wg-npm/survey-creator 1.78.511800 → 1.78.511910

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.
@@ -21518,6 +21518,7 @@ var script$I = Vue.extend({
21518
21518
  Divider,
21519
21519
  Card,
21520
21520
  Icon,
21521
+ Form,
21521
21522
  QuestionTitle: __vue_component__$4,
21522
21523
  ["SINGLE_SELECTION"]: __vue_component__$8,
21523
21524
  ["MULTI_SELECTION"]: __vue_component__$9,
@@ -21553,23 +21554,16 @@ var script$I = Vue.extend({
21553
21554
  enabledSelectQuestion: false,
21554
21555
  isSelectedQuestion: false,
21555
21556
  currentCustomQuestion: this.customQuestion,
21556
- collapsible: false,
21557
- isCheckboxDisabled: false,
21558
21557
  };
21559
21558
  },
21560
21559
  created() {
21561
21560
  this.enabledSelectQuestion = _$1.get(this.$rootComponent, "options.enabledSelectQuestion", false);
21562
21561
  this.enabledQuestionTitleIncompleteTips = _$1.get(this.$rootComponent, "options.enabledQuestionTitleIncompleteTips", false);
21563
- if (_$1.get(this.$rootComponent, "options.questionReadonly", false)) {
21564
- this.$set(this.question.options, "readonly", true);
21565
- this.collapsible = true;
21566
- }
21567
- if (_$1.get(this.$rootComponent, "options.disabledInitQuestions", false)) {
21568
- const initIds = _$1.get(this.$rootComponent, "initQuestionIds", []);
21569
- this.isCheckboxDisabled = initIds.includes(this.question.id);
21570
- }
21571
21562
  },
21572
21563
  computed: {
21564
+ isPreviewMode() {
21565
+ return _$1.get(this.$rootComponent, "options.isPreviewMode", false);
21566
+ },
21573
21567
  getClassStyle() {
21574
21568
  return this.questionTitleIncomplete ? "" : "question-incomplete";
21575
21569
  },
@@ -21606,10 +21600,10 @@ var script$I = Vue.extend({
21606
21600
  const __vue_script__$I = script$I;
21607
21601
 
21608
21602
  /* template */
21609
- var __vue_render__$H = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Card',{staticClass:"question-row",attrs:{"padding":0,"bordered":false,"dis-hover":true}},[_c('div',{class:['question-row-container',{ 'question-row--selected': _vm.isSelectedQuestion }, _vm.getClassStyle]},[(_vm.enabledSelectQuestion)?_c('div',{staticClass:"question-row-container-left"},[_c('Checkbox',{attrs:{"disabled":_vm.isCheckboxDisabled},on:{"on-change":_vm.onSelectQuestion},model:{value:(_vm.isSelectedQuestion),callback:function ($$v) {_vm.isSelectedQuestion=$$v;},expression:"isSelectedQuestion"}})],1):_vm._e(),_vm._v(" "),_c('div',{staticClass:"question-row-container-right"},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(!_vm.questionTitleIncomplete),expression:"!questionTitleIncomplete"}],staticClass:"incomplete-tips"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.incomplete_tips"))+"\n ")]),_vm._v(" "),_c('Divider',{staticClass:"question-type-desc",attrs:{"orientation":"left"}},[_vm._v("\n "+_vm._s(_vm.t(
21603
+ var __vue_render__$H = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Card',{staticClass:"question-row",attrs:{"padding":0,"bordered":false,"dis-hover":true}},[_c('div',{class:['question-row-container',{ 'question-row--selected': _vm.isSelectedQuestion }, _vm.getClassStyle]},[(_vm.enabledSelectQuestion)?_c('div',{staticClass:"question-row-container-left"},[_c('Checkbox',{on:{"on-change":_vm.onSelectQuestion},model:{value:(_vm.isSelectedQuestion),callback:function ($$v) {_vm.isSelectedQuestion=$$v;},expression:"isSelectedQuestion"}})],1):_vm._e(),_vm._v(" "),_c('div',{staticClass:"question-row-container-right"},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(!_vm.questionTitleIncomplete),expression:"!questionTitleIncomplete"}],staticClass:"incomplete-tips"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.incomplete_tips"))+"\n ")]),_vm._v(" "),_c('Divider',{staticClass:"question-type-desc",attrs:{"orientation":"left"}},[_vm._v("\n "+_vm._s(_vm.t(
21610
21604
  ("survey_creator.question.types." + (_vm.question.type)),
21611
21605
  _vm.$rootComponent.currentLanguage
21612
- ))+"\n ")]),_vm._v(" "),_c('div',{staticClass:"question-title-header"},[_c('question-title',{staticStyle:{"align-items":"flex-start","flex":"1"},attrs:{"question":_vm.question,"max-score":true,"custom-question":_vm.currentCustomQuestion}}),_vm._v(" "),(_vm.collapsible)?_c('Icon',{class:['collapse-toggle', { 'collapse-toggle--collapsed': !_vm.expanded }],attrs:{"type":"ios-arrow-up"},on:{"click":function($event){$event.stopPropagation();return _vm.toggleExpand.apply(null, arguments)}}}):_vm._e()],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.expanded),expression:"expanded"}],staticClass:"question-row-content"},[_c(_vm.question.type,{tag:"component",staticClass:"question",attrs:{"question":_vm.question,"survey":_vm.survey},on:{"singleQuestion":_vm.getJumpRules}})],1)],1)])])};
21606
+ ))+"\n ")]),_vm._v(" "),_c('div',{staticClass:"question-title-header"},[_c('question-title',{staticStyle:{"align-items":"flex-start","flex":"1"},attrs:{"question":_vm.question,"max-score":true,"custom-question":_vm.currentCustomQuestion}}),_vm._v(" "),(_vm.isPreviewMode)?_c('Icon',{class:['collapse-toggle', { 'collapse-toggle--collapsed': !_vm.expanded }],attrs:{"type":"ios-arrow-up"},on:{"click":function($event){$event.stopPropagation();return _vm.toggleExpand.apply(null, arguments)}}}):_vm._e()],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.expanded),expression:"expanded"}],staticClass:"question-row-content"},[_c('Form',{attrs:{"disabled":_vm.isPreviewMode}},[_c(_vm.question.type,{tag:"component",staticClass:"question",attrs:{"question":_vm.question,"survey":_vm.survey},on:{"singleQuestion":_vm.getJumpRules}})],1)],1)],1)])])};
21613
21607
  var __vue_staticRenderFns__$H = [];
21614
21608
 
21615
21609
  /* style */
@@ -21681,11 +21675,11 @@ var script$J = Vue.extend({
21681
21675
  questionIds() {
21682
21676
  return this.selectedQuestions.map((question) => question.id);
21683
21677
  },
21684
- showSelectionCounter() {
21678
+ enabledSelectQuestion() {
21685
21679
  return _$1.get(this.$rootComponent, "options.enabledSelectQuestion", false);
21686
21680
  },
21687
21681
  showCollapseToggle() {
21688
- return _$1.get(this.$rootComponent, "options.questionReadonly", false);
21682
+ return _$1.get(this.$rootComponent, "options.isPreviewMode", false);
21689
21683
  },
21690
21684
  allExpanded() {
21691
21685
  return this.sortQuestions.every((q) => this.expandedMap[q.id] !== false);
@@ -21696,11 +21690,6 @@ var script$J = Vue.extend({
21696
21690
  someSelected() {
21697
21691
  return this.selectedQuestions.length > 0 && this.selectedQuestions.length < this.sortQuestions.length;
21698
21692
  },
21699
- disabledQuestionIds() {
21700
- return _$1.get(this.$rootComponent, "options.disabledInitQuestions", false)
21701
- ? _$1.get(this.$rootComponent, "initQuestionIds", [])
21702
- : [];
21703
- },
21704
21693
  },
21705
21694
  methods: {
21706
21695
  surveyCustomQuestion(questionId) {
@@ -21802,10 +21791,8 @@ var script$J = Vue.extend({
21802
21791
  }
21803
21792
  else {
21804
21793
  this.sortQuestions
21805
- .filter((q) => !this.disabledQuestionIds.includes(q.id))
21806
21794
  .forEach((q) => this.$refs[`question${q.id}`][0]?.selectQuestion(false));
21807
- const kept = this.selectedQuestions.filter((q) => this.disabledQuestionIds.includes(q.id));
21808
- this.selectedQuestions.splice(0, Infinity, ...kept);
21795
+ this.selectedQuestions.splice(0, Infinity);
21809
21796
  }
21810
21797
  this.sortSelectedQuestions();
21811
21798
  this.$emit("selected-question-ids", this.questionIds);
@@ -21837,7 +21824,7 @@ var script$J = Vue.extend({
21837
21824
  const __vue_script__$J = script$J;
21838
21825
 
21839
21826
  /* template */
21840
- var __vue_render__$I = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"survey-internal-previewer-wrapper"},[(_vm.showSelectionCounter || _vm.showCollapseToggle)?_c('div',{staticClass:"question-selection-counter"},[(_vm.showCollapseToggle)?_c('img',{staticClass:"collapse-toggle-all",attrs:{"src":_vm.allExpanded ? _vm.arrowUpSvg : _vm.arrowDownSvg},on:{"click":_vm.toggleAllExpand}}):_vm._e(),_vm._v(" "),(_vm.showSelectionCounter)?_c('Checkbox',{attrs:{"value":_vm.allSelected,"indeterminate":_vm.someSelected},on:{"on-change":_vm.toggleSelectAll}}):_vm._e(),_vm._v(" "),(_vm.showSelectionCounter)?[_vm._v("\n "+_vm._s(_vm.t("survey_creator.previewer.counter_total", [_vm.sortQuestions.length]))+"\n "),_c('span',{staticClass:"question-selection-counter__num"},[_vm._v(_vm._s(_vm.selectedQuestions.length))]),_vm._v("\n "+_vm._s(_vm.t("survey_creator.previewer.counter_suffix"))+"\n ")]:_vm._e()],2):_vm._e(),_vm._v(" "),_vm._l((_vm.sortQuestions),function(question){return _c('previewer-question-row',{key:question.id,ref:("question" + (question.id)),refInFor:true,attrs:{"question":question,"survey":_vm.survey,"expanded":_vm.expandedMap[question.id],"custom-question":_vm.surveyCustomQuestion(question.id)},on:{"singleQuestion":_vm.handleSelected,"onSelectQuestion":_vm.onSelectQuestion,"toggle-expand":function($event){return _vm.onToggleExpand(question.id)}}})})],2)};
21827
+ var __vue_render__$I = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"survey-internal-previewer-wrapper"},[(_vm.enabledSelectQuestion || _vm.showCollapseToggle)?_c('div',{staticClass:"question-selection-counter"},[(_vm.showCollapseToggle)?_c('img',{staticClass:"collapse-toggle-all",attrs:{"src":_vm.allExpanded ? _vm.arrowUpSvg : _vm.arrowDownSvg},on:{"click":_vm.toggleAllExpand}}):_vm._e(),_vm._v(" "),(_vm.enabledSelectQuestion)?_c('Checkbox',{attrs:{"value":_vm.allSelected,"indeterminate":_vm.someSelected},on:{"on-change":_vm.toggleSelectAll}}):_vm._e(),_vm._v(" "),(_vm.enabledSelectQuestion)?[_vm._v("\n "+_vm._s(_vm.t("survey_creator.previewer.counter_total", [_vm.sortQuestions.length]))+"\n "),_c('span',{staticClass:"question-selection-counter__num"},[_vm._v(_vm._s(_vm.selectedQuestions.length))]),_vm._v("\n "+_vm._s(_vm.t("survey_creator.previewer.counter_suffix"))+"\n ")]:_vm._e()],2):_vm._e(),_vm._v(" "),_vm._l((_vm.sortQuestions),function(question){return _c('previewer-question-row',{key:question.id,ref:("question" + (question.id)),refInFor:true,attrs:{"question":question,"survey":_vm.survey,"expanded":_vm.expandedMap[question.id],"custom-question":_vm.surveyCustomQuestion(question.id)},on:{"singleQuestion":_vm.handleSelected,"onSelectQuestion":_vm.onSelectQuestion,"toggle-expand":function($event){return _vm.onToggleExpand(question.id)}}})})],2)};
21841
21828
  var __vue_staticRenderFns__$I = [];
21842
21829
 
21843
21830
  /* style */
@@ -22465,7 +22452,7 @@ var script$N = Vue.extend({
22465
22452
  const __vue_script__$N = script$N;
22466
22453
 
22467
22454
  /* template */
22468
- var __vue_render__$M = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showQuestionWhenPageLoad)?_c('div',[_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},on:{"on-close":_vm.questionEditDrawClose,"on-open":_vm.questionEditDrawOpen},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}})],1):_c('div',{staticClass:"survey-creator-wrapper"},[_c('Card',{attrs:{"bordered":false,"dis-hover":""}},[_c('Row',{attrs:{"align":"middle","justify":"space-between","type":"flex"}},[_c('Col',{attrs:{"span":"20"}},[_c('Icon',{staticClass:"icon-clipboard",attrs:{"custom":"i-icon icon-clipboard","size":"24"}}),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v("\n "+_vm._s(_vm._f("translate")(_vm.survey.name.text,true))+"\n ")])],1),_vm._v(" "),_c('Col',[_c('Button',{attrs:{"icon":"ios-arrow-back"},on:{"click":_vm.onBack}},[_vm._v(_vm._s(_vm.t('survey_creator.common.back')))])],1)],1)],1),_vm._v(" "),(_vm.isPreviewMode)?_c('survey-internal-previewer',{staticStyle:{"height":"calc(100vh - 130px)"},attrs:{"options":this.options,"survey":this.currentSurvey,"operation-type":_vm.operationType}}):_c('Card',{staticStyle:{"height":"calc(100vh - 130px)"},attrs:{"bordered":false,"dis-hover":""}},[_c('Tabs',{attrs:{"type":"card"},model:{value:(_vm.activeTab),callback:function ($$v) {_vm.activeTab=$$v;},expression:"activeTab"}},[_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.question_setting'),"name":"EDIT"}},[(_vm.activeTab === 'EDIT')?_c('div',[_c('Row',{staticClass:"survey-operate",attrs:{"type":"flex","justify":"space-between","align":"middle","gutter":48}},[_c('Col',[_c('create-question-dropdown',{attrs:{"options":_vm.options}})],1),_vm._v(" "),_c('Col',[_c('edit-options',{staticClass:"edit-option",attrs:{"survey":this.currentSurvey}})],1)],1),_vm._v(" "),_c('div',{staticStyle:{"width":"100%"}},[_vm._t("extra")],2),_vm._v(" "),_c('Scroll',{staticClass:"question-content",attrs:{"height":_vm.height}},[_c('survey-editor',{attrs:{"options":this.options,"survey":this.currentSurvey}})],1)],1):_vm._e()]),_vm._v(" "),_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.language'),"name":"TRANSLATE"}},[(_vm.activeTab === 'TRANSLATE')?_c('survey-translator',{attrs:{"options":this.options,"survey":this.currentSurvey}}):_vm._e()],1)],1)],1),_vm._v(" "),_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}}),_vm._v(" "),(_vm.questionJumpDrawerVisible)?_c('div',{staticStyle:{"height":"100%"}},[_c('question-jump-setting-drawer',{ref:"jumpDrawer",attrs:{"from-question":_vm.jumpFromQuestion,"to-questions":_vm.jumpToQuestions,"operation-type":_vm.operationType},model:{value:(_vm.questionJumpDrawerVisible),callback:function ($$v) {_vm.questionJumpDrawerVisible=$$v;},expression:"questionJumpDrawerVisible"}})],1):_vm._e(),_vm._v(" "),_c('div',{staticClass:"save-card"},[_c('Button',{attrs:{"loading":_vm.loading,"type":"primary","disabled":_vm.isSaved},on:{"click":_vm.onSave}},[_vm._v(_vm._s(_vm.t("survey_creator.common.save"))+"\n ")])],1)],1)])};
22455
+ var __vue_render__$M = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showQuestionWhenPageLoad)?_c('div',[_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},on:{"on-close":_vm.questionEditDrawClose,"on-open":_vm.questionEditDrawOpen},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}})],1):_c('div',{staticClass:"survey-creator-wrapper"},[_c('Card',{attrs:{"bordered":false,"dis-hover":""}},[_c('Row',{attrs:{"align":"middle","justify":"space-between","type":"flex"}},[_c('Col',{attrs:{"span":"20"}},[_c('Icon',{staticClass:"icon-clipboard",attrs:{"custom":"i-icon icon-clipboard","size":"24"}}),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v("\n "+_vm._s(_vm._f("translate")(_vm.survey.name.text,true))+"\n ")])],1),_vm._v(" "),_c('Col',[_c('Button',{attrs:{"icon":"ios-arrow-back"},on:{"click":_vm.onBack}},[_vm._v(_vm._s(_vm.t('survey_creator.common.back')))])],1)],1)],1),_vm._v(" "),(_vm.isPreviewMode)?_c('survey-internal-previewer',{staticStyle:{"height":"calc(100vh - 130px)"},attrs:{"options":this.options,"survey":this.currentSurvey,"operation-type":_vm.operationType}}):_c('Card',{staticStyle:{"height":"calc(100vh - 130px)"},attrs:{"bordered":false,"dis-hover":""}},[_c('Tabs',{attrs:{"type":"card"},model:{value:(_vm.activeTab),callback:function ($$v) {_vm.activeTab=$$v;},expression:"activeTab"}},[_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.question_setting'),"name":"EDIT"}},[(_vm.activeTab === 'EDIT')?_c('div',[_c('Row',{staticClass:"survey-operate",attrs:{"type":"flex","justify":"space-between","align":"middle","gutter":48}},[_c('Col',{staticStyle:{"display":"flex","align-items":"center"}},[_c('create-question-dropdown',{attrs:{"options":_vm.options}}),_vm._v(" "),_vm._t("add-question-extra")],2),_vm._v(" "),_c('Col',[_c('edit-options',{staticClass:"edit-option",attrs:{"survey":this.currentSurvey}})],1)],1),_vm._v(" "),_c('div',{staticStyle:{"width":"100%"}},[_vm._t("extra")],2),_vm._v(" "),_c('Scroll',{staticClass:"question-content",attrs:{"height":_vm.height}},[_c('survey-editor',{attrs:{"options":this.options,"survey":this.currentSurvey}})],1)],1):_vm._e()]),_vm._v(" "),_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.language'),"name":"TRANSLATE"}},[(_vm.activeTab === 'TRANSLATE')?_c('survey-translator',{attrs:{"options":this.options,"survey":this.currentSurvey}}):_vm._e()],1)],1)],1),_vm._v(" "),_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}}),_vm._v(" "),(_vm.questionJumpDrawerVisible)?_c('div',{staticStyle:{"height":"100%"}},[_c('question-jump-setting-drawer',{ref:"jumpDrawer",attrs:{"from-question":_vm.jumpFromQuestion,"to-questions":_vm.jumpToQuestions,"operation-type":_vm.operationType},model:{value:(_vm.questionJumpDrawerVisible),callback:function ($$v) {_vm.questionJumpDrawerVisible=$$v;},expression:"questionJumpDrawerVisible"}})],1):_vm._e(),_vm._v(" "),_c('div',{staticClass:"save-card"},[_c('Button',{attrs:{"loading":_vm.loading,"type":"primary","disabled":_vm.isSaved},on:{"click":_vm.onSave}},[_vm._v(_vm._s(_vm.t("survey_creator.common.save"))+"\n ")])],1)],1)])};
22469
22456
  var __vue_staticRenderFns__$M = [];
22470
22457
 
22471
22458
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wg-npm/survey-creator",
3
- "version": "1.78.511800",
3
+ "version": "1.78.511910",
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": "1.78.511800",
16
- "@wg-npm/survey-service-api": "1.78.511800",
15
+ "@wg-npm/survey-core": "1.78.511910",
16
+ "@wg-npm/survey-service-api": "1.78.511910",
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": "1.78.511800",
42
- "@wg-npm/survey-service-api": "1.78.511800",
41
+ "@wg-npm/survey-core": "1.78.511910",
42
+ "@wg-npm/survey-service-api": "1.78.511910",
43
43
  "acorn": "^7.3.1",
44
44
  "axios": "^0.19.2",
45
45
  "babelrc-rollup": "^3.0.0",
@@ -79,7 +79,7 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "f335e99c793cb1eaf97b5ce76f02b47071e2eb41",
82
+ "gitHead": "70ddc2d357bb86218aa42d4f0b4aa3e1780959c5",
83
83
  "rollup": {
84
84
  "external": [
85
85
  "vue",
@@ -2,7 +2,7 @@
2
2
  <Card class="question-row" :padding="0" :bordered="false" :dis-hover="true">
3
3
  <div :class="['question-row-container',{ 'question-row--selected': isSelectedQuestion }, getClassStyle]">
4
4
  <div class="question-row-container-left" v-if="enabledSelectQuestion">
5
- <Checkbox v-model="isSelectedQuestion" :disabled="isCheckboxDisabled" @on-change="onSelectQuestion" />
5
+ <Checkbox v-model="isSelectedQuestion" @on-change="onSelectQuestion" />
6
6
  </div>
7
7
  <div class="question-row-container-right">
8
8
  <span class="incomplete-tips" v-show="!questionTitleIncomplete">
@@ -23,20 +23,22 @@
23
23
  :custom-question="currentCustomQuestion"
24
24
  />
25
25
  <Icon
26
- v-if="collapsible"
26
+ v-if="isPreviewMode"
27
27
  type="ios-arrow-up"
28
28
  :class="['collapse-toggle', { 'collapse-toggle--collapsed': !expanded }]"
29
29
  @click.stop="toggleExpand"
30
30
  />
31
31
  </div>
32
32
  <div class="question-row-content" v-show="expanded">
33
- <component
34
- class="question"
35
- :is="question.type"
36
- :question="question"
37
- :survey="survey"
38
- @singleQuestion="getJumpRules"
39
- />
33
+ <Form :disabled="isPreviewMode">
34
+ <component
35
+ class="question"
36
+ :is="question.type"
37
+ :question="question"
38
+ :survey="survey"
39
+ @singleQuestion="getJumpRules"
40
+ />
41
+ </Form>
40
42
  </div>
41
43
  </div>
42
44
  </div>
@@ -45,7 +47,7 @@
45
47
 
46
48
  <script lang="ts">
47
49
  import Vue from "vue";
48
- import { Card, Col, Divider, Row, Checkbox, Icon } from "view-design";
50
+ import { Card, Col, Divider, Row, Checkbox, Icon, Form } from "view-design";
49
51
  import LocaleMixin from "../../mixins/locale-mixin";
50
52
  import {
51
53
  BaseQuestionModel,
@@ -72,6 +74,7 @@ export default Vue.extend({
72
74
  Divider,
73
75
  Card,
74
76
  Icon,
77
+ Form,
75
78
  QuestionTitle,
76
79
  [QuestionType.SINGLE_SELECTION]: SingleSelection,
77
80
  [QuestionType.MULTI_SELECTION]: MultiSelection,
@@ -107,36 +110,19 @@ export default Vue.extend({
107
110
  enabledSelectQuestion: false,
108
111
  isSelectedQuestion: false,
109
112
  currentCustomQuestion: this.customQuestion,
110
- collapsible: false,
111
- isCheckboxDisabled: false,
112
113
  };
113
114
  },
114
115
  created() {
115
116
  // @ts-ignore
116
- this.enabledSelectQuestion = _.get(
117
- this.$rootComponent,
118
- "options.enabledSelectQuestion",
119
- false
120
- );
121
- // @ts-ignore
122
- this.enabledQuestionTitleIncompleteTips = _.get(
123
- this.$rootComponent,
124
- "options.enabledQuestionTitleIncompleteTips",
125
- false
126
- );
127
- // @ts-ignore
128
- if (_.get(this.$rootComponent, "options.questionReadonly", false)) {
129
- this.$set(this.question.options, "readonly", true);
130
- this.collapsible = true;
131
- }
117
+ this.enabledSelectQuestion = _.get(this.$rootComponent, "options.enabledSelectQuestion", false);
132
118
  // @ts-ignore
133
- if (_.get(this.$rootComponent, "options.disabledInitQuestions", false)) {
134
- // @ts-ignore
135
- const initIds: string[] = _.get(this.$rootComponent, "initQuestionIds", []);
136
- this.isCheckboxDisabled = initIds.includes(this.question.id as string);
137
- }
119
+ this.enabledQuestionTitleIncompleteTips = _.get(this.$rootComponent, "options.enabledQuestionTitleIncompleteTips", false);
138
120
  },
139
121
  computed: {
122
+ isPreviewMode() {
123
+ // @ts-ignore
124
+ return _.get(this.$rootComponent, "options.isPreviewMode", false);
125
+ },
140
126
  getClassStyle() {
141
127
  return this.questionTitleIncomplete ? "" : "question-incomplete";
142
128
  },
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="survey-internal-previewer-wrapper">
3
- <div v-if="showSelectionCounter || showCollapseToggle" class="question-selection-counter">
3
+ <div v-if="enabledSelectQuestion || showCollapseToggle" class="question-selection-counter">
4
4
  <img
5
5
  v-if="showCollapseToggle"
6
6
  :src="allExpanded ? arrowUpSvg : arrowDownSvg"
@@ -8,12 +8,12 @@
8
8
  @click="toggleAllExpand"
9
9
  />
10
10
  <Checkbox
11
- v-if="showSelectionCounter"
11
+ v-if="enabledSelectQuestion"
12
12
  :value="allSelected"
13
13
  :indeterminate="someSelected"
14
14
  @on-change="toggleSelectAll"
15
15
  />
16
- <template v-if="showSelectionCounter">
16
+ <template v-if="enabledSelectQuestion">
17
17
  {{ t("survey_creator.previewer.counter_total", [sortQuestions.length]) }}
18
18
  <span class="question-selection-counter__num">{{ selectedQuestions.length }}</span>
19
19
  {{ t("survey_creator.previewer.counter_suffix") }}
@@ -83,11 +83,11 @@ export default Vue.extend({
83
83
  questionIds() {
84
84
  return this.selectedQuestions.map((question) => question.id);
85
85
  },
86
- showSelectionCounter() {
86
+ enabledSelectQuestion() {
87
87
  return _.get(this.$rootComponent, "options.enabledSelectQuestion", false);
88
88
  },
89
89
  showCollapseToggle() {
90
- return _.get(this.$rootComponent, "options.questionReadonly", false);
90
+ return _.get(this.$rootComponent, "options.isPreviewMode", false);
91
91
  },
92
92
  allExpanded() {
93
93
  return this.sortQuestions.every((q) => this.expandedMap[q.id] !== false);
@@ -98,11 +98,6 @@ export default Vue.extend({
98
98
  someSelected() {
99
99
  return this.selectedQuestions.length > 0 && this.selectedQuestions.length < this.sortQuestions.length;
100
100
  },
101
- disabledQuestionIds(): string[] {
102
- return _.get(this.$rootComponent, "options.disabledInitQuestions", false)
103
- ? _.get(this.$rootComponent, "initQuestionIds", [])
104
- : [];
105
- },
106
101
  },
107
102
  methods: {
108
103
  surveyCustomQuestion(questionId) {
@@ -230,10 +225,8 @@ export default Vue.extend({
230
225
  .forEach((q) => this.selectQuestionHandler(true, q));
231
226
  } else {
232
227
  this.sortQuestions
233
- .filter((q) => !this.disabledQuestionIds.includes(q.id))
234
228
  .forEach((q) => (this.$refs[`question${q.id}`] as any[])[0]?.selectQuestion(false));
235
- const kept = (this.selectedQuestions as any[]).filter((q) => this.disabledQuestionIds.includes(q.id));
236
- (this.selectedQuestions as any[]).splice(0, Infinity, ...kept);
229
+ (this.selectedQuestions as any[]).splice(0, Infinity);
237
230
  }
238
231
  this.sortSelectedQuestions();
239
232
  this.$emit("selected-question-ids", this.questionIds);
@@ -38,8 +38,9 @@
38
38
  <TabPane :label="t('survey_creator.common.tab.question_setting')" name="EDIT">
39
39
  <div v-if="activeTab === 'EDIT'">
40
40
  <Row type="flex" justify="space-between" class="survey-operate" align="middle" :gutter="48">
41
- <Col>
41
+ <Col style="display: flex; align-items: center;">
42
42
  <create-question-dropdown :options="options"/>
43
+ <slot name="add-question-extra"></slot>
43
44
  </Col>
44
45
  <Col>
45
46
  <edit-options class="edit-option" :survey="this.currentSurvey"></edit-options>
@@ -14,7 +14,7 @@
14
14
  .question-selection-counter {
15
15
  display: flex;
16
16
  align-items: center;
17
- padding: 0 36px 8px;
17
+ padding: 0 20px 8px;
18
18
  color: var(---T3-, #70748C);
19
19
  font-feature-settings: 'liga' off, 'clig' off;
20
20
  font-family: "PingFang SC";
@@ -44,7 +44,7 @@
44
44
  }
45
45
 
46
46
  .question-row {
47
- padding: 8px 20px;
47
+ padding: 8px 0;
48
48
 
49
49
  .question-row-container {
50
50
  display: flex;
@@ -5,8 +5,7 @@ export interface SurveyPreviewerOptions {
5
5
  back: Boolean;
6
6
  changeLanguage: Boolean;
7
7
  enabledSelectQuestion?: Boolean;
8
- questionReadonly?: Boolean;
9
- disabledInitQuestions?: Boolean;
8
+ isPreviewMode?: Boolean;
10
9
  }
11
10
 
12
11
  export declare class SurveyPreviewer extends Vue {