@dataloop-ai/components 0.18.82 → 0.18.84

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.18.82",
3
+ "version": "0.18.84",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -424,7 +424,10 @@ export default defineComponent({
424
424
  if (val) {
425
425
  const aliased = fromJSON(val)
426
426
 
427
- if (aliased !== searchQuery.value.trim()) {
427
+ if (
428
+ aliased !== searchQuery.value.trim() ||
429
+ !input.value?.innerHTML.length
430
+ ) {
428
431
  debouncedSetInputFromModel(aliased)
429
432
  }
430
433
  }
@@ -593,10 +593,7 @@ import {
593
593
  import DlTr from './components/DlTr.vue'
594
594
  import DlTh from './components/DlTh.vue'
595
595
  import DlTd from './components/DlTd.vue'
596
- import {
597
- commonVirtPropsList,
598
- ScrollDetails
599
- } from '../../shared/DlVirtualScroll/useVirtualScroll'
596
+ import { commonVirtPropsList } from '../../shared/DlVirtualScroll/useVirtualScroll'
600
597
  import DlVirtualScroll from '../../shared/DlVirtualScroll/DlVirtualScroll.vue'
601
598
  import { useTableFilter } from './hooks/tableFilter'
602
599
  import { useTableSort } from './hooks/tableSort'
@@ -625,6 +622,7 @@ import DlEmptyState from '../../basic/DlEmptyState/DlEmptyState.vue'
625
622
  import { v4 } from 'uuid'
626
623
  import { flatTreeData } from '../DlTreeTable/utils/flatTreeData'
627
624
  import { stopAndPrevent } from '../../../utils'
625
+ import { DlVirtualScrollEvent } from '../../types'
628
626
 
629
627
  const commonVirtPropsObj = {} as Record<string, any>
630
628
  commonVirtPropsList.forEach((p) => {
@@ -658,12 +656,15 @@ export default defineComponent({
658
656
  tableHeaderStyle,
659
657
  tableHeaderClass,
660
658
  dense,
661
- draggable
659
+ draggable,
660
+ virtualScroll
662
661
  } = toRefs(props)
663
662
 
664
663
  const rootRef = ref<HTMLDivElement>(null)
665
664
  const virtScrollRef = ref(null)
666
- const hasVirtScroll = computed(() => props.virtualScroll === true)
665
+ const hasVirtScroll = computed<boolean>(
666
+ () => virtualScroll.value === true
667
+ )
667
668
 
668
669
  const groupOptions = computed(() =>
669
670
  (props.columns as DlTableColumn[]).map((item) => ({
@@ -1174,7 +1175,7 @@ export default defineComponent({
1174
1175
  }
1175
1176
  }
1176
1177
 
1177
- function onVScroll(info: ScrollDetails) {
1178
+ function onVScroll(info: DlVirtualScrollEvent) {
1178
1179
  emit('virtual-scroll', info)
1179
1180
  }
1180
1181
 
@@ -236,7 +236,6 @@ export default defineComponent({
236
236
  setup(props, { emit, slots }) {
237
237
  const dlTableRef = ref(null)
238
238
  const selectedData = ref([])
239
- const vScroll = ref(false)
240
239
  const borderState = ref([])
241
240
  const denseState = ref([])
242
241
  const resizableState = ref([])
@@ -381,7 +380,6 @@ export default defineComponent({
381
380
  dlTableRef,
382
381
  isRowSelected,
383
382
  hasFlatTreeData,
384
- vScroll,
385
383
  headerSelectedValue,
386
384
  selectedData,
387
385
  denseState,
@@ -79,7 +79,6 @@ export default defineComponent({
79
79
  required: false,
80
80
  default: false
81
81
  },
82
- onVirtualScroll: { type: Function, default: null },
83
82
  items: {
84
83
  type: Array,
85
84
  default: () => [] as Record<string, any>[]
@@ -1,4 +1,9 @@
1
1
  export * from './types'
2
2
 
3
- import { ScrollDetails as DlVirtualScrollScrollDetails } from './useVirtualScroll'
4
- export type { DlVirtualScrollScrollDetails }
3
+ export type DlVirtualScrollEvent = {
4
+ index: number
5
+ from: number
6
+ to: number
7
+ direction: 'decrease' | 'increase'
8
+ ref: any // A reference to the vue proxy component
9
+ }