From 85a68bebb9ba3ec4883b24884e31bb889f3ce6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pete=20An=C3=B8ther?= Date: Fri, 19 Jan 2024 12:32:53 -0300 Subject: [PATCH] EZQMS-529: Added support for `grow` and new `align` display options in `Table` (#4389) Signed-off-by: Petr Vyazovetskiy --- packages/theme/styles/components.scss | 12 +++++++++++- plugins/view-resources/src/components/Table.svelte | 13 ++++++++++--- plugins/view/src/index.ts | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/theme/styles/components.scss b/packages/theme/styles/components.scss index 1937dada3c..5efd187f30 100644 --- a/packages/theme/styles/components.scss +++ b/packages/theme/styles/components.scss @@ -877,7 +877,7 @@ font-size: 0.75rem; } .label { - margin-bottom: 0rem; + margin-bottom: 0; } } } @@ -915,6 +915,16 @@ } &:hover .antiTable-cells__checkCell { visibility: visible; } .checkall { visibility: visible; } + + &.align-left .antiTable-cells { justify-content: start; } + &.align-center .antiTable-cells { justify-content: center; } + &.align-right .antiTable-cells { justify-content: end; } + } + + td { + &.align-left { text-align: left; } + &.align-center { text-align: center; } + &.align-right { text-align: right; } } &.editable { diff --git a/plugins/view-resources/src/components/Table.svelte b/plugins/view-resources/src/components/Table.svelte index 53209e578c..4b524203c9 100644 --- a/plugins/view-resources/src/components/Table.svelte +++ b/plugins/view-resources/src/components/Table.svelte @@ -80,6 +80,7 @@ $: lookup = buildConfigLookup(hierarchy, _class, config, options?.lookup) let _sortKey = prefferedSorting + let userSorting = false $: if (!userSorting) { _sortKey = prefferedSorting } @@ -87,8 +88,6 @@ let sortOrder = SortingOrder.Descending let loading = 0 - let userSorting = false - let objects: Doc[] = [] let gtotal: number = 0 let total: number = 0 @@ -339,8 +338,12 @@ {/if} {#each model as attribute} { changeSorting(attribute.sortingKey) }} @@ -416,7 +419,11 @@ {/if} {#if row < rowLimit} {#each model as attribute, cell} - +