|
|
|
@ -1120,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 |
|
|
|
@ -1226,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, |
|
|
|
@ -1265,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> |
|
|
|
@ -1793,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']" |
|
|
|
|