@webitel/ui-sdk 2.0.1 → 2.0.2
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.common.js +26 -14
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +26 -14
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +2 -2
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/wt-select/wt-select.vue +49 -42
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="wt-select"
|
|
4
3
|
:class="{
|
|
5
4
|
'wt-select--disabled': disabled,
|
|
6
5
|
'wt-select--invalid': invalid,
|
|
7
6
|
'wt-select--clearable': clearable,
|
|
8
7
|
'wt-select--loading': isLoading,
|
|
9
8
|
}"
|
|
9
|
+
class="wt-select"
|
|
10
10
|
>
|
|
11
11
|
<wt-label
|
|
12
|
-
class="wt-select__label"
|
|
13
12
|
v-if="hasLabel"
|
|
14
13
|
:disabled="disabled"
|
|
15
14
|
:invalid="invalid"
|
|
15
|
+
class="wt-select__label"
|
|
16
16
|
v-bind="labelProps"
|
|
17
17
|
>
|
|
18
18
|
<!-- @slot Custom input label -->
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
</wt-label>
|
|
21
21
|
<vue-multiselect
|
|
22
22
|
ref="vue-multiselect"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
:
|
|
26
|
-
:options="selectOptions"
|
|
27
|
-
:placeholder="placeholder || label"
|
|
28
|
-
:limit="1"
|
|
23
|
+
:allow-empty="allowEmpty"
|
|
24
|
+
:disabled="disabled"
|
|
25
|
+
:internal-search="!searchMethod"
|
|
29
26
|
:label="optionLabel"
|
|
30
|
-
:
|
|
27
|
+
:limit="1"
|
|
31
28
|
:limit-text="(count) => `+${count}`"
|
|
32
29
|
:loading="false"
|
|
33
|
-
:
|
|
34
|
-
:
|
|
35
|
-
:
|
|
30
|
+
:options="selectOptions"
|
|
31
|
+
:placeholder="placeholder || label"
|
|
32
|
+
:track-by="trackBy"
|
|
33
|
+
:value="selectValue"
|
|
34
|
+
class="wt-select__select"
|
|
35
|
+
v-bind="$attrs"
|
|
36
36
|
v-on="listeners"
|
|
37
37
|
>
|
|
38
38
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<template slot="singleLabel" slot-scope="{ option }">
|
|
48
48
|
<slot name="singleLabel" v-bind="{ option, optionLabel }">
|
|
49
49
|
<span class="multiselect__single-label">
|
|
50
|
-
{{
|
|
50
|
+
{{ getOptionLabel({ option, optionLabel }) }}
|
|
51
51
|
</span>
|
|
52
52
|
</slot>
|
|
53
53
|
</template>
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
<template slot="option" slot-scope="{ option }">
|
|
57
57
|
<slot name="option" v-bind="{ option, optionLabel }">
|
|
58
58
|
<span>
|
|
59
|
-
{{
|
|
59
|
+
{{ getOptionLabel({ option, optionLabel }) }}
|
|
60
60
|
</span>
|
|
61
61
|
</slot>
|
|
62
62
|
</template>
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
<template slot="caret" slot-scope="{ toggle }">
|
|
66
66
|
<!-- @mousedown.native.prevent.stop="toggle": https://github.com/shentao/vue-multiselect/issues/1204#issuecomment-615114727 -->
|
|
67
67
|
<wt-icon-btn
|
|
68
|
+
:disabled="disabled"
|
|
68
69
|
class="wt-select__arrow-caret"
|
|
69
70
|
icon="arrow-down"
|
|
70
|
-
:disabled="disabled"
|
|
71
71
|
@mousedown.native.prevent.stop="toggle"
|
|
72
72
|
></wt-icon-btn>
|
|
73
73
|
</template>
|
|
@@ -76,21 +76,21 @@
|
|
|
76
76
|
<template slot="clear" slot-scope="{}">
|
|
77
77
|
<wt-icon-btn
|
|
78
78
|
v-if="clearable"
|
|
79
|
-
class="wt-select__clear"
|
|
80
79
|
:class="{ 'hidden': !isValue }"
|
|
81
80
|
:disabled="disabled"
|
|
81
|
+
class="wt-select__clear"
|
|
82
82
|
icon="close"
|
|
83
83
|
@click="clearValue"
|
|
84
84
|
></wt-icon-btn>
|
|
85
85
|
</template>
|
|
86
86
|
|
|
87
87
|
<template slot="beforeList">
|
|
88
|
-
<div class="wt-select__loading-wrapper"
|
|
88
|
+
<div v-show="isLoading" class="wt-select__loading-wrapper">
|
|
89
89
|
<wt-loader size="sm"></wt-loader>
|
|
90
90
|
</div>
|
|
91
91
|
</template>
|
|
92
92
|
|
|
93
|
-
<template
|
|
93
|
+
<template v-if="showIntersectionObserver" slot="afterList">
|
|
94
94
|
<div v-observe-visibility="handleAfterListIntersect"></div>
|
|
95
95
|
</template>
|
|
96
96
|
</vue-multiselect>
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
<script>
|
|
106
106
|
import VueMultiselect from 'vue-multiselect';
|
|
107
107
|
import { ObserveVisibility } from 'vue-observe-visibility';
|
|
108
|
-
import isEmpty from '../../../scripts/isEmpty';
|
|
109
|
-
import debounce from '../../../scripts/debounce';
|
|
110
108
|
import validationMixin from '../../../mixins/validationMixin/validationMixin';
|
|
109
|
+
import debounce from '../../../scripts/debounce';
|
|
110
|
+
import isEmpty from '../../../scripts/isEmpty';
|
|
111
111
|
|
|
112
112
|
export default {
|
|
113
113
|
name: 'wt-select',
|
|
@@ -225,6 +225,13 @@ export default {
|
|
|
225
225
|
},
|
|
226
226
|
|
|
227
227
|
methods: {
|
|
228
|
+
getOptionLabel({ option, optionLabel }) {
|
|
229
|
+
if (option.locale) {
|
|
230
|
+
if (Array.isArray(option.locale)) return this.$tc(...option.locale);
|
|
231
|
+
return this.$t(option.locale);
|
|
232
|
+
}
|
|
233
|
+
return option[optionLabel] || option;
|
|
234
|
+
},
|
|
228
235
|
handleSearchChange(search) {
|
|
229
236
|
if (!this.isApiMode) return;
|
|
230
237
|
this.isLoading = true;
|
|
@@ -294,28 +301,28 @@ export default {
|
|
|
294
301
|
|
|
295
302
|
.wt-select__arrow-caret {
|
|
296
303
|
position: absolute;
|
|
304
|
+
z-index: var(--select-caret-z-index);
|
|
297
305
|
top: var(--select-caret-top-pos);
|
|
298
306
|
right: var(--select-caret-right-pos);
|
|
299
|
-
transform: rotate(0);
|
|
300
307
|
transition: var(--transition);
|
|
301
|
-
|
|
308
|
+
transform: rotate(0);
|
|
302
309
|
}
|
|
303
310
|
|
|
304
311
|
::v-deep .wt-select__clear {
|
|
305
312
|
position: absolute;
|
|
313
|
+
z-index: var(--select-clear-z-index);
|
|
306
314
|
top: var(--select-clear-top-pos);
|
|
307
315
|
right: var(--select-clear-right-pos);
|
|
308
|
-
transform: rotate(0);
|
|
309
316
|
transition: var(--transition);
|
|
310
|
-
|
|
317
|
+
transform: rotate(0);
|
|
311
318
|
}
|
|
312
319
|
|
|
313
320
|
::v-deep {
|
|
314
321
|
.multiselect__tags {
|
|
315
322
|
display: flex;
|
|
316
323
|
align-items: center;
|
|
317
|
-
min-height: var(--select-tags-min-height); // reset original 20px style
|
|
318
324
|
box-sizing: border-box;
|
|
325
|
+
min-height: var(--select-tags-min-height); // reset original 20px style
|
|
319
326
|
padding: var(--select-tags-padding);
|
|
320
327
|
color: var(--form-input-color);
|
|
321
328
|
border: var(--select-tags-border);
|
|
@@ -327,8 +334,8 @@ export default {
|
|
|
327
334
|
@extend %typo-body-1;
|
|
328
335
|
@include wt-placeholder;
|
|
329
336
|
min-height: var(--select-input-min-height); // reset original 20px style
|
|
330
|
-
padding: 0;
|
|
331
337
|
margin: 0;
|
|
338
|
+
padding: 0;
|
|
332
339
|
background: transparent;
|
|
333
340
|
}
|
|
334
341
|
|
|
@@ -340,34 +347,34 @@ export default {
|
|
|
340
347
|
@extend %typo-body-1;
|
|
341
348
|
@extend .wt-chip;
|
|
342
349
|
position: absolute;
|
|
350
|
+
z-index: var(--select-chip-z-index);
|
|
343
351
|
right: var(--select-chip-right-pos);
|
|
344
352
|
min-height: var(--select-input-min-height); // reset original 20px style
|
|
345
353
|
margin: 0;
|
|
346
354
|
font-weight: normal;
|
|
347
|
-
z-index: var(--select-chip-z-index);
|
|
348
355
|
|
|
349
356
|
/* these before-after elements are fixing issue when chip is visually overflown by
|
|
350
357
|
selected option name (yep, chip has z-index, but its background has 0.3 opacity)*/
|
|
351
358
|
&:before {
|
|
352
|
-
content: '';
|
|
353
359
|
position: absolute;
|
|
360
|
+
z-index: -2; // below chip itself
|
|
354
361
|
top: 0;
|
|
355
362
|
right: 0;
|
|
356
363
|
bottom: 0;
|
|
357
364
|
left: 0;
|
|
358
|
-
|
|
365
|
+
content: '';
|
|
359
366
|
background: var(--main-color);
|
|
360
367
|
}
|
|
361
368
|
|
|
362
369
|
&:after {
|
|
363
370
|
@extend .wt-chip;
|
|
364
|
-
content: '';
|
|
365
371
|
position: absolute;
|
|
372
|
+
z-index: -1; // below chip itself
|
|
366
373
|
top: 0;
|
|
367
374
|
right: 0;
|
|
368
375
|
bottom: 0;
|
|
369
376
|
left: 0;
|
|
370
|
-
|
|
377
|
+
content: '';
|
|
371
378
|
|
|
372
379
|
}
|
|
373
380
|
}
|
|
@@ -378,33 +385,33 @@ export default {
|
|
|
378
385
|
|
|
379
386
|
.multiselect__custom-tag, .multiselect__single-label {
|
|
380
387
|
@extend %typo-body-1;
|
|
381
|
-
|
|
388
|
+
display: block;
|
|
382
389
|
|
|
383
390
|
// text overflow 3 dots
|
|
384
|
-
display: block;
|
|
385
|
-
white-space: nowrap;
|
|
386
391
|
overflow: hidden;
|
|
392
|
+
white-space: nowrap;
|
|
387
393
|
text-overflow: ellipsis;
|
|
394
|
+
color: var(--form-input-color);
|
|
388
395
|
}
|
|
389
396
|
|
|
390
397
|
.multiselect__placeholder {
|
|
391
398
|
@extend %wt-placeholder;
|
|
392
|
-
|
|
399
|
+
overflow: hidden;
|
|
393
400
|
margin: 0;
|
|
394
401
|
|
|
395
402
|
// text overflow 3 dots
|
|
403
|
+
padding: 0;
|
|
396
404
|
white-space: nowrap;
|
|
397
|
-
overflow: hidden;
|
|
398
405
|
text-overflow: ellipsis;
|
|
399
406
|
}
|
|
400
407
|
}
|
|
401
408
|
|
|
402
409
|
.multiselect__content-wrapper {
|
|
403
410
|
@extend %wt-distant-scrollbar;
|
|
411
|
+
transition: var(--transition);
|
|
404
412
|
border: var(--select-tags-border);
|
|
405
413
|
border-color: var(--form-border-color);
|
|
406
414
|
border-radius: var(--border-radius);
|
|
407
|
-
transition: var(--transition);
|
|
408
415
|
|
|
409
416
|
.multiselect__option {
|
|
410
417
|
@extend %typo-body-1;
|
|
@@ -435,15 +442,15 @@ export default {
|
|
|
435
442
|
|
|
436
443
|
.wt-select__loading-wrapper {
|
|
437
444
|
position: sticky;
|
|
438
|
-
|
|
439
|
-
height: 300px; // max dropdown panel height
|
|
445
|
+
z-index: 1;
|
|
440
446
|
top: 0;
|
|
441
447
|
left: 0;
|
|
442
448
|
display: flex;
|
|
443
449
|
align-items: center;
|
|
444
450
|
justify-content: center;
|
|
451
|
+
width: 100%;
|
|
452
|
+
height: 300px; // max dropdown panel height
|
|
445
453
|
backdrop-filter: blur(4px);
|
|
446
|
-
z-index: 1;
|
|
447
454
|
}
|
|
448
455
|
}
|
|
449
456
|
|
|
@@ -513,8 +520,8 @@ export default {
|
|
|
513
520
|
pointer-events: none;
|
|
514
521
|
|
|
515
522
|
.multiselect--disabled {
|
|
516
|
-
background: none;
|
|
517
523
|
opacity: 1;
|
|
524
|
+
background: none;
|
|
518
525
|
}
|
|
519
526
|
|
|
520
527
|
.wt-select__arrow-caret ::v-deep .wt-icon__icon,
|
|
@@ -525,8 +532,8 @@ export default {
|
|
|
525
532
|
.multiselect {
|
|
526
533
|
::v-deep {
|
|
527
534
|
.multiselect__tags {
|
|
528
|
-
background: var(--form-border--disabled-color);
|
|
529
535
|
border-color: var(--form-border--disabled-color);
|
|
536
|
+
background: var(--form-border--disabled-color);
|
|
530
537
|
|
|
531
538
|
.multiselect__placeholder {
|
|
532
539
|
@extend %wt-placeholder--disabled;
|