@dataloop-ai/components 0.19.88 → 0.19.90

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.88",
3
+ "version": "0.19.90",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -14,7 +14,7 @@
14
14
  </dl-virtual-scroll>
15
15
  </div>
16
16
  <div
17
- v-else-if="!items?.length"
17
+ v-else-if="!hasItems"
18
18
  ref="grid"
19
19
  :style="gridStyles"
20
20
  :class="gridClass"
@@ -109,8 +109,15 @@ export default defineComponent({
109
109
  setup(props, { emit }) {
110
110
  const vm = getCurrentInstance()
111
111
  const grid = ref<HTMLElement | null>(null)
112
- const { modelValue, mode, rowGap, columnGap, maxElementsPerRow } =
113
- toRefs(props)
112
+ const {
113
+ modelValue,
114
+ mode,
115
+ rowGap,
116
+ columnGap,
117
+ maxElementsPerRow,
118
+ items,
119
+ virtualScroll
120
+ } = toRefs(props)
114
121
 
115
122
  const isLayoutMode = computed(() => mode.value == DlGridMode.LAYOUT)
116
123
  const isGridMode = computed(() => mode.value == DlGridMode.GRID)
@@ -124,8 +131,8 @@ export default defineComponent({
124
131
 
125
132
  const hasVirtualScroll = computed(
126
133
  () =>
127
- props.items?.length > props.virtualScrollThreshold &&
128
- props.virtualScroll
134
+ items.value?.length > props.virtualScrollThreshold ||
135
+ virtualScroll.value
129
136
  )
130
137
 
131
138
  const gridStyles = computed(() => {
@@ -242,6 +249,8 @@ export default defineComponent({
242
249
  applyGridElementStyles()
243
250
  })
244
251
 
252
+ const hasItems = computed(() => !!items.value?.length)
253
+
245
254
  return {
246
255
  isLayoutMode,
247
256
  isGridMode,
@@ -249,7 +258,8 @@ export default defineComponent({
249
258
  gridClass,
250
259
  gridStyles,
251
260
  grid,
252
- hasVirtualScroll
261
+ hasVirtualScroll,
262
+ hasItems
253
263
  }
254
264
  }
255
265
  })