|
|
|
@ -142,7 +142,12 @@ const { getMeta } = useMetas()
|
|
|
|
|
|
|
|
|
|
const { addUndo, clone, defineViewScope } = useUndoRedo() |
|
|
|
|
|
|
|
|
|
const { isViewColumnsLoading, updateGridViewColumn, gridViewCols, resizingColOldWith } = useViewColumnsOrThrow() |
|
|
|
|
const { |
|
|
|
|
isViewColumnsLoading: _isViewColumnsLoading, |
|
|
|
|
updateGridViewColumn, |
|
|
|
|
gridViewCols, |
|
|
|
|
resizingColOldWith, |
|
|
|
|
} = useViewColumnsOrThrow() |
|
|
|
|
|
|
|
|
|
const { isExpandedFormCommentMode } = storeToRefs(useConfigStore()) |
|
|
|
|
|
|
|
|
@ -179,6 +184,8 @@ const fillHandle = ref<HTMLElement>()
|
|
|
|
|
|
|
|
|
|
const gridRect = useElementBounding(gridWrapper) |
|
|
|
|
|
|
|
|
|
const isViewColumnsLoading = computed(() => _isViewColumnsLoading.value || !meta.value) |
|
|
|
|
|
|
|
|
|
// #Permissions |
|
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
|
const hasEditPermission = computed(() => isUIAllowed('dataEdit') && !isLocked.value) |
|
|
|
@ -409,7 +416,9 @@ const dummyRowDataForLoading = computed(() => {
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const showSkeleton = computed( |
|
|
|
|
() => disableSkeleton !== true && (isViewDataLoading.value || isPaginationLoading.value || isViewColumnsLoading.value), |
|
|
|
|
() => |
|
|
|
|
(disableSkeleton !== true && (isViewDataLoading.value || isPaginationLoading.value || isViewColumnsLoading.value)) || |
|
|
|
|
!meta.value, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// #Grid |
|
|
|
@ -1111,22 +1120,6 @@ onBeforeUnmount(async () => {
|
|
|
|
|
reloadViewDataHook?.on(reloadViewDataHandler) |
|
|
|
|
openNewRecordFormHook?.on(openNewRecordHandler) |
|
|
|
|
|
|
|
|
|
// TODO: Use CSS animations |
|
|
|
|
const showLoaderAfterDelay = ref(false) |
|
|
|
|
watch([isViewDataLoading, showSkeleton, isPaginationLoading], () => { |
|
|
|
|
if (!isViewDataLoading.value && !showSkeleton.value && !isPaginationLoading.value) { |
|
|
|
|
showLoaderAfterDelay.value = false |
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
showLoaderAfterDelay.value = false |
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
showLoaderAfterDelay.value = true |
|
|
|
|
}, 500) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// #Watchers |
|
|
|
|
|
|
|
|
|
// reset context menu target on hide |
|
|
|
@ -1217,7 +1210,7 @@ const handleCellClick = (event: MouseEvent, row: number, col: number) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const loaderText = computed(() => { |
|
|
|
|
if (isViewDataLoading.value) { |
|
|
|
|
if (isPaginationLoading.value) { |
|
|
|
|
if (paginationDataRef.value?.totalRows && paginationDataRef.value?.pageSize) { |
|
|
|
|
return `Loading page<br/>${paginationDataRef.value.page} of ${Math.ceil( |
|
|
|
|
paginationDataRef.value?.totalRows / paginationDataRef.value?.pageSize, |
|
|
|
@ -1256,10 +1249,7 @@ onKeyStroke('ArrowDown', onDown)
|
|
|
|
|
></div> |
|
|
|
|
</div> |
|
|
|
|
<div ref="gridWrapper" class="nc-grid-wrapper min-h-0 flex-1 relative" :class="gridWrapperClass"> |
|
|
|
|
<div |
|
|
|
|
v-show="showSkeleton && !isPaginationLoading && showLoaderAfterDelay" |
|
|
|
|
class="flex items-center justify-center absolute l-0 t-0 w-full h-full z-10 pb-10" |
|
|
|
|
> |
|
|
|
|
<div v-show="isPaginationLoading" class="flex items-center justify-center absolute l-0 t-0 w-full h-full z-10 pb-10"> |
|
|
|
|
<div class="flex flex-col justify-center gap-2"> |
|
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
|
<span class="text-center" v-html="loaderText"></span> |
|
|
|
@ -1784,7 +1774,7 @@ onKeyStroke('ArrowDown', onDown)
|
|
|
|
|
:extra-style="paginationStyleRef?.extraStyle" |
|
|
|
|
> |
|
|
|
|
<template #add-record> |
|
|
|
|
<div v-if="isAddingEmptyRowAllowed" class="flex ml-1"> |
|
|
|
|
<div v-if="isAddingEmptyRowAllowed && !showSkeleton && !isPaginationLoading" class="flex ml-1"> |
|
|
|
|
<NcButton |
|
|
|
|
v-if="isMobileMode" |
|
|
|
|
v-e="[isAddNewRecordGridMode ? 'c:row:add:grid' : 'c:row:add:form']" |
|
|
|
|