EZQMS-529: Added support for grow and new align display options in Table (#4389)

Signed-off-by: Petr Vyazovetskiy <develop.pit@gmail.com>
This commit is contained in:
Pete Anøther
2024-01-19 22:32:53 +07:00
committed by GitHub
parent c0c17993cf
commit 85a68bebb9
3 changed files with 22 additions and 4 deletions
@@ -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}
<th
class:w-full={attribute.displayProps?.grow === true}
class:sortable={attribute.sortingKey}
class:sorted={attribute.sortingKey === _sortKey}
class:align-left={attribute.displayProps?.align === 'left'}
class:align-center={attribute.displayProps?.align === 'center'}
class:align-right={attribute.displayProps?.align === 'right'}
on:click={() => {
changeSorting(attribute.sortingKey)
}}
@@ -416,7 +419,11 @@
{/if}
{#if row < rowLimit}
{#each model as attribute, cell}
<td>
<td
class:align-left={attribute.displayProps?.align === 'left'}
class:align-center={attribute.displayProps?.align === 'center'}
class:align-right={attribute.displayProps?.align === 'right'}
>
<div class:antiTable-cells__firstCell={!cell}>
<!-- {getOnChange(object, attribute) !== undefined} -->
<svelte:component