@webitel/ui-sdk 24.4.23 → 24.4.25
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/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.mjs +1445 -1432
- package/dist/ui-sdk.umd.js +10 -10
- package/package.json +1 -1
- package/src/components/wt-select/wt-select.vue +17 -13
package/package.json
CHANGED
|
@@ -86,17 +86,18 @@
|
|
|
86
86
|
<template #caret="{ toggle }">
|
|
87
87
|
<!-- In mode allowCustomValues, adding is done by clicking on this icon -->
|
|
88
88
|
<!-- [https://my.webitel.com/browse/WTEL-3181]-->
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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="handleCustomValueArrowInput(toggle)"
|
|
96
|
+
/>
|
|
97
97
|
<!-- To view a list of possible values, click on this icon -->
|
|
98
98
|
<!-- @mousedown.native.prevent.stop="toggle": https://github.com/shentao/vue-multiselect/issues/1204#issuecomment-615114727 -->
|
|
99
99
|
<wt-icon-btn
|
|
100
|
+
v-else
|
|
100
101
|
:disabled="disabled"
|
|
101
102
|
class="multiselect__select multiselect__arrow"
|
|
102
103
|
icon="arrow-down"
|
|
@@ -143,6 +144,7 @@
|
|
|
143
144
|
</template>
|
|
144
145
|
|
|
145
146
|
<script>
|
|
147
|
+
import isEmpty from '../../scripts/isEmpty';
|
|
146
148
|
import taggableMixin from '../wt-tags-input/mixin/taggableMixin';
|
|
147
149
|
import multiselectMixin from './mixins/multiselectMixin';
|
|
148
150
|
|
|
@@ -212,7 +214,7 @@ export default {
|
|
|
212
214
|
const customValuesToOptions =
|
|
213
215
|
Array.isArray(this.value)
|
|
214
216
|
? this.value
|
|
215
|
-
: (this.value ? [
|
|
217
|
+
: (isEmpty(this.value) ? [] : [this.value]); //do not add empty values
|
|
216
218
|
const optionsWithoutValues = this.selectOptions.filter((opt) => {
|
|
217
219
|
const optKey = this.trackBy ? opt[this.trackBy] : opt;
|
|
218
220
|
return !customValuesToOptions.some((customValue) => {
|
|
@@ -232,8 +234,10 @@ export default {
|
|
|
232
234
|
async handleCustomValue(value) {
|
|
233
235
|
// https://webitel.atlassian.net/browse/WTEL-3181
|
|
234
236
|
this.tag(value);
|
|
235
|
-
|
|
236
|
-
|
|
237
|
+
},
|
|
238
|
+
// for taggableMixin functionality
|
|
239
|
+
async handleCustomValueArrowInput(toggle) {
|
|
240
|
+
// https://webitel.atlassian.net/browse/WTEL-3181
|
|
237
241
|
// OLD CODE, but can be useful in future
|
|
238
242
|
/**
|
|
239
243
|
* tag emits input event, but there is a drawback
|
|
@@ -244,7 +248,7 @@ export default {
|
|
|
244
248
|
* for now, i've tested this cause and it works well even without waiting for $nextTick()
|
|
245
249
|
* however, this is a potential problem, so, i've left this comment here
|
|
246
250
|
*/
|
|
247
|
-
|
|
251
|
+
this.tag(this.searchParams.search);
|
|
248
252
|
// await this.$nextTick();
|
|
249
253
|
|
|
250
254
|
/**
|
|
@@ -252,7 +256,7 @@ export default {
|
|
|
252
256
|
* because there could be code, which performs operation with input only after select close
|
|
253
257
|
* so that, it's crucial to emit input before close
|
|
254
258
|
*/
|
|
255
|
-
|
|
259
|
+
toggle();
|
|
256
260
|
},
|
|
257
261
|
// for taggableMixin functionality
|
|
258
262
|
emitTagEvent(searchQuery, id) {
|