'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-df541290.js');
const model = require('./model-7d89452f.js');
require('./index-bdcc5560.js');
require('./_commonjsHelpers-5bbc2693.js');
require('./index-c277d1ea.js');
require('./index-fe50ed35.js');

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

const PayfuncTableRow = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.columnClicked = index.createEvent(this, "columnClicked", 7);
    this.valueSelected = index.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 && (index.h("td", { class: "checkbox" }, index.h("smoothly-checkbox", { selected: this.selected }))),
      this.row.filter(model.isDefined).map((v, index$1) => (index.h("td", { class: v.align == "right" ? "right" : "" }, index.h("section", { class: v.openable ? "openable" + (this.opened == index$1.toString() ? " opened" : "") : "", onClick: () => v.openable && this.handleColumnClick(index$1.toString()) }, v.column)))),
    ];
  }
};
PayfuncTableRow.style = styleCss;

exports.payfunc_table_row = PayfuncTableRow;
