@webitel/ui-sdk 24.12.43 → 24.12.45

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": "24.12.43",
3
+ "version": "24.12.45",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -160,6 +160,9 @@ onBeforeUnmount(() => {
160
160
  .wt-tooltip-floating {
161
161
  @extend %typo-body-2;
162
162
  z-index: 1000;
163
+ display: flex;
164
+ flex-direction: column;
165
+ gap: var(--spacing-xs);
163
166
  padding: var(--spacing-2xs) var(--spacing-xs);
164
167
  color: var(--wt-tooltip-text-color);
165
168
  border-radius: var(--border-radius);
@@ -43,6 +43,7 @@ import {
43
43
  watch,
44
44
  watchEffect,
45
45
  } from 'vue';
46
+
46
47
  import WtButton from '../../../components/wt-button/wt-button.vue';
47
48
  import { useDestroyableSortable } from '../../../composables/useDestroyableSortable/useDestroyableSortable.js';
48
49
  import { generateQuestionSchema } from '../schemas/AuditFormQuestionSchema.js';
@@ -82,7 +83,7 @@ const auditQuestions = ref(null);
82
83
  const isQuestionAdded = reactive({ value: false, index: null });
83
84
 
84
85
  async function addQuestion({ index, question } = {}) {
85
- const questions = [...props.questions];
86
+ const questions = [...(props.questions || [])];
86
87
  const newQuestion = question || generateQuestionSchema();
87
88
  if (index != null) questions.splice(index, 0, newQuestion);
88
89
  else questions.push(newQuestion);
@@ -124,12 +125,12 @@ function handleResultUpdate({ key, value }) {
124
125
  }
125
126
 
126
127
  function initResult() {
127
- const result = props.questions.map(() => ({}));
128
+ const result = props.questions?.map(() => ({}));
128
129
  emit('update:result', result);
129
130
  }
130
131
 
131
132
  function initQuestions() {
132
- if (props.mode === 'create' && !props.questions.length) {
133
+ if (props.mode === 'create' && !props.questions?.length) {
133
134
  addQuestion({ question: generateQuestionSchema({ required: true }) });
134
135
  } else if (props.questions.length)
135
136
  auditQuestions.value.at(0).activateQuestion();