From a5826311ca4742fd27693b3dc81345ee812f3355 Mon Sep 17 00:00:00 2001 From: Max Ehrlicher-Schmidt Date: Sun, 13 Dec 2020 20:34:23 +0100 Subject: [PATCH] Improve idle style of table --- src/app/components/table/table.component.html | 21 ++++++++++++------- src/app/components/table/table.component.scss | 13 ++++++++++-- src/app/components/table/table.component.ts | 7 ++++--- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/app/components/table/table.component.html b/src/app/components/table/table.component.html index 198450b..7f67d27 100644 --- a/src/app/components/table/table.component.html +++ b/src/app/components/table/table.component.html @@ -63,6 +63,8 @@ showFirstLastButtons > + +
@@ -361,14 +364,16 @@ *matHeaderRowDef="displayedColumns; sticky: true" #headerRow > - +
- - - -
+ diff --git a/src/app/components/table/table.component.scss b/src/app/components/table/table.component.scss index bb4a060..c208199 100644 --- a/src/app/components/table/table.component.scss +++ b/src/app/components/table/table.component.scss @@ -26,8 +26,17 @@ margin-right: 0.5em; } } + .idle-overlay { + filter: blur(5px); + } + .idle-spinner { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 999; + } .table-container { - flex: 1; width: auto; margin-left: 0.5em; margin-right: 0.5em; @@ -69,4 +78,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/app/components/table/table.component.ts b/src/app/components/table/table.component.ts index 9cb7dd7..214dccb 100644 --- a/src/app/components/table/table.component.ts +++ b/src/app/components/table/table.component.ts @@ -92,6 +92,7 @@ export class TableComponent implements AfterViewInit { filterChanged: Subject = new Subject(); isLoaded = false; + isProcessing = false; @Output() createEvent = new EventEmitter(); @Output() lockEvent = new EventEmitter(); @@ -151,11 +152,11 @@ export class TableComponent implements AfterViewInit { }); this.dataService.tableData.subscribe((newTableDataSource) => { - this.reloadingTable = false; const tempDataSource = []; if (newTableDataSource === null) { return; } + this.reloadingTable = false; this.isLoaded = true; for (const row of newTableDataSource) { const oldRow = this.getRowById(row.id); @@ -427,10 +428,10 @@ export class TableComponent implements AfterViewInit { } applyFilters(): void { - this.isLoaded = false; + this.isProcessing = true; setTimeout(() => { this.data.filter = (this.filters as unknown) as string; - this.isLoaded = true; + this.isProcessing = false; }); }