@dataloop-ai/components 0.18.81 → 0.18.83

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.81",
3
+ "version": "0.18.83",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -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,6 +1,6 @@
1
1
  import { ComputedRef } from 'vue-demi'
2
2
 
3
- export type VirtualScrollParamsType = {
3
+ export type DlVirtualScrollParamsType = {
4
4
  virtualScrollLength: ComputedRef<number>
5
5
  getVirtualScrollTarget: () => HTMLElement | undefined
6
6
  getVirtualScrollEl: () => HTMLElement
@@ -0,0 +1,9 @@
1
+ export * from './types'
2
+
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
+ }
@@ -15,7 +15,7 @@ import {
15
15
  Ref
16
16
  } from 'vue-demi'
17
17
  import { noop } from '../../../utils/events'
18
- import { VirtualScrollParamsType } from './types/VirtualScrollParamsType'
18
+ import { DlVirtualScrollParamsType } from './types/VirtualScrollParamsType'
19
19
 
20
20
  export interface ScrollDetails {
21
21
  scrollStart: number
@@ -282,7 +282,7 @@ export function useVirtualScroll({
282
282
  getVirtualScrollEl,
283
283
  virtualScrollItemSizeComputed, // optional
284
284
  debounceValue
285
- }: VirtualScrollParamsType) {
285
+ }: DlVirtualScrollParamsType) {
286
286
  const vm = getCurrentInstance()
287
287
 
288
288
  const { props, emit, proxy } = vm
@@ -5,3 +5,5 @@ export enum DlTextTransformOptions {
5
5
  LOWERCASE = 'lowercase',
6
6
  DEFAULT = 'default' // Default behavior is to make only the first letter of the sentence is capital
7
7
  }
8
+
9
+ export * from './DlVirtualScroll/types'
@@ -76,7 +76,7 @@
76
76
 
77
77
  <div>Text Card</div>
78
78
  <DlCard
79
- title="This is a long long long long long long text title wooo"
79
+ title="This-test--tes-tes-t-est-set-se-tse-t-est-set-se-ts-et-set-se-ts-et-set-tse-tse-tes-t"
80
80
  text="sdaljfaldksfj;asdjfal;ksdf;ajksd;faj;lskdf;alkjsdflk;ajsd;lfjas;ldjfa;ldsjfals;dj"
81
81
  :links="interactiveProps.links"
82
82
  />