From a24f26642b95ab6878a758f9db8e95fe6e6da003 Mon Sep 17 00:00:00 2001 From: kj1352 Date: Wed, 24 Nov 2021 16:20:28 +0530 Subject: [PATCH] Table component --- src/app/app.module.ts | 8 ++- .../download-button.component.html | 1 + .../download-button.component.scss | 0 .../download-button.component.spec.ts | 25 ++++++++++ .../download-button.component.ts | 15 ++++++ src/app/e-services/e-services.component.html | 8 ++- .../key-value-holder.component.html | 1 + .../key-value-holder.component.scss | 0 .../key-value-holder.component.spec.ts | 25 ++++++++++ .../key-value-holder.component.ts | 15 ++++++ src/app/table/table.component.html | 15 ++++++ src/app/table/table.component.scss | 50 +++++++++++++++++++ src/app/table/table.component.spec.ts | 25 ++++++++++ src/app/table/table.component.ts | 18 +++++++ 14 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 src/app/download-button/download-button.component.html create mode 100644 src/app/download-button/download-button.component.scss create mode 100644 src/app/download-button/download-button.component.spec.ts create mode 100644 src/app/download-button/download-button.component.ts create mode 100644 src/app/key-value-holder/key-value-holder.component.html create mode 100644 src/app/key-value-holder/key-value-holder.component.scss create mode 100644 src/app/key-value-holder/key-value-holder.component.spec.ts create mode 100644 src/app/key-value-holder/key-value-holder.component.ts create mode 100644 src/app/table/table.component.html create mode 100644 src/app/table/table.component.scss create mode 100644 src/app/table/table.component.spec.ts create mode 100644 src/app/table/table.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 1d4b651..176adc0 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -12,6 +12,9 @@ import { EServicesComponent } from './e-services/e-services.component'; import { NotificationsComponent } from './notifications/notifications.component'; import { CreateCommitteeComponent } from './create-committee/create-committee.component'; import { CheckStatusComponent } from './check-status/check-status.component'; +import { TableComponent } from './table/table.component'; +import { KeyValueHolderComponent } from './key-value-holder/key-value-holder.component'; +import { DownloadButtonComponent } from './download-button/download-button.component'; @NgModule({ declarations: [ @@ -23,7 +26,10 @@ import { CheckStatusComponent } from './check-status/check-status.component'; EServicesComponent, NotificationsComponent, CreateCommitteeComponent, - CheckStatusComponent + CheckStatusComponent, + TableComponent, + KeyValueHolderComponent, + DownloadButtonComponent ], imports: [ BrowserModule, diff --git a/src/app/download-button/download-button.component.html b/src/app/download-button/download-button.component.html new file mode 100644 index 0000000..f24c6ea --- /dev/null +++ b/src/app/download-button/download-button.component.html @@ -0,0 +1 @@ +

download-button works!

diff --git a/src/app/download-button/download-button.component.scss b/src/app/download-button/download-button.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/download-button/download-button.component.spec.ts b/src/app/download-button/download-button.component.spec.ts new file mode 100644 index 0000000..635c59f --- /dev/null +++ b/src/app/download-button/download-button.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DownloadButtonComponent } from './download-button.component'; + +describe('DownloadButtonComponent', () => { + let component: DownloadButtonComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DownloadButtonComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DownloadButtonComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/download-button/download-button.component.ts b/src/app/download-button/download-button.component.ts new file mode 100644 index 0000000..1d5ad84 --- /dev/null +++ b/src/app/download-button/download-button.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-download-button', + templateUrl: './download-button.component.html', + styleUrls: ['./download-button.component.scss'] +}) +export class DownloadButtonComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/e-services/e-services.component.html b/src/app/e-services/e-services.component.html index d8a55c2..5a4f256 100644 --- a/src/app/e-services/e-services.component.html +++ b/src/app/e-services/e-services.component.html @@ -55,4 +55,10 @@ - \ No newline at end of file + + +
+ +
\ No newline at end of file diff --git a/src/app/key-value-holder/key-value-holder.component.html b/src/app/key-value-holder/key-value-holder.component.html new file mode 100644 index 0000000..dddaf4e --- /dev/null +++ b/src/app/key-value-holder/key-value-holder.component.html @@ -0,0 +1 @@ +

key-value-holder works!

diff --git a/src/app/key-value-holder/key-value-holder.component.scss b/src/app/key-value-holder/key-value-holder.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/key-value-holder/key-value-holder.component.spec.ts b/src/app/key-value-holder/key-value-holder.component.spec.ts new file mode 100644 index 0000000..6e23036 --- /dev/null +++ b/src/app/key-value-holder/key-value-holder.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { KeyValueHolderComponent } from './key-value-holder.component'; + +describe('KeyValueHolderComponent', () => { + let component: KeyValueHolderComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ KeyValueHolderComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(KeyValueHolderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/key-value-holder/key-value-holder.component.ts b/src/app/key-value-holder/key-value-holder.component.ts new file mode 100644 index 0000000..9b7bea8 --- /dev/null +++ b/src/app/key-value-holder/key-value-holder.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-key-value-holder', + templateUrl: './key-value-holder.component.html', + styleUrls: ['./key-value-holder.component.scss'] +}) +export class KeyValueHolderComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/table/table.component.html b/src/app/table/table.component.html new file mode 100644 index 0000000..fca8856 --- /dev/null +++ b/src/app/table/table.component.html @@ -0,0 +1,15 @@ +
+
+
S/N
+
{{ heading }}
+
+ +
    +
  • +
    {{ i + 1 }}
    +
    +

    {{ detail }}

    +
    +
  • +
+
\ No newline at end of file diff --git a/src/app/table/table.component.scss b/src/app/table/table.component.scss new file mode 100644 index 0000000..7ea4164 --- /dev/null +++ b/src/app/table/table.component.scss @@ -0,0 +1,50 @@ +.table { + margin: 2rem auto; + width: 100%; + border-radius: 1rem; + overflow: auto; + border: 2px solid var(--border-grey); + min-height: 10rem; + + header { + background: linear-gradient(90deg, var(--secondary) 0%, var(--primary)); + color: white; + font-size: 1.6rem; + height: 5.5rem; + font-weight: 300; + letter-spacing: 0.5px; + + display: grid; + align-items: center; + text-align: center; + } + + .cell { + + @media print { + word-break: break-all; + } + } + + ul { + list-style: none; + } + + li { + padding: 2rem 0; + + display: grid; + align-items: center; + text-align: center; + + &:nth-child(even) { + background-color: var(--border-grey); + } + + .cell { + font-size: 1.4rem; + color: var(--dark-grey); + line-height: 1.7; + } + } +} \ No newline at end of file diff --git a/src/app/table/table.component.spec.ts b/src/app/table/table.component.spec.ts new file mode 100644 index 0000000..e2f8acc --- /dev/null +++ b/src/app/table/table.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TableComponent } from './table.component'; + +describe('TableComponent', () => { + let component: TableComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ TableComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(TableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/table/table.component.ts b/src/app/table/table.component.ts new file mode 100644 index 0000000..0dec62b --- /dev/null +++ b/src/app/table/table.component.ts @@ -0,0 +1,18 @@ +import { Component, Input, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-table', + templateUrl: './table.component.html', + styleUrls: ['./table.component.scss'] +}) +export class TableComponent implements OnInit { + @Input() headings: Array = []; + @Input() tableDetails: Array> = []; + + + constructor() { } + + ngOnInit(): void { + } + +}