import { Component, Input, OnInit, HostBinding, ViewEncapsulation } from '@angular/core';

@Component({
  selector: 'ui-kit-column',
  templateUrl: 'column.component.html',
  encapsulation: ViewEncapsulation.Emulated
})
export class ColumnComponent implements OnInit {
  @Input() size: number = 0;
  @Input() offset: number = 0;

  @HostBinding('class') class;

  private sizeClass: string;
  private offsetClass: string;

  ngOnInit() {
    this.sizeClass = this.size !== 0 ? `is-${this.size}` : '';
    this.offsetClass = this.offset !== 0 ? `is-offset-${this.offset}` : '';
    this.class = `column ${this.sizeClass} ${this.offsetClass}`;
  }
}
