@webitel/ui-sdk 26.6.123 → 26.6.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.6.123",
3
+ "version": "26.6.124",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -97,6 +97,7 @@ const props = defineProps({
97
97
  const emit = defineEmits([
98
98
  'copy',
99
99
  'delete',
100
+ 'answer-type:change',
100
101
  ]);
101
102
 
102
103
  const { t } = useI18n();
@@ -142,6 +143,7 @@ function updateQuestion({ path, value }) {
142
143
 
143
144
  function handleQuestionTypeChange(type) {
144
145
  if (readonly) return;
146
+ emit('answer-type:change');
145
147
  const commonFields = {
146
148
  question: questionModel.value.question,
147
149
  required: questionModel.value.required,
@@ -19,6 +19,7 @@
19
19
  :v="v$"
20
20
  class="audit-form-question"
21
21
  @activate="activateQuestion"
22
+ @answer-type:change="handleAnswerTypeChange"
22
23
  @copy="emit('copy')"
23
24
  @delete="emit('delete')"
24
25
  />
@@ -116,11 +117,20 @@ const component = computed(() => {
116
117
  });
117
118
 
118
119
  const isAnswer = computed(() => !isEmpty(answerModel.value));
120
+ const skipNextClickaway = ref(false);
119
121
 
120
122
  function saveQuestion() {
123
+ if (skipNextClickaway.value) {
124
+ skipNextClickaway.value = false;
125
+ return;
126
+ }
121
127
  state.value = QuestionState.SAVED;
122
128
  }
123
129
 
130
+ function handleAnswerTypeChange() {
131
+ skipNextClickaway.value = true;
132
+ }
133
+
124
134
  function activateQuestion() {
125
135
  if (mode !== 'create') return;
126
136
  state.value = QuestionState.EDIT;