From 41f6bcdaa154bd2d21a65b26455802cdbafe5dc1 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 26 Apr 2024 18:25:26 +0200 Subject: [PATCH] fix: make configurable footer for aggrid in apps --- .../table/AppAggridExplorerTable.svelte | 42 ++--- .../display/table/AppAggridTable.svelte | 163 +++++++++--------- .../apps/editor/component/components.ts | 12 ++ 3 files changed, 117 insertions(+), 100 deletions(-) diff --git a/frontend/src/lib/components/apps/components/display/table/AppAggridExplorerTable.svelte b/frontend/src/lib/components/apps/components/display/table/AppAggridExplorerTable.svelte index 4f5ca04b0d..30eecfe98e 100644 --- a/frontend/src/lib/components/apps/components/display/table/AppAggridExplorerTable.svelte +++ b/frontend/src/lib/components/apps/components/display/table/AppAggridExplorerTable.svelte @@ -424,27 +424,29 @@ >
-
-
- - Download -
+ {#if datasource?.rowCount} + {firstRow}{'->'}{lastRow + 1} of {datasource?.rowCount} rows + {:else} + {firstRow}{'->'}{lastRow + 1} + {/if}
- {#if datasource?.rowCount} - {firstRow}{'->'}{lastRow + 1} of {datasource?.rowCount} rows - {:else} - {firstRow}{'->'}{lastRow + 1} - {/if} - + {/if} {:else if resolvedConfig.columnDefs != undefined} diff --git a/frontend/src/lib/components/apps/components/display/table/AppAggridTable.svelte b/frontend/src/lib/components/apps/components/display/table/AppAggridTable.svelte index 2b1ad9ee2d..b3667d1dac 100644 --- a/frontend/src/lib/components/apps/components/display/table/AppAggridTable.svelte +++ b/frontend/src/lib/components/apps/components/display/table/AppAggridTable.svelte @@ -478,88 +478,91 @@ {/if} {/key} -
-
- - Download -
-
- {#if resolvedConfig?.pagination} - {#key refreshCount} -
- {(api?.paginationGetPageSize() ?? 0) * (api?.paginationGetCurrentPage() ?? 0) + 1} - to {Math.min( - api?.paginationGetRowCount() ?? 0, - ((api?.paginationGetCurrentPage() ?? 0) + 1) * - (api?.paginationGetPageSize() ?? 0) - )} - of {api?.paginationGetRowCount()} -
+ {#if resolvedConfig.footer} +
+
+ + Download +
+
+ {#if resolvedConfig?.pagination} + {#key refreshCount} +
+ {(api?.paginationGetPageSize() ?? 0) * (api?.paginationGetCurrentPage() ?? 0) + + 1} + to {Math.min( + api?.paginationGetRowCount() ?? 0, + ((api?.paginationGetCurrentPage() ?? 0) + 1) * + (api?.paginationGetPageSize() ?? 0) + )} + of {api?.paginationGetRowCount()} +
-
-
+ {/if}
{:else if resolvedConfig.columnDefs != undefined} diff --git a/frontend/src/lib/components/apps/editor/component/components.ts b/frontend/src/lib/components/apps/editor/component/components.ts index 8e1dffe5ae..94232d16f4 100644 --- a/frontend/src/lib/components/apps/editor/component/components.ts +++ b/frontend/src/lib/components/apps/editor/component/components.ts @@ -702,6 +702,12 @@ const aggridcomponentconst = { value: false, tooltip: 'When true, actions will wrap to the next line. Otherwise, the column will grow to fit the actions.' + }, + footer: { + type: 'static', + fieldType: 'boolean', + value: true, + tooltip: 'Allow visible footer for pagination and download' } }, componentInput: { @@ -803,6 +809,12 @@ const aggridinfinitecomponentconst = { fieldType: 'boolean', value: false, tooltip: 'Enable search in the table' + }, + footer: { + type: 'static', + fieldType: 'boolean', + value: true, + tooltip: 'Allow visible footer for pagination and download' } }, componentInput: {