@dataloop-ai/components 0.20.19 → 0.20.21
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
|
@@ -77,16 +77,14 @@
|
|
|
77
77
|
</dl-tooltip>
|
|
78
78
|
<div v-if="hasSelectedSlot" style="width: 100%">
|
|
79
79
|
<slot
|
|
80
|
-
v-if="
|
|
80
|
+
v-if="!isActiveSearchInput"
|
|
81
81
|
:opt="selectedOption"
|
|
82
82
|
name="selected"
|
|
83
|
-
/>
|
|
84
|
-
<span
|
|
85
|
-
v-else-if="!isActiveSearchInput"
|
|
86
|
-
class="root-container--placeholder"
|
|
87
83
|
>
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
<span class="root-container--placeholder">
|
|
85
|
+
{{ filterSelectLabel }}
|
|
86
|
+
</span>
|
|
87
|
+
</slot>
|
|
90
88
|
</div>
|
|
91
89
|
<template v-else>
|
|
92
90
|
<span
|
|
@@ -671,9 +669,6 @@ export default defineComponent({
|
|
|
671
669
|
isActiveSearchInput(): boolean {
|
|
672
670
|
return this.searchable && this.isExpanded
|
|
673
671
|
},
|
|
674
|
-
shouldShowSelectedSlotContent(): boolean {
|
|
675
|
-
return this.hasSelectedSlotContent && !this.isActiveSearchInput
|
|
676
|
-
},
|
|
677
672
|
computedPlaceholder(): string {
|
|
678
673
|
return this.placeholder || 'Select option'
|
|
679
674
|
},
|
|
@@ -690,9 +685,34 @@ export default defineComponent({
|
|
|
690
685
|
}
|
|
691
686
|
},
|
|
692
687
|
selectedOption(): DlSelectOptionType {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
688
|
+
if (this.multiselect) {
|
|
689
|
+
if (this.modelValueLength === 1) {
|
|
690
|
+
return this.options.find((option: any) => {
|
|
691
|
+
return isEqual(
|
|
692
|
+
option.value,
|
|
693
|
+
Array.isArray(this.modelValue)
|
|
694
|
+
? this.modelValue[0]
|
|
695
|
+
: this.modelValue
|
|
696
|
+
)
|
|
697
|
+
})
|
|
698
|
+
} else {
|
|
699
|
+
return {
|
|
700
|
+
label: this.filterSelectLabel,
|
|
701
|
+
value: this.modelValue,
|
|
702
|
+
readonly: true
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
if (this.selectedIndex === -1) {
|
|
708
|
+
return {
|
|
709
|
+
label: this.computedPlaceholder,
|
|
710
|
+
value: null,
|
|
711
|
+
readonly: true
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return this.options[this.selectedIndex]
|
|
696
716
|
},
|
|
697
717
|
hasBeforeOptions(): boolean {
|
|
698
718
|
return !!this.$slots['before-options']
|
|
@@ -403,9 +403,7 @@ export default defineComponent({
|
|
|
403
403
|
display: flex !important;
|
|
404
404
|
justify-content: center !important;
|
|
405
405
|
color: var(--dl-color-medium);
|
|
406
|
-
transition-property:
|
|
407
|
-
transform,
|
|
408
|
-
-webkit-transform;
|
|
406
|
+
transition-property: transform, -webkit-transform;
|
|
409
407
|
transition-duration: 0.28s, 0.28s;
|
|
410
408
|
transition-timing-function: ease, ease;
|
|
411
409
|
transition-delay: 0s, 0s;
|
|
@@ -422,7 +420,7 @@ export default defineComponent({
|
|
|
422
420
|
}
|
|
423
421
|
|
|
424
422
|
.readonly-option {
|
|
425
|
-
height: 28px;
|
|
423
|
+
min-height: 28px;
|
|
426
424
|
display: flex;
|
|
427
425
|
align-items: center;
|
|
428
426
|
font-size: 12px;
|
|
@@ -625,6 +625,66 @@
|
|
|
625
625
|
<dl-button label="Button" />
|
|
626
626
|
</template>
|
|
627
627
|
</dl-select>
|
|
628
|
+
|
|
629
|
+
Select with auto select selected
|
|
630
|
+
<dl-select
|
|
631
|
+
v-model="preSelectedValue"
|
|
632
|
+
width="84px"
|
|
633
|
+
without-borders
|
|
634
|
+
with-chips
|
|
635
|
+
align-right
|
|
636
|
+
searchable
|
|
637
|
+
:options="[
|
|
638
|
+
{ label: 'High', value: 'high', bgColor: 'dl-color-negative' },
|
|
639
|
+
{
|
|
640
|
+
label: 'Medium',
|
|
641
|
+
value: 'medium',
|
|
642
|
+
bgColor: 'dl-color-warning',
|
|
643
|
+
textColor: 'dl-color-darker',
|
|
644
|
+
icon: 'icon-dl-search'
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
label: 'Low',
|
|
648
|
+
value: 'low',
|
|
649
|
+
bgColor: 'dl-color-positive',
|
|
650
|
+
textColor: 'dl-color-darker'
|
|
651
|
+
}
|
|
652
|
+
]"
|
|
653
|
+
required
|
|
654
|
+
>
|
|
655
|
+
<template #selected="scope">
|
|
656
|
+
<dl-chip
|
|
657
|
+
:text-color="scope.opt.textColor"
|
|
658
|
+
:color="scope.opt.bgColor"
|
|
659
|
+
>
|
|
660
|
+
{{ scope.opt.label }}
|
|
661
|
+
</dl-chip>
|
|
662
|
+
</template>
|
|
663
|
+
<template #option="scope">
|
|
664
|
+
<div class="flex">
|
|
665
|
+
<dl-chip
|
|
666
|
+
:text-color="scope.opt.textColor"
|
|
667
|
+
:color="scope.opt.bgColor"
|
|
668
|
+
>
|
|
669
|
+
{{ scope.opt.label }}
|
|
670
|
+
</dl-chip>
|
|
671
|
+
</div>
|
|
672
|
+
</template>
|
|
673
|
+
</dl-select>
|
|
674
|
+
|
|
675
|
+
Select with multiselect auto expanded and fixed width and virtual scroll
|
|
676
|
+
with selected slot
|
|
677
|
+
<dl-select
|
|
678
|
+
v-model="selectedWithChildrenAndReadonly"
|
|
679
|
+
:options="alotOfOptionsExpanded"
|
|
680
|
+
multiselect
|
|
681
|
+
searchable
|
|
682
|
+
style="margin-bottom: 150px; width: 200px"
|
|
683
|
+
>
|
|
684
|
+
<template #selected="scope">
|
|
685
|
+
<div>{{ scope.opt.label }}</div>
|
|
686
|
+
</template>
|
|
687
|
+
</dl-select>
|
|
628
688
|
</div>
|
|
629
689
|
</template>
|
|
630
690
|
|
|
@@ -891,7 +951,8 @@ export default defineComponent({
|
|
|
891
951
|
selectedWithChildrenCapitalized: [],
|
|
892
952
|
tasksFilter: [],
|
|
893
953
|
showAllOption: true,
|
|
894
|
-
disabledSelected: 'disabled option'
|
|
954
|
+
disabledSelected: 'disabled option',
|
|
955
|
+
preSelectedValue: null
|
|
895
956
|
}
|
|
896
957
|
},
|
|
897
958
|
computed: {
|
|
@@ -907,7 +968,7 @@ export default defineComponent({
|
|
|
907
968
|
key: i,
|
|
908
969
|
subLabel: 'not so high',
|
|
909
970
|
label: 'High ' + i,
|
|
910
|
-
value: 'high',
|
|
971
|
+
value: 'high' + i,
|
|
911
972
|
bgColor: 'dl-color-negative'
|
|
912
973
|
})
|
|
913
974
|
}
|
|
@@ -922,7 +983,7 @@ export default defineComponent({
|
|
|
922
983
|
key: i,
|
|
923
984
|
subLabel: 'not so high',
|
|
924
985
|
label: 'High ' + i,
|
|
925
|
-
value: 'high',
|
|
986
|
+
value: 'high' + i,
|
|
926
987
|
bgColor: 'dl-color-negative'
|
|
927
988
|
})
|
|
928
989
|
}
|