import { r as registerInstance, j as createEvent, h } from './index-07845439.js';
import { i as isDefined } from './model-fad5c7ae.js';
import './index-b6cf748e.js';
import './_commonjsHelpers-8fe71198.js';
import './index-e20749b7.js';
import './index-265fba1f.js';
import './index-63517df5.js';

const styleCss = ".sc-ig-table-row-h{display:table-row;height:2.5em}[hidden].sc-ig-table-row-h{display:none}.sc-ig-table-row-h:hover{-webkit-box-shadow:var(--smoothly-shadow);box-shadow:var(--smoothly-shadow);border-top:1px solid rgb(var(--smoothly-medium-color));border-bottom:1px solid rgb(var(--smoothly-medium-color))}.sc-ig-table-row-h>td.sc-ig-table-row{vertical-align:middle}.sc-ig-table-row-h>td.right.sc-ig-table-row{text-align:right;padding-right:5em}.sc-ig-table-row-h>td.sc-ig-table-row:not(.checkbox)>*.sc-ig-table-row{padding:.5em .3em;width:-webkit-max-content;width:-moz-max-content;width:max-content;min-width:3em;display:inline-block}.sc-ig-table-row-h>td.checkbox.sc-ig-table-row>*.sc-ig-table-row{padding:0em .3em}.sc-ig-table-row-h>td.sc-ig-table-row>.openable.sc-ig-table-row:hover{background-color:rgb(var(--smoothly-dark-shade));cursor:pointer}.opened.sc-ig-table-row{-webkit-box-sizing:border-box;box-sizing:border-box;border:solid 1px rgb(var(--smoothly-medium-shade));background-color:rgb(var(--smoothly-dark-shade));border-bottom:2.5px solid rgb(var(--smoothly-dark-shade));margin-bottom:-2.2px}.sc-ig-table-row-h>td.sc-ig-table-row:first-of-type>*.sc-ig-table-row{border-left:none}";

const IntergiroTableRow = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.columnClicked = createEvent(this, "columnClicked", 7);
    this.valueSelected = createEvent(this, "valueSelected", 7);
    this.opened = "";
    this.selected = false;
  }
  handleColumnClick(column) {
    this.opened = column;
    this.columnClicked.emit({ index: this.index, column });
  }
  handleSelected(event) {
    this.valueSelected.emit({ id: this.identifier, value: this.value, checked: event.detail.selected });
    event.stopPropagation();
  }
  render() {
    return [
      this.selectable && (h("td", { class: "checkbox" }, h("smoothly-checkbox", { selected: this.selected }))),
      this.row.filter(isDefined).map((v, index) => (h("td", { class: v.align == "right" ? "right" : "" }, h("section", { class: v.openable ? "openable" + (this.opened == index.toString() ? " opened" : "") : "", onClick: () => v.openable && this.handleColumnClick(index.toString()) }, v.column)))),
    ];
  }
};
IntergiroTableRow.style = styleCss;

export { IntergiroTableRow as ig_table_row };
