@dataloop-ai/components 0.18.133 → 0.18.134
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
|
@@ -439,14 +439,6 @@ export default defineComponent({
|
|
|
439
439
|
emit('change', val)
|
|
440
440
|
emit('selected', val)
|
|
441
441
|
}
|
|
442
|
-
const handleSelectedItem = (value: any) => {
|
|
443
|
-
selectedIndex.value = props.options.findIndex(
|
|
444
|
-
(option: string | Record<string, string | number> | number) =>
|
|
445
|
-
isEqual(option as any, value)
|
|
446
|
-
)
|
|
447
|
-
|
|
448
|
-
handleModelValueUpdate(value)
|
|
449
|
-
}
|
|
450
442
|
|
|
451
443
|
return {
|
|
452
444
|
uuid: `dl-select-${v4()}`,
|
|
@@ -456,7 +448,6 @@ export default defineComponent({
|
|
|
456
448
|
highlightedIndex,
|
|
457
449
|
selectedIndex,
|
|
458
450
|
setHighlightedIndex,
|
|
459
|
-
handleSelectedItem,
|
|
460
451
|
handleModelValueUpdate,
|
|
461
452
|
searchTerm, // todo: merge this sometime
|
|
462
453
|
searchInputValue
|
|
@@ -743,6 +734,9 @@ export default defineComponent({
|
|
|
743
734
|
isEqual(option, this.modelValue)
|
|
744
735
|
)
|
|
745
736
|
},
|
|
737
|
+
handleSelectedItem(value: DlSelectOptionType) {
|
|
738
|
+
this.selectOption(value)
|
|
739
|
+
},
|
|
746
740
|
getOptionValue(option: any) {
|
|
747
741
|
return option?.value ?? option
|
|
748
742
|
},
|
|
@@ -796,20 +790,11 @@ export default defineComponent({
|
|
|
796
790
|
this.selectedIndex = -1
|
|
797
791
|
this.closeMenu()
|
|
798
792
|
},
|
|
799
|
-
selectOption(
|
|
793
|
+
selectOption(selectedOption: DlSelectOptionType) {
|
|
800
794
|
if (this.multiselect) {
|
|
801
795
|
return
|
|
802
796
|
}
|
|
803
797
|
|
|
804
|
-
this.selectedIndex = this.options.findIndex(
|
|
805
|
-
(el: string | Record<string, string | number> | number) =>
|
|
806
|
-
isEqual(el, selected)
|
|
807
|
-
)
|
|
808
|
-
const selectedOption =
|
|
809
|
-
this.selectedIndex === -1
|
|
810
|
-
? undefined
|
|
811
|
-
: this.options[this.selectedIndex]
|
|
812
|
-
|
|
813
798
|
if (this.searchable) {
|
|
814
799
|
const searchInput = this.$refs.searchInput as HTMLInputElement
|
|
815
800
|
searchInput.value =
|