@dataloop-ai/components 0.19.85 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.19.85",
3
+ "version": "0.19.87",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -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(() => !!props.items)
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> = {
@@ -46,5 +46,6 @@ export default defineComponent({
46
46
  height: 100%;
47
47
  min-width: min-content;
48
48
  overflow-y: scroll;
49
+ align-items: center;
49
50
  }
50
51
  </style>
@@ -1114,7 +1114,7 @@ export default defineComponent({
1114
1114
  */
1115
1115
  selectedRowsLabel: {
1116
1116
  type: Function,
1117
- default: (val: number) => `${val} records selected`
1117
+ default: (val: number) => null
1118
1118
  },
1119
1119
  /**
1120
1120
  * Label visible when loading is active
@@ -276,7 +276,6 @@
276
276
  line-height: 14px;
277
277
 
278
278
  .dl-table__control {
279
- width: 100%;
280
279
  min-height: 24px;
281
280
  }
282
281
  }