]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts
LP#1819179: Angular value formatter gets link smarts
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / share / grid / grid-column-width.component.ts
1 import {Component, Input, OnInit, Host} from '@angular/core';
2 import {GridContext, GridColumn, GridColumnSet,
3     GridDataSource} from './grid';
4
5 @Component({
6   selector: 'eg-grid-column-width',
7   templateUrl: './grid-column-width.component.html'
8 })
9
10 export class GridColumnWidthComponent implements OnInit {
11
12     @Input() gridContext: GridContext;
13     columnSet: GridColumnSet;
14     isVisible: boolean;
15
16     constructor() {}
17
18     ngOnInit() {
19         this.isVisible = false;
20         this.columnSet = this.gridContext.columnSet;
21     }
22
23     expandColumn(col: GridColumn) {
24         col.flex++;
25     }
26
27     shrinkColumn(col: GridColumn) {
28         if (col.flex > 1) { col.flex--; }
29     }
30
31 }
32