@dataloop-ai/components 0.19.86 → 0.19.87
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
|
@@ -14,13 +14,30 @@
|
|
|
14
14
|
</dl-virtual-scroll>
|
|
15
15
|
</div>
|
|
16
16
|
<div
|
|
17
|
-
v-else
|
|
17
|
+
v-else-if="!items?.length"
|
|
18
18
|
ref="grid"
|
|
19
19
|
:style="gridStyles"
|
|
20
20
|
:class="gridClass"
|
|
21
21
|
>
|
|
22
22
|
<slot />
|
|
23
23
|
</div>
|
|
24
|
+
<div
|
|
25
|
+
v-else
|
|
26
|
+
ref="grid"
|
|
27
|
+
:style="gridStyles"
|
|
28
|
+
:class="gridClass"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
v-for="item in items"
|
|
32
|
+
:key="item.id"
|
|
33
|
+
class="item-wrapper"
|
|
34
|
+
>
|
|
35
|
+
<slot
|
|
36
|
+
name="item-slot"
|
|
37
|
+
v-bind="{ item }"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
24
41
|
</template>
|
|
25
42
|
|
|
26
43
|
<script lang="ts">
|
|
@@ -78,6 +95,14 @@ export default defineComponent({
|
|
|
78
95
|
scrollDebounce: {
|
|
79
96
|
type: Number,
|
|
80
97
|
default: 100
|
|
98
|
+
},
|
|
99
|
+
virtualScroll: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: false
|
|
102
|
+
},
|
|
103
|
+
virtualScrollThreshold: {
|
|
104
|
+
type: Number,
|
|
105
|
+
default: 100
|
|
81
106
|
}
|
|
82
107
|
},
|
|
83
108
|
emits: ['update:model-value', 'layout-changed'],
|
|
@@ -97,7 +122,11 @@ export default defineComponent({
|
|
|
97
122
|
: 'dl-grid-wrapper__flex'
|
|
98
123
|
)
|
|
99
124
|
|
|
100
|
-
const hasVirtualScroll = computed(
|
|
125
|
+
const hasVirtualScroll = computed(
|
|
126
|
+
() =>
|
|
127
|
+
props.items?.length > props.virtualScrollThreshold &&
|
|
128
|
+
props.virtualScroll
|
|
129
|
+
)
|
|
101
130
|
|
|
102
131
|
const gridStyles = computed(() => {
|
|
103
132
|
const gridStyles: Dictionary<string | number> = {
|