-
Notifications
You must be signed in to change notification settings - Fork 11
feat: header functionality for the list view #806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
c5148b0
9c9b6b0
f1403f0
b02a5a7
d547d83
6e799a6
cd27f4f
add59cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,33 @@ | |
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| .header { | ||
| flex: 0 0 auto; | ||
| height: 32px; | ||
| width: 100%; | ||
| padding: 8px 0; | ||
| background: $gray-1; | ||
| box-shadow: inset 0px -1px 0px $gray-2; | ||
| border-radius: 6px 6px 0px 0px; | ||
| display: flex; | ||
| align-items: center; | ||
|
|
||
| .header-key { | ||
| flex: 1 1 auto; | ||
| font-weight: 600; | ||
|
||
| font-size: 12px; | ||
| line-height: 14px; | ||
| margin-left: 12px; | ||
| text-transform: uppercase; | ||
| } | ||
| .header-key:nth-child(1) { | ||
| width: 40%; | ||
|
||
| } | ||
| .header-key:nth-child(2) { | ||
| width: 60%; | ||
| } | ||
| } | ||
|
|
||
| .data-row { | ||
| flex: 0 0 auto; | ||
| min-height: 40px; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,11 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; | |
| changeDetection: ChangeDetectionStrategy.OnPush, | ||
| template: ` | ||
| <div class="list-view"> | ||
| <div *ngIf="this.headerKeys && this.headerKeys.length === 2" class="header"> | ||
|
||
| <div class="header-key" *ngFor="let headerKey of this.headerKeys"> | ||
| <span>{{ this.headerKey }}</span> | ||
| </div> | ||
| </div> | ||
| <div class="data-row" *ngFor="let record of this.records"> | ||
| <div class="key"> | ||
| <span>{{ record.key }}</span> | ||
|
|
@@ -18,6 +23,9 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; | |
| ` | ||
| }) | ||
| export class ListViewComponent { | ||
| @Input() | ||
| public headerKeys?: [string, string]; | ||
|
||
|
|
||
| @Input() | ||
| public records?: ListViewRecord[]; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flex: 0 0 auto;you probably don't need this if you are setting a fixed width/heightThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will check for it.