import { Node } from '../../node.js'

class ColContainerDirective extends Node {
  constructor (data) {
    super(data, 'div');
    this.attributes.addClass('fr-col-' + data.properties.col || 12);
    if (data.properties.colSm) this.attributes.addClass('fr-col-sm-' + data.properties.colSm);
    if (data.properties.colMd) this.attributes.addClass('fr-col-md-' + data.properties.colMd);
    if (data.properties.colLg) this.attributes.addClass('fr-col-lg-' + data.properties.colLg);
    if (data.properties.alignV) this.attributes.addClass('fr-col--' + data.properties.alignV);
    if (data.properties.offset) this.attributes.addClass('fr-col-offset-' + data.properties.offset);
    if (data.properties.offsetSm) this.attributes.addClass('fr-col-offset-sm-' + data.properties.offsetSm);
    if (data.properties.offsetMd) this.attributes.addClass('fr-col-offset-md-' + data.properties.offsetMd);
    if (data.properties.offsetLg) this.attributes.addClass('fr-col-offset-lg-' + data.properties.offsetLg);
  }
}

ColContainerDirective.NAME = 'fr-col';

export { ColContainerDirective };
