@webitel/ui-sdk 24.4.21 → 24.4.22

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.4.21",
3
+ "version": "24.4.22",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -85,5 +85,8 @@
85
85
  "vitest": "^1.4.0",
86
86
  "vue": "^3.4.15",
87
87
  "vuex": "^4.1.0"
88
+ },
89
+ "overrides": {
90
+ "axios": "^1.6.8"
88
91
  }
89
92
  }
@@ -101,6 +101,10 @@ export default {
101
101
 
102
102
  methods: {
103
103
  getOptionLabel({ option, optionLabel }) {
104
+ // https://webitel.atlassian.net/browse/WTEL-3181
105
+ // if allowCustomValue select mode, return vue-multiselect label as is
106
+ if (this.allowCustomValues && option.isTag) return option.label;
107
+
104
108
  if (optionLabel && option[optionLabel]) return option[optionLabel];
105
109
  if (option.locale) {
106
110
  if (Array.isArray(option.locale)) return this.$t(...option.locale);
@@ -37,6 +37,7 @@
37
37
  :options="optionsWithCustomValues"
38
38
  :placeholder="placeholder || label"
39
39
  :track-by="trackBy"
40
+ :taggable="taggable"
40
41
  class="wt-select__select"
41
42
  v-bind="$attrs"
42
43
  @close="isOpened = false"
@@ -85,18 +86,17 @@
85
86
  <template #caret="{ toggle }">
86
87
  <!-- In mode allowCustomValues, adding is done by clicking on this icon -->
87
88
  <!-- [https://my.webitel.com/browse/WTEL-3181]-->
88
- <wt-icon-btn
89
- v-if="allowCustomValues && searchParams.search"
90
- :disabled="disabled"
91
- class="multiselect__select multiselect__custom-value"
92
- icon="select-custom-value-enter"
93
- @mousedown.prevent
94
- @click="handleCustomValue(toggle)"
95
- />
89
+ <!-- <wt-icon-btn-->
90
+ <!-- v-if="allowCustomValues && searchParams.search"-->
91
+ <!-- :disabled="disabled"-->
92
+ <!-- class="multiselect__select multiselect__custom-value"-->
93
+ <!-- icon="select-custom-value-enter"-->
94
+ <!-- @mousedown.prevent-->
95
+ <!-- @click="handleCustomValue(toggle)"-->
96
+ <!-- />-->
96
97
  <!-- To view a list of possible values, click on this icon -->
97
98
  <!-- @mousedown.native.prevent.stop="toggle": https://github.com/shentao/vue-multiselect/issues/1204#issuecomment-615114727 -->
98
99
  <wt-icon-btn
99
- v-else
100
100
  :disabled="disabled"
101
101
  class="multiselect__select multiselect__arrow"
102
102
  icon="arrow-down"
@@ -197,7 +197,14 @@ export default {
197
197
  // for taggableMixin
198
198
  manualTagging() { return this.handleCustomValuesAdditionManually; },
199
199
  optionsWithCustomValues() {
200
- if (!this.allowCustomValues) return this.selectOptions;
200
+ // https://webitel.atlassian.net/browse/WTEL-3181
201
+
202
+ // if (!this.allowCustomValues) return this.selectOptions;
203
+
204
+ // when it "taggable" vue-multiselect mode, vue-multiselect adds tag to options automatically
205
+ return this.selectOptions;
206
+
207
+ // old code, but can be useful in future
201
208
 
202
209
  /**
203
210
  custom values could be restored after refresh, so that they could be not included in options prop,
@@ -222,8 +229,14 @@ export default {
222
229
  },
223
230
  },
224
231
  methods: {
232
+
225
233
  // for taggableMixin functionality
226
- async handleCustomValue(toggle) {
234
+ async handleCustomValue(value) {
235
+ // https://webitel.atlassian.net/browse/WTEL-3181
236
+ this.tag(value);
237
+
238
+
239
+ // OLD CODE, but can be useful in future
227
240
  /**
228
241
  * tag emits input event, but there is a drawback
229
242
  * there are causes, when input handler is async, but close event, emitted by toggle(),
@@ -233,7 +246,7 @@ export default {
233
246
  * for now, i've tested this cause and it works well even without waiting for $nextTick()
234
247
  * however, this is a potential problem, so, i've left this comment here
235
248
  */
236
- this.tag(this.searchParams.search);
249
+ // this.tag(this.searchParams.search);
237
250
  // await this.$nextTick();
238
251
 
239
252
  /**
@@ -241,7 +254,7 @@ export default {
241
254
  * because there could be code, which performs operation with input only after select close
242
255
  * so that, it's crucial to emit input before close
243
256
  */
244
- toggle();
257
+ // toggle();
245
258
  },
246
259
  // for taggableMixin functionality
247
260
  emitTagEvent(searchQuery, id) {