From 9ad9367411bb008ee0be1e877463ace30d4842eb Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Tue, 12 Nov 2024 08:02:27 +0000 Subject: [PATCH] fix: expanded-row fixes --- .../nc-gui/components/smartsheet/Gallery.vue | 6 +++++ .../nc-gui/composables/useGalleryViewData.ts | 27 ++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Gallery.vue b/packages/nc-gui/components/smartsheet/Gallery.vue index 01d72219a6..4fb76ea729 100644 --- a/packages/nc-gui/components/smartsheet/Gallery.vue +++ b/packages/nc-gui/components/smartsheet/Gallery.vue @@ -38,6 +38,8 @@ const { chunkStates, cachedRows, totalRows, + isFirstRow, + isLastRow, clearCache, viewData: galleryData, } = useGalleryViewData(meta, view, xWhere) @@ -541,6 +543,8 @@ reloadViewDataHook?.on(async () => { v-model="expandedFormDlg" :row="expandedFormRow" :load-row="!isPublic" + :first-row="isFirstRow" + :last-row="isLastRow" :state="expandedFormRowState" :meta="meta" :view="view" @@ -554,6 +558,8 @@ reloadViewDataHook?.on(async () => { :meta="meta" :load-row="!isPublic" :row-id="route.query.rowId" + :first-row="isFirstRow" + :last-row="isLastRow" :view="view" show-next-prev-icons :expand-form="expandForm" diff --git a/packages/nc-gui/composables/useGalleryViewData.ts b/packages/nc-gui/composables/useGalleryViewData.ts index b5c74b699f..5a5ab85f0b 100644 --- a/packages/nc-gui/composables/useGalleryViewData.ts +++ b/packages/nc-gui/composables/useGalleryViewData.ts @@ -21,13 +21,24 @@ export function useGalleryViewData( const viewData = ref() - const { cachedRows, syncCount, clearCache, deleteRow, loadData, navigateToSiblingRow, totalRows, fetchChunk, chunkStates } = - useInfiniteData({ - meta, - viewMeta, - callbacks: {}, - where, - }) + const { + cachedRows, + syncCount, + clearCache, + deleteRow, + loadData, + navigateToSiblingRow, + totalRows, + fetchChunk, + chunkStates, + isFirstRow, + isLastRow, + } = useInfiniteData({ + meta, + viewMeta, + callbacks: {}, + where, + }) async function loadGalleryData() { if (!viewMeta?.value?.id) return @@ -46,5 +57,7 @@ export function useGalleryViewData( chunkStates, syncCount, fetchChunk, + isFirstRow, + isLastRow, } }