|
|
@ -20,6 +20,7 @@ import { |
|
|
|
useMetas, |
|
|
|
useMetas, |
|
|
|
useProvideKanbanViewStore, |
|
|
|
useProvideKanbanViewStore, |
|
|
|
useProvideSmartsheetStore, |
|
|
|
useProvideSmartsheetStore, |
|
|
|
|
|
|
|
useSidebar, |
|
|
|
useUIPermission, |
|
|
|
useUIPermission, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
import type { TabItem } from '~/lib' |
|
|
|
import type { TabItem } from '~/lib' |
|
|
@ -36,6 +37,8 @@ const activeTab = toRef(props, 'activeTab') |
|
|
|
|
|
|
|
|
|
|
|
const activeView = ref() |
|
|
|
const activeView = ref() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const fields = ref<ColumnType[]>([]) |
|
|
|
const fields = ref<ColumnType[]>([]) |
|
|
|
|
|
|
|
|
|
|
|
const meta = computed<TableType | undefined>(() => activeTab.value && metas.value[activeTab.value.id!]) |
|
|
|
const meta = computed<TableType | undefined>(() => activeTab.value && metas.value[activeTab.value.id!]) |
|
|
@ -65,6 +68,41 @@ provide( |
|
|
|
computed(() => !isUIAllowed('xcDatatableEditable')), |
|
|
|
computed(() => !isUIAllowed('xcDatatableEditable')), |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isOpen: isRightSidebarOpen, toggle: toggleRightSidebar } = useSidebar('nc-right-sidebar') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const rightSidebar = document.querySelector('.nc-right-sidebar') |
|
|
|
|
|
|
|
const rightSidebarToggleButton = document.querySelector('.nc-views-show-sidebar-button') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('click', (event: MouseEvent) => { |
|
|
|
|
|
|
|
// debugger |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('++++++++') |
|
|
|
|
|
|
|
console.log('event.target: ', event.target) |
|
|
|
|
|
|
|
console.log('rightSidebarToggleButton: ', rightSidebarToggleButton) |
|
|
|
|
|
|
|
console.log('isSameNode: ', rightSidebarToggleButton?.isSameNode(event.target as Node)) |
|
|
|
|
|
|
|
console.log('contains: ', rightSidebarToggleButton?.contains(event.target as Node)) |
|
|
|
|
|
|
|
console.log('--------') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sidebar.value. |
|
|
|
|
|
|
|
// event.stopPropagation() |
|
|
|
|
|
|
|
// event.preventDefault() |
|
|
|
|
|
|
|
// event.stopImmediatePropagation() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// alert(JSON.stringify(rightSidebarToggleButton?.contains(event.target as Node))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const sidebarFoo = sidebar.value |
|
|
|
|
|
|
|
// alert(JSON.stringify(sidebarFoo)) |
|
|
|
|
|
|
|
// if (isMobileMode.value && !sidebar.value?.contains(event.target as Node)) { |
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
isMobileMode.value && |
|
|
|
|
|
|
|
isRightSidebarOpen.value && |
|
|
|
|
|
|
|
!rightSidebar?.contains(event.target as Node) && |
|
|
|
|
|
|
|
!rightSidebarToggleButton?.contains(event.target as Node) |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
// alert(JSON.stringify(rightSidebarToggleButton?.innerHTML)) |
|
|
|
|
|
|
|
// toggleRightSidebar() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|