@dataloop-ai/components 0.17.106 → 0.17.107

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.17.106",
3
+ "version": "0.17.107",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -281,13 +281,10 @@
281
281
  name="option"
282
282
  />
283
283
  <template v-else>
284
- {{
285
- capitalizedOptions
286
- ? typeof getOptionLabel(option) ===
287
- 'string' &&
288
- getOptionLabel(option).toLowerCase()
289
- : getOptionLabel(option)
290
- }}
284
+ <span
285
+ class="inner-option"
286
+ v-html="getOptionHtml(option)"
287
+ />
291
288
  </template>
292
289
  </dl-select-option>
293
290
  <dl-list-item v-if="hasAfterOptions && !noOptions">
@@ -418,6 +415,7 @@ export default defineComponent({
418
415
  const selectedIndex = ref(-1)
419
416
  const highlightedIndex = ref(-1)
420
417
  const isEmpty = ref(true)
418
+ const searchInputValue = ref('')
421
419
  const MAX_ITEMS_PER_LIST = 100 // HARDCODED - max items per list before virtual scroll
422
420
 
423
421
  const setHighlightedIndex = (value: any) => {
@@ -446,7 +444,8 @@ export default defineComponent({
446
444
  selectedIndex,
447
445
  setHighlightedIndex,
448
446
  handleSelectedItem,
449
- handleModelValueUpdate
447
+ handleModelValueUpdate,
448
+ searchInputValue
450
449
  }
451
450
  },
452
451
  computed: {
@@ -817,7 +816,19 @@ export default defineComponent({
817
816
  (this.$refs.menu as any)?.updatePosition()
818
817
  })
819
818
  }
820
- this.$emit('search-input', (e.target as HTMLInputElement).value)
819
+ const searchValue = (e.target as HTMLInputElement).value
820
+ this.searchInputValue = searchValue
821
+ this.$emit('search-input', searchValue)
822
+ },
823
+ getOptionHtml(option: DlSelectOptionType) {
824
+ return `<span>${(this.capitalizedOptions
825
+ ? typeof this.getOptionLabel(option) === 'string' &&
826
+ this.getOptionLabel(option).toLowerCase()
827
+ : this.getOptionLabel(option)
828
+ ).replace(
829
+ this.searchInputValue,
830
+ `<span style="background: var(--dl-color-warning)">${this.searchInputValue}</span>`
831
+ )}</span>`
821
832
  },
822
833
  handleSearchBlur(e: Event): void {
823
834
  if (this.search) {