@wg-npm/survey-creator 0.3.6154 → 0.3.6643

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.
@@ -3844,7 +3844,6 @@ var script$7 = Vue.extend({
3844
3844
  methods: {
3845
3845
  closeDrawer() {
3846
3846
  this.visibleDrawer = false;
3847
- this.$emit("on-close");
3848
3847
  },
3849
3848
  saveQuestion() {
3850
3849
  const self = this;
@@ -3858,7 +3857,6 @@ var script$7 = Vue.extend({
3858
3857
  },
3859
3858
  cancel() {
3860
3859
  this.closeDrawer();
3861
- this.$emit("cancel");
3862
3860
  }
3863
3861
  }
3864
3862
  });
@@ -3867,13 +3865,13 @@ var script$7 = Vue.extend({
3867
3865
  const __vue_script__$7 = script$7;
3868
3866
 
3869
3867
  /* template */
3870
- var __vue_render__$7 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Drawer',{attrs:{"styles":_vm.styles,"width":50,"closable":true,"mask-closable":false},on:{"on-close":_vm.closeDrawer},model:{value:(_vm.visibleDrawer),callback:function ($$v) {_vm.visibleDrawer=$$v;},expression:"visibleDrawer"}},[_c('ButtonGroup',{attrs:{"slot":"header","shape":"circle"},slot:"header"},[_vm._m(0),_vm._v(" "),_c('Button',[_vm._v(_vm._s(_vm.t(("survey_creator.question.types." + _vm.questionType))))])],1),_vm._v(" "),(_vm.visibleDrawer && _vm.question)?_c(_vm.questionType,{ref:"questionComponent",tag:"component",staticClass:"question-form",attrs:{"question":_vm.question}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"drawer-footer"},[_c('Button',{attrs:{"type":"primary"},on:{"click":_vm.saveQuestion}},[(_vm.isCopy)?_c('span',[_vm._v(_vm._s(_vm.t('survey_creator.common.copy')))]):_c('span',[_vm._v(_vm._s(_vm.t('survey_creator.common.save')))])]),_vm._v(" "),_c('Button',{on:{"click":_vm.cancel}},[_vm._v(_vm._s(_vm.t('survey_creator.common.cancel')))])],1)],1)};
3868
+ var __vue_render__$7 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Drawer',{attrs:{"styles":_vm.styles,"width":50,"closable":true,"mask-closable":false},model:{value:(_vm.visibleDrawer),callback:function ($$v) {_vm.visibleDrawer=$$v;},expression:"visibleDrawer"}},[_c('ButtonGroup',{attrs:{"slot":"header","shape":"circle"},slot:"header"},[_vm._m(0),_vm._v(" "),_c('Button',[_vm._v(_vm._s(_vm.t(("survey_creator.question.types." + _vm.questionType))))])],1),_vm._v(" "),(_vm.visibleDrawer && _vm.question)?_c(_vm.questionType,{ref:"questionComponent",tag:"component",staticClass:"question-form",attrs:{"question":_vm.question}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"drawer-footer"},[_c('Button',{attrs:{"type":"primary"},on:{"click":_vm.saveQuestion}},[(_vm.isCopy)?_c('span',[_vm._v(_vm._s(_vm.t('survey_creator.common.copy')))]):_c('span',[_vm._v(_vm._s(_vm.t('survey_creator.common.save')))])]),_vm._v(" "),_c('Button',{on:{"click":_vm.cancel}},[_vm._v(_vm._s(_vm.t('survey_creator.common.cancel')))])],1)],1)};
3871
3869
  var __vue_staticRenderFns__$7 = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Button',{attrs:{"type":"primary"}},[_vm._v(_vm._s(_vm.t("survey_creator.question.type")))])}];
3872
3870
 
3873
3871
  /* style */
3874
3872
  const __vue_inject_styles__$7 = function (inject) {
3875
3873
  if (!inject) return
3876
- inject("data-v-1772ec5a_0", { source: ".drawer-footer{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff;z-index:99}.question-form{margin-bottom:53px}", map: undefined, media: undefined });
3874
+ inject("data-v-7b8bc506_0", { source: ".drawer-footer{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff;z-index:99}.question-form{margin-bottom:53px}", map: undefined, media: undefined });
3877
3875
 
3878
3876
  };
3879
3877
  /* scoped */
@@ -4371,7 +4369,7 @@ var script$1 = Vue.extend({
4371
4369
  }
4372
4370
  this.primaryLanguage = _.camelCase(this.currentSurvey.options.primaryLanguage);
4373
4371
  if (this.showQuestionWhenPageLoad) {
4374
- const question = _.findLast(this.currentSurvey?.questions, questions => { return questions.type === this.showQuestionType; });
4372
+ const question = _.find(this.currentSurvey?.questions, questions => { return questions.type === this.showQuestionType; });
4375
4373
  if (_.isUndefined(question)) {
4376
4374
  this.createQuestion(this.showQuestionType);
4377
4375
  }
@@ -4511,8 +4509,11 @@ var script$1 = Vue.extend({
4511
4509
  validateData() {
4512
4510
  return this.allTranslationIsCompleted(this.currentSurvey);
4513
4511
  },
4514
- cancel() {
4515
- this.$emit("cancel");
4512
+ questionEditDrawOpen(val) {
4513
+ this.$emit("question-edit-draw-open");
4514
+ },
4515
+ questionEditDrawClose(val) {
4516
+ this.$emit("question-edit-draw-close");
4516
4517
  }
4517
4518
  }
4518
4519
  });
@@ -4521,7 +4522,7 @@ var script$1 = Vue.extend({
4521
4522
  const __vue_script__$1 = script$1;
4522
4523
 
4523
4524
  /* template */
4524
- var __vue_render__$1 = 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:{"cancel":_vm.cancel},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}})],1):_c('div',{staticClass:"survey-creator-wrapper"},[_c('Card',{attrs:{"shadow":""}},[_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:{"min-height":"calc(100vh - 128px)"},attrs:{"options":this.options,"survey":this.currentSurvey,"operation-type":_vm.operationType}}):_c('Card',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"shadow":""}},[_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')],1),_vm._v(" "),_c('Col',[_c('edit-options',{staticClass:"edit-option",attrs:{"survey":this.currentSurvey}})],1)],1),_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(" "),_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"gutter":30,"align":"middle","justify":"center","type":"flex"}},[_c('Col',[_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)],1)],1)])};
4525
+ var __vue_render__$1 = 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:{"shadow":""}},[_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:{"min-height":"calc(100vh - 128px)"},attrs:{"options":this.options,"survey":this.currentSurvey,"operation-type":_vm.operationType}}):_c('Card',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"shadow":""}},[_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')],1),_vm._v(" "),_c('Col',[_c('edit-options',{staticClass:"edit-option",attrs:{"survey":this.currentSurvey}})],1)],1),_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(" "),_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"gutter":30,"align":"middle","justify":"center","type":"flex"}},[_c('Col',[_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)],1)],1)])};
4525
4526
  var __vue_staticRenderFns__$1 = [];
4526
4527
 
4527
4528
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wg-npm/survey-creator",
3
- "version": "0.3.6154",
3
+ "version": "0.3.6643",
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.6154",
16
- "@wg-npm/survey-service-api": "0.3.6154",
15
+ "@wg-npm/survey-core": "0.3.6643",
16
+ "@wg-npm/survey-service-api": "0.3.6643",
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.6154",
42
- "@wg-npm/survey-service-api": "0.3.6154",
41
+ "@wg-npm/survey-core": "0.3.6643",
42
+ "@wg-npm/survey-service-api": "0.3.6643",
43
43
  "acorn": "^7.3.1",
44
44
  "axios": "^0.19.2",
45
45
  "babelrc-rollup": "^3.0.0",
@@ -5,7 +5,6 @@
5
5
  :width="50"
6
6
  :closable="true"
7
7
  :mask-closable="false"
8
- @on-close="closeDrawer"
9
8
  >
10
9
  <ButtonGroup slot="header" shape="circle">
11
10
  <Button type="primary" v-once>{{t(`survey_creator.question.type`)}}</Button>
@@ -111,7 +110,6 @@ export default Vue.extend({
111
110
  methods: {
112
111
  closeDrawer() {
113
112
  this.visibleDrawer = false;
114
- this.$emit("on-close")
115
113
  },
116
114
  saveQuestion() {
117
115
  const self = this;
@@ -128,7 +126,6 @@ export default Vue.extend({
128
126
  },
129
127
  cancel() {
130
128
  this.closeDrawer();
131
- this.$emit("cancel")
132
129
  }
133
130
  }
134
131
  });
@@ -6,7 +6,8 @@
6
6
  ref="editDrawer"
7
7
  v-model="questionEditDrawerVisible"
8
8
  :operation-type="operationType"
9
- @cancel="cancel"
9
+ @on-close="questionEditDrawClose"
10
+ @on-open="questionEditDrawOpen"
10
11
  />
11
12
  </div>
12
13
  <div class="survey-creator-wrapper" v-else>
@@ -193,7 +194,7 @@
193
194
  this.primaryLanguage = _.camelCase(this.currentSurvey.options.primaryLanguage);
194
195
 
195
196
  if (this.showQuestionWhenPageLoad) {
196
- const question = _.findLast(this.currentSurvey?.questions, questions=> { return questions.type === this.showQuestionType})
197
+ const question = _.find(this.currentSurvey?.questions, questions=> { return questions.type === this.showQuestionType})
197
198
  if (_.isUndefined(question)) {
198
199
  this.createQuestion(this.showQuestionType)
199
200
  } else {
@@ -361,8 +362,11 @@
361
362
  validateData() {
362
363
  return this.allTranslationIsCompleted(this.currentSurvey);
363
364
  },
364
- cancel() {
365
- this.$emit("cancel")
365
+ questionEditDrawOpen(val){
366
+ this.$emit("question-edit-draw-open");
367
+ },
368
+ questionEditDrawClose(val){
369
+ this.$emit("question-edit-draw-close");
366
370
  }
367
371
  }
368
372
  });