diff --git a/packages/nc-gui/components/smartsheet/grid/Table.vue b/packages/nc-gui/components/smartsheet/grid/Table.vue index 9f7bc8073f..8e4cc1a313 100644 --- a/packages/nc-gui/components/smartsheet/grid/Table.vue +++ b/packages/nc-gui/components/smartsheet/grid/Table.vue @@ -3,6 +3,8 @@ import axios from 'axios' import { nextTick } from '@vue/runtime-core' import type { ColumnReqType, ColumnType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' import { UITypes, ViewTypes, isLinksOrLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk' +import { useColumnDrag } from './useColumnDrag' +import type { CellRange, Row } from '#imports' import { ActiveViewInj, CellUrlDisableOverlayInj, @@ -39,7 +41,6 @@ import { useViewsStore, watch, } from '#imports' -import type { CellRange, Row } from '#imports' const props = defineProps<{ data: Row[] @@ -179,6 +180,11 @@ const { isUIAllowed } = useRoles() const hasEditPermission = computed(() => isUIAllowed('dataEdit')) const isAddingColumnAllowed = computed(() => !readOnly.value && !isLocked.value && isUIAllowed('fieldAdd') && !isSqlView.value) +const { onDrag, onDragStart, draggedCol, dragColPlaceholderDomRef, toBeDroppedColId } = useColumnDrag({ + fields, + tableBodyEl, +}) + // #Variables const addColumnDropdown = ref(false) @@ -1199,8 +1205,27 @@ const loaderText = computed(() => {