@dataloop-ai/components 0.19.156 → 0.19.158

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.19.156",
3
+ "version": "0.19.158",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -5,11 +5,7 @@
5
5
  class="dl-smart-search-input"
6
6
  >
7
7
  <div class="dl-smart-search-input__search-bar-wrapper">
8
- <div
9
- ref="searchBar"
10
- :class="searchBarClasses"
11
- @click="focus()"
12
- >
8
+ <div ref="searchBar" :class="searchBarClasses" @click="focus()">
13
9
  <div class="dl-smart-search-input__status-icon-wrapper">
14
10
  <dl-icon
15
11
  v-if="!focused && computedStatus"
@@ -274,7 +270,11 @@ export default defineComponent({
274
270
  // todo: these can be stale data. we need to update them on schema change.
275
271
  const { hasEllipsis } = useSizeObserver(input)
276
272
  const { suggestions, error, findSuggestions, checkErrors } =
277
- useSuggestions(schema, aliases, { strict, forbiddenKeys, omitSuggestions })
273
+ useSuggestions(schema, aliases, {
274
+ strict,
275
+ forbiddenKeys,
276
+ omitSuggestions
277
+ })
278
278
  //#endregion
279
279
 
280
280
  //#region methods
@@ -469,7 +469,9 @@ export default defineComponent({
469
469
  input.value.focus()
470
470
 
471
471
  focused.value = true
472
- showSuggestions.value = true
472
+ if (suggestions.value.length) {
473
+ showSuggestions.value = true
474
+ }
473
475
  emit('focus')
474
476
  }
475
477
 
@@ -495,7 +497,7 @@ export default defineComponent({
495
497
  }
496
498
 
497
499
  if (cancelBlur.value === 0) {
498
- if (showSuggestions.value && computedStatus.value.type !== 'error') {
500
+ if (showSuggestions.value) {
499
501
  focused.value = true
500
502
  return
501
503
  }
@@ -9,14 +9,8 @@
9
9
  :container-ref="containerRef"
10
10
  @scroll-to-top="onScrollToTop"
11
11
  />
12
- <slot
13
- name="content"
14
- :items="displayItems"
15
- >
16
- <div
17
- v-for="item in displayItems"
18
- :key="itemKey(item)"
19
- >
12
+ <slot name="content" :items="displayItems">
13
+ <div v-for="item in displayItems" :key="itemKey(item)">
20
14
  <slot :item="item" />
21
15
  </div>
22
16
  </slot>
@@ -160,6 +154,7 @@ export default defineComponent({
160
154
  items.value,
161
155
  pageSize.value
162
156
  )
157
+ onScrollToTop()
163
158
  },
164
159
  { immediate: true }
165
160
  )
@@ -1,4 +1,6 @@
1
1
  .dl-virtual-scroll {
2
+ scroll-behavior: auto !important;
3
+
2
4
  &:focus {
3
5
  outline: 0;
4
6
  }