@webitel/ui-sdk 26.8.146 → 26.8.147

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,4 +1,4 @@
1
- import "./components-DDe2Hor4.js";
1
+ import "./components-BlmVperV.js";
2
2
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { E as t, h as n } from "./enums-CKer6GJR.js";
4
4
  import { t as r } from "./wt-button-DipbKGWn.js";
@@ -1,4 +1,4 @@
1
- import { C as e, i as t } from "./components-DDe2Hor4.js";
1
+ import { C as e, i as t } from "./components-BlmVperV.js";
2
2
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { t as r } from "./utils-DQQQIpjz.js";
4
4
  import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, openBlock as d, renderList as f, renderSlot as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
@@ -1,6 +1,6 @@
1
- import { n as e } from "./components-DDe2Hor4.js";
1
+ import { n as e } from "./components-BlmVperV.js";
2
2
  import "./convertDuration-CIPonKKW.js";
3
- import { i as t, r as n } from "./clients-C8iQUpKL.js";
3
+ import { i as t, r as n } from "./clients-DZ2FcoPP.js";
4
4
  import { n as r } from "./vue-i18n-VBiROMZ4.js";
5
5
  import { n as i } from "./useEventBus-B-ZeklLu.js";
6
6
  import { createBlock as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeProps as l, onMounted as u, openBlock as d, ref as f, resolveComponent as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
@@ -1,7 +1,7 @@
1
1
  import "./dist-EXdgfpvN.js";
2
2
  import { n as e } from "./genClient-CvWlQ0TZ.js";
3
- import { a as t, o as n, r, s as i, w as a } from "./components-DDe2Hor4.js";
4
- import { n as o, t as s } from "./clients-C8iQUpKL.js";
3
+ import { a as t, o as n, r, s as i, w as a } from "./components-BlmVperV.js";
4
+ import { n as o, t as s } from "./clients-DZ2FcoPP.js";
5
5
  import { a as c, c as l, i as u, n as d, o as f, p, r as m, s as h, t as g } from "./enums-CKer6GJR.js";
6
6
  import { n as _ } from "./vue-i18n-VBiROMZ4.js";
7
7
  import "./wt-toast-3-3ZylQ9.js";
@@ -1,4 +1,4 @@
1
- import { T as e } from "./components-DDe2Hor4.js";
1
+ import { T as e } from "./components-BlmVperV.js";
2
2
  import "./convertDuration-CIPonKKW.js";
3
3
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { h as n } from "./enums-CKer6GJR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.8.146",
3
+ "version": "26.8.147",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -25,6 +25,12 @@
25
25
  {{ question.question }}
26
26
  </p>
27
27
  </div>
28
+ <wt-hint
29
+ v-if="question.description"
30
+ @click.stop
31
+ >
32
+ <span class="audit-form-question-read__description">{{ question.description }}</span>
33
+ </wt-hint>
28
34
  <wt-icon
29
35
  v-if="showMoveIcon"
30
36
  class="audit-form-question-read__drag-icon"
@@ -72,7 +78,7 @@ import { EngineAuditQuestionType } from '@webitel/api-services/gen/models';
72
78
  import { computed, inject } from 'vue';
73
79
  import { useI18n } from 'vue-i18n';
74
80
 
75
- import { WtDivider, WtIcon } from '../../../components';
81
+ import { WtDivider, WtHint, WtIcon } from '../../../components';
76
82
  import { IconColor } from '../../../enums';
77
83
  import isEmpty from '../../../scripts/isEmpty.js';
78
84
  import AuditFormAnswerEditingInfo from './form-answers/answer-editing-info/audit-form-answer-editing-info.vue';
@@ -191,6 +197,13 @@ const resetAnswer = () => {
191
197
  flex-shrink: 0;
192
198
  }
193
199
 
200
+ .audit-form-question-read__description {
201
+ display: block;
202
+ max-width: 200px;
203
+ white-space: pre-line;
204
+ overflow-wrap: anywhere;
205
+ }
206
+
194
207
  .audit-form-question-read-content {
195
208
  display: flex;
196
209
  flex-direction: column;
@@ -197,9 +197,6 @@ function handleQuestionTypeChange(type) {
197
197
  display: grid;
198
198
  grid-template-columns: 3fr 1fr;
199
199
  gap: var(--spacing-sm);
200
- margin-right: calc(
201
- 24px + var(--spacing-sm)
202
- ); // delete icon action for type "options"
203
200
  margin-bottom: var(--spacing-sm);
204
201
  }
205
202
  </style>
@@ -18,6 +18,7 @@
18
18
 
19
19
  <wt-icon-btn
20
20
  v-tooltip="$t('reusable.delete')"
21
+ class="audit-form-question-options-write-row__action"
21
22
  :disabled="isDeleteDisabled"
22
23
  icon="bucket"
23
24
  @click="emit('delete')"
@@ -87,8 +88,9 @@ onMounted(() => v$.value.$touch());
87
88
  grid-template-columns: 3fr 1fr 24px;
88
89
  gap: var(--spacing-sm);
89
90
 
90
- &__tooltip {
91
- padding-top: var(--spacing-md);
91
+ &__action {
92
+ align-self: start;
93
+ margin-top: var(--spacing-lg);
92
94
  }
93
95
  }
94
96
  </style>
@@ -14,6 +14,16 @@
14
14
  updateQuestion({ path: `options[${key}]`, value: $event })
15
15
  "
16
16
  />
17
+ <wt-divider />
18
+ <wt-textarea
19
+ class="audit-form-question-options-write__description"
20
+ :label="$t('vocabulary.description')"
21
+ :model-value="questionModel.description"
22
+ :disabled="readonly"
23
+ :submit-on-enter="false"
24
+ autoresize
25
+ @update:model-value="updateQuestion({ path: 'description', value: $event })"
26
+ />
17
27
  <wt-button
18
28
  class="audit-form-question-options-write__add-button"
19
29
  :disabled="readonly"
@@ -45,7 +55,12 @@ import type {
45
55
  EngineQuestionAnswer,
46
56
  } from '@webitel/api-services/gen/models';
47
57
  import { inject } from 'vue';
48
- import { WtButton, WtRadio } from '../../../../../components';
58
+ import {
59
+ WtButton,
60
+ WtDivider,
61
+ WtRadio,
62
+ WtTextarea,
63
+ } from '../../../../../components';
49
64
  import updateObject from '../../../../../scripts/updateObject.js';
50
65
  import { generateOption } from '../../../schemas/AuditFormQuestionOptionsSchema';
51
66
  import OptionsWriteRow from './audit-form-question-options-write-row.vue';
@@ -61,7 +76,7 @@ defineProps<{
61
76
  mode: 'read' | 'write';
62
77
  }>();
63
78
 
64
- function updateQuestion({ path, value }) {
79
+ function updateQuestion({ path, value }: { path: string; value: unknown }) {
65
80
  if (readonly) return;
66
81
  questionModel.value = updateObject({
67
82
  obj: questionModel.value,
@@ -107,6 +122,10 @@ function updateAnswer(score) {
107
122
  </script>
108
123
 
109
124
  <style lang="scss" scoped>
125
+ .audit-form-question-options-write__description :deep(.wt-textarea__textarea) {
126
+ min-height: auto;
127
+ }
128
+
110
129
  .audit-form-question-options-write {
111
130
  display: flex;
112
131
  flex-direction: column;
@@ -20,6 +20,18 @@
20
20
  required
21
21
  @update:model-value="updateQuestion({ path: 'max', value: $event })"
22
22
  />
23
+ <div class="audit-form-question-score-write__description">
24
+ <wt-divider />
25
+ <wt-textarea
26
+ class="audit-form-question-score-write__textarea"
27
+ :label="$t('vocabulary.description')"
28
+ :model-value="questionModel.description"
29
+ :disabled="readonly"
30
+ :submit-on-enter="false"
31
+ autoresize
32
+ @update:model-value="updateQuestion({ path: 'description', value: $event })"
33
+ />
34
+ </div>
23
35
  </div>
24
36
  <div
25
37
  v-else-if="mode === 'read'"
@@ -46,7 +58,9 @@ import type {
46
58
  } from '@webitel/api-services/gen/models';
47
59
  import { computed, inject, onMounted } from 'vue';
48
60
 
61
+ import WtDivider from '../../../../../components/wt-divider/wt-divider.vue';
49
62
  import WtRadio from '../../../../../components/wt-radio/wt-radio.vue';
63
+ import WtTextarea from '../../../../../components/wt-textarea/wt-textarea.vue';
50
64
  import updateObject from '../../../../../scripts/updateObject.js';
51
65
 
52
66
  const answerModel = defineModel<EngineQuestionAnswer | null>('answer');
@@ -110,7 +124,7 @@ function updateAnswer(score) {
110
124
  };
111
125
  }
112
126
 
113
- function updateQuestion({ path, value }) {
127
+ function updateQuestion({ path, value }: { path: string; value: unknown }) {
114
128
  if (readonly) return;
115
129
  questionModel.value = updateObject({
116
130
  obj: questionModel.value,
@@ -124,11 +138,21 @@ onMounted(() => v$.value.$touch());
124
138
  </script>
125
139
 
126
140
  <style lang="scss" scoped>
141
+ .audit-form-question-score-write__textarea :deep(.wt-textarea__textarea) {
142
+ min-height: auto;
143
+ }
144
+
127
145
  .audit-form-question-score-write {
128
146
  display: grid;
129
- grid-template-columns: 100px 100px;
147
+ grid-template-columns: repeat(4, 1fr);
130
148
  gap: var(--spacing-sm);
131
- margin-right: calc(var(--spacing-sm) + 24px); // icon offset
149
+
150
+ &__description {
151
+ display: flex;
152
+ flex-direction: column;
153
+ grid-column: 1 / -1;
154
+ gap: var(--spacing-sm);
155
+ }
132
156
  }
133
157
 
134
158
  .audit-form-question-score-read {
@@ -4,7 +4,15 @@
4
4
  v-if="mode === 'write'"
5
5
  class="audit-form-question-yes-write"
6
6
  >
7
- <!-- Write mode: No UI needed, just a placeholder since the question type itself is the answer -->
7
+ <wt-textarea
8
+ class="audit-form-question-yes-write__description"
9
+ :label="t('vocabulary.description')"
10
+ :model-value="questionModel.description"
11
+ :disabled="readonly"
12
+ :submit-on-enter="false"
13
+ autoresize
14
+ @update:model-value="updateQuestion({ path: 'description', value: $event })"
15
+ />
8
16
  </div>
9
17
  <div
10
18
  v-else-if="mode === 'read'"
@@ -20,13 +28,20 @@
20
28
  </template>
21
29
 
22
30
  <script lang="ts" setup>
23
- import type { EngineQuestionAnswer } from '@webitel/api-services/gen/models';
24
- import { computed } from 'vue';
31
+ import type {
32
+ EngineQuestion,
33
+ EngineQuestionAnswer,
34
+ } from '@webitel/api-services/gen/models';
35
+ import { computed, inject } from 'vue';
25
36
  import { useI18n } from 'vue-i18n';
26
37
 
27
38
  import WtCheckbox from '../../../../../components/wt-checkbox/wt-checkbox.vue';
39
+ import WtTextarea from '../../../../../components/wt-textarea/wt-textarea.vue';
40
+ import updateObject from '../../../../../scripts/updateObject.js';
28
41
 
42
+ const questionModel = defineModel<EngineQuestion>('question');
29
43
  const answerModel = defineModel<EngineQuestionAnswer | null>('answer');
44
+ const readonly = inject<boolean>('readonly', false);
30
45
 
31
46
  defineProps<{
32
47
  /**
@@ -37,6 +52,15 @@ defineProps<{
37
52
 
38
53
  const { t } = useI18n();
39
54
 
55
+ function updateQuestion({ path, value }: { path: string; value: unknown }) {
56
+ if (readonly) return;
57
+ questionModel.value = updateObject({
58
+ obj: questionModel.value,
59
+ path,
60
+ value,
61
+ });
62
+ }
63
+
40
64
  const isYes = computed(() => answerModel.value?.score === 1);
41
65
 
42
66
  function toggleYes(value: boolean | string[]) {
@@ -53,6 +77,16 @@ function toggleYes(value: boolean | string[]) {
53
77
  </script>
54
78
 
55
79
  <style lang="scss" scoped>
80
+ .audit-form-question-yes-write__description :deep(.wt-textarea__textarea) {
81
+ min-height: auto;
82
+ }
83
+
84
+ .audit-form-question-yes-write {
85
+ display: grid;
86
+ grid-template-columns: 3fr 1fr;
87
+ gap: var(--spacing-sm);
88
+ }
89
+
56
90
  .audit-form-question-yes-read {
57
91
  display: flex;
58
92
  flex-direction: column;