@dataloop-ai/components 0.19.98 → 0.19.100
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
|
@@ -245,9 +245,16 @@
|
|
|
245
245
|
:opt="item"
|
|
246
246
|
>
|
|
247
247
|
<span
|
|
248
|
+
v-if="fitContent"
|
|
248
249
|
class="inner-option"
|
|
249
250
|
v-html="getOptionHtml(item)"
|
|
250
251
|
/>
|
|
252
|
+
<dl-ellipsis v-else>
|
|
253
|
+
<span
|
|
254
|
+
class="inner-option"
|
|
255
|
+
v-html="getOptionHtml(item)"
|
|
256
|
+
/>
|
|
257
|
+
</dl-ellipsis>
|
|
251
258
|
</slot>
|
|
252
259
|
</dl-select-option>
|
|
253
260
|
</dl-virtual-scroll>
|
|
@@ -851,15 +858,20 @@ export default defineComponent({
|
|
|
851
858
|
},
|
|
852
859
|
getOptionHtml(option: DlSelectOptionType) {
|
|
853
860
|
const label = `${this.getOptionLabel(option)}`
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
toReplace,
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
861
|
+
let highlightedHtml = label
|
|
862
|
+
|
|
863
|
+
if (this.searchInputValue?.length) {
|
|
864
|
+
const toReplace = new RegExp(this.searchInputValue, 'gi')
|
|
865
|
+
|
|
866
|
+
highlightedHtml = label.replace(
|
|
867
|
+
toReplace,
|
|
868
|
+
`<span style="background: var(--dl-color-warning)">${getCaseInsensitiveInput(
|
|
869
|
+
label,
|
|
870
|
+
this.searchInputValue
|
|
871
|
+
)}</span>`
|
|
872
|
+
)
|
|
873
|
+
}
|
|
874
|
+
|
|
863
875
|
const html = `<span>${highlightedHtml}</span>`
|
|
864
876
|
|
|
865
877
|
return html
|