From 9f92ee2d0b42ac5f778a58505e7c58cffbdceaed Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Feb 2022 13:08:18 +0000 Subject: [PATCH] Add compact setting to table --- .../bbui/src/Table/AttachmentRenderer.svelte | 15 +++++++---- packages/bbui/src/Table/Table.svelte | 27 ++++++++++++++----- packages/client/manifest.json | 5 ++++ .../src/components/app/table/Table.svelte | 2 ++ 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/packages/bbui/src/Table/AttachmentRenderer.svelte b/packages/bbui/src/Table/AttachmentRenderer.svelte index 797ca93695..97ce1394cc 100644 --- a/packages/bbui/src/Table/AttachmentRenderer.svelte +++ b/packages/bbui/src/Table/AttachmentRenderer.svelte @@ -17,14 +17,16 @@ {#each attachments as attachment} {#if isImage(attachment.extension)} - {attachment.extension} +
+ {attachment.extension} +
{:else}
- {attachment.extension} + + {attachment.extension} +
{/if} @@ -38,12 +40,15 @@ height: 32px; max-width: 64px; } + .center, .file { - height: 32px; display: flex; flex-direction: row; justify-content: flex-start; align-items: center; + } + .file { + height: 32px; padding: 0 8px; color: var(--spectrum-global-color-gray-800); border: 1px solid var(--spectrum-global-color-gray-300); diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 90e3babdde..c23c226185 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -29,12 +29,12 @@ export let customRenderers = [] export let disableSorting = false export let autoSortColumns = true + export let compact = false const dispatch = createEventDispatcher() - rowCount = 8 // Config - const rowHeight = 55 + $: rowHeight = compact ? 46 : 55 const headerHeight = 36 const rowPreload = 5 @@ -238,6 +238,7 @@
@@ -251,7 +252,7 @@ > {#if fields.length} {#if showEditColumn} -
+
{editColumnTitle || ""}
{/if} @@ -306,9 +307,7 @@ > {#if idx >= firstVisibleRow && idx <= lastVisibleRow} {#if showEditColumn} -
+