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