Fix table footer (#2619)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-02-11 23:17:17 +06:00 committed by GitHub
parent f7e495b609
commit 65aac9b44f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,7 @@
IconUp,
Label,
Loading,
resizeObserver,
showPopup,
Spinner
} from '@hcengineering/ui'
@ -211,12 +212,22 @@
const key = attribute.castRequest ? attribute.key.substring(attribute.castRequest.length + 1) : attribute.key
return (value: any) => onChange(value, doc, key, attr)
}
let width: number
</script>
{#await buildModel({ client, _class, keys: config, lookup })}
<Loading />
{:then model}
<table id={tableId} class="antiTable" class:metaColumn={enableChecking || showNotification} class:highlightRows>
<table
id={tableId}
use:resizeObserver={(element) => {
width = element.clientWidth
}}
class="antiTable"
class:metaColumn={enableChecking || showNotification}
class:highlightRows
>
{#if !hiddenHeader}
<thead class="scroller-thead">
<tr class="scroller-thead__tr">
@ -350,7 +361,8 @@
{#if loading > 0}<Loading />{/if}
{/await}
{#if showFooter && total}
<div class="footer">
<div class="space" />
<div class="footer" style="width: {width}px;">
<div class="content" class:padding={showNotification || enableChecking}>
<Label label={view.string.Total} />: {total}
{#if objects.length > 0 && objects.length < total}
@ -361,12 +373,17 @@
{/if}
<style lang="scss">
.space {
flex-grow: 1;
height: 100%;
}
.footer {
width: 100%;
background-color: var(--body-color);
display: flex;
align-items: flex-end;
height: 100%;
height: 2.5rem;
z-index: 2;
position: sticky;
bottom: 0;