From 7a9f317ee1c69022dd05625ab88e1e8fc1dcba2e Mon Sep 17 00:00:00 2001 From: Jesse Lucas Date: Sat, 11 Apr 2020 22:50:42 -0400 Subject: [PATCH] enable expandable rows for devices list --- .../device-list/device-list.component.html | 35 ++++++++------- .../device-list/device-list.component.scss | 44 +++++++++++++++++-- .../device-list/device-list.component.ts | 13 +++++- .../folder-list/folder-list.component.scss | 10 ++--- .../folder-list/folder-list.component.ts | 8 +++- 5 files changed, 80 insertions(+), 30 deletions(-) diff --git a/src/app/lists/device-list/device-list.component.html b/src/app/lists/device-list/device-list.component.html index f831c6d45..822767592 100644 --- a/src/app/lists/device-list/device-list.component.html +++ b/src/app/lists/device-list/device-list.component.html @@ -2,27 +2,28 @@ Filter - - - - - +
Id{{row.deviceID}}
+ + + - - - - - - - - - - - + + - + + +
{{column}} {{device[column]}} Name{{row.name}}State{{row.state}} +
+
+ Folders: + {{folder.label | trim}} +
+
+
collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')), + ]), + ], }) export class DeviceListComponent implements AfterViewInit, OnInit, OnDestroy { @ViewChild(MatPaginator) paginator: MatPaginator; @@ -23,7 +31,8 @@ export class DeviceListComponent implements AfterViewInit, OnInit, OnDestroy { dataSource: MatTableDataSource; /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ - displayedColumns = ['id', 'name', 'state']; + displayedColumns = ['deviceID', 'name', 'state']; + expandedDevice: Device | null; constructor( private deviceService: DeviceService, diff --git a/src/app/lists/folder-list/folder-list.component.scss b/src/app/lists/folder-list/folder-list.component.scss index 658caf4a9..5521fe398 100644 --- a/src/app/lists/folder-list/folder-list.component.scss +++ b/src/app/lists/folder-list/folder-list.component.scss @@ -11,13 +11,15 @@ tr.detail-row { height: 0; } -tr.folder-row:not(.example-expanded-row):hover { +tr.folder-row:not(.expanded-row):hover { background: whitesmoke; } +/* tr.folder-row:not(.folder-row):active { background: #efefef; } +*/ .folder-row td { border-bottom-width: 0; @@ -32,15 +34,11 @@ tr.folder-row:not(.folder-row):active { padding-bottom: 16px; } -.device-name:not(:first-child) { - margin-left: -.3em; -} - // Hide empty name .device-name:empty { display: none; } -.device-name:not(:first-child):before { +.device-name:not(:last-child):after { content: ", "; } \ No newline at end of file diff --git a/src/app/lists/folder-list/folder-list.component.ts b/src/app/lists/folder-list/folder-list.component.ts index 0edab207f..a88f08c5a 100644 --- a/src/app/lists/folder-list/folder-list.component.ts +++ b/src/app/lists/folder-list/folder-list.component.ts @@ -31,7 +31,13 @@ export class FolderListComponent implements AfterViewInit, OnInit, OnDestroy { dataSource: MatTableDataSource; /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ - displayedColumns = ['id', 'label', 'path', 'state']; + displayedColumns = [ + "id", + "label", + "path", + "state" + ]; + expandedFolder: Folder | null; constructor(