Add transitions to data UI tables to improve smoothness and prevent stuttering and flashing on loading

This commit is contained in:
Andrew Kingston 2021-09-29 10:33:55 +01:00
parent 4a827c2aab
commit 873ef99527
2 changed files with 33 additions and 26 deletions

View File

@ -1,4 +1,5 @@
<script> <script>
import { fade } from "svelte/transition"
import { tables } from "stores/backend" import { tables } from "stores/backend"
import CreateRowButton from "./buttons/CreateRowButton.svelte" import CreateRowButton from "./buttons/CreateRowButton.svelte"
import CreateColumnButton from "./buttons/CreateColumnButton.svelte" import CreateColumnButton from "./buttons/CreateColumnButton.svelte"
@ -88,6 +89,8 @@
{/key} {/key}
{/if} {/if}
</Table> </Table>
{#key id}
<div in:fade={{ delay: 200, duration: 100 }}>
<div class="pagination"> <div class="pagination">
<Pagination <Pagination
page={$search.pageNumber + 1} page={$search.pageNumber + 1}
@ -97,6 +100,8 @@
goToNextPage={$search.loading ? null : search.nextPage} goToNextPage={$search.loading ? null : search.nextPage}
/> />
</div> </div>
</div>
{/key}
</div> </div>
<style> <style>

View File

@ -118,6 +118,7 @@
</div> </div>
</div> </div>
{#key tableId} {#key tableId}
<div in:fade={{ delay: 200, duration: 100 }}>
<Table <Table
{data} {data}
{schema} {schema}
@ -135,6 +136,7 @@
on:clickrelationship={e => selectRelationship(e.detail)} on:clickrelationship={e => selectRelationship(e.detail)}
on:sort on:sort
/> />
</div>
{/key} {/key}
</Layout> </Layout>