LP2015137 Tab order for admin splash link tables
[evergreen-equinox.git] / Open-ILS / src / eg2 / src / app / staff / share / link-table / link-table.component.ts
1 import {Component, Input, OnInit, Host} from '@angular/core';
2
3 interface LinkTableLink {
4     label: string;
5     url?: string;
6     routerLink?: string;
7 }
8
9 @Component({
10     selector: 'eg-link-table',
11     templateUrl: './link-table.component.html',
12     styleUrls: ['link-table.component.css'],
13     styles: [
14     `
15       ul {
16         column-count: var(--columnCount);
17       }
18     `
19     ]
20 })
21
22 export class LinkTableComponent {
23     @Input() columnCount: number;
24     links: LinkTableLink[];
25
26     constructor() {
27         this.links = [];
28     }
29 }
30
31 @Component({
32     selector: 'eg-link-table-link',
33     template: '<ng-template></ng-template>'
34 })
35
36 export class LinkTableLinkComponent implements OnInit {
37     @Input() label: string;
38     @Input() url: string;
39     @Input() routerLink: string;
40
41     constructor(@Host() private linkTable: LinkTableComponent) {}
42
43     ngOnInit() {
44         this.linkTable.links.push({
45             label : this.label,
46             url: this.url,
47             routerLink: this.routerLink
48         });
49     }
50 }
51
52