@dataloop-ai/components 0.18.53 → 0.18.54

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.53",
3
+ "version": "0.18.54",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -550,7 +550,8 @@ import {
550
550
  getCurrentInstance,
551
551
  ComputedRef,
552
552
  onMounted,
553
- toRef
553
+ toRef,
554
+ toRefs
554
555
  } from 'vue-demi'
555
556
  import { props } from './utils/props'
556
557
  import { emits } from './utils/emits'
@@ -608,8 +609,16 @@ export default defineComponent({
608
609
  emits,
609
610
  setup(props, { emit, slots }) {
610
611
  const vm = getCurrentInstance()
611
-
612
- const rootRef = ref(null)
612
+ const {
613
+ tableStyle,
614
+ tableClass,
615
+ tableHeaderStyle,
616
+ tableHeaderClass,
617
+ dense,
618
+ draggable
619
+ } = toRefs(props)
620
+
621
+ const rootRef = ref<HTMLDivElement>(null)
613
622
  const virtScrollRef = ref(null)
614
623
  const hasVirtScroll = computed(() => props.virtualScroll === true)
615
624
 
@@ -691,10 +700,10 @@ export default defineComponent({
691
700
  })
692
701
 
693
702
  const hasDraggableRows = computed(() =>
694
- ['rows', 'both'].includes(props.draggable)
703
+ ['rows', 'both'].includes(draggable.value)
695
704
  )
696
705
  const hasDraggableColumns = computed(() =>
697
- ['columns', 'both'].includes(props.draggable)
706
+ ['columns', 'both'].includes(draggable.value)
698
707
  )
699
708
 
700
709
  let removeDraggableRows = () => {}
@@ -808,12 +817,13 @@ export default defineComponent({
808
817
  )
809
818
 
810
819
  watch(
811
- () =>
812
- (props.tableStyle as string) +
813
- props.tableClass +
814
- props.tableHeaderStyle +
815
- props.tableHeaderClass +
816
- __containerClass,
820
+ [
821
+ tableStyle,
822
+ tableClass,
823
+ tableHeaderStyle,
824
+ tableHeaderClass,
825
+ __containerClass
826
+ ],
817
827
  () => {
818
828
  if (
819
829
  hasVirtScroll.value === true &&
@@ -828,7 +838,7 @@ export default defineComponent({
828
838
  useTablePaginationState(vm, getCellValue)
829
839
 
830
840
  watch(
831
- [computedPagination, () => props.dense],
841
+ [computedPagination, dense],
832
842
  () => {
833
843
  if (tableEl && props.resizable && resizableManager) {
834
844
  const tableHeight = tableEl.offsetHeight || 0
@@ -1075,7 +1085,7 @@ export default defineComponent({
1075
1085
  toIndex = parseInt(toIndex as string, 10)
1076
1086
  const rowEl = rootRef.value.querySelector(
1077
1087
  `tbody tr:nth-of-type(${toIndex + 1})`
1078
- )
1088
+ ) as HTMLElement
1079
1089
 
1080
1090
  if (rowEl !== null) {
1081
1091
  const scrollTarget = rootRef.value.querySelector(