import { __extends, __assign, __decorate, __metadata } from 'tslib';
import { Prop, Component } from 'vue-property-decorator';
import BaseComponent from '../../BaseComponent.js';
import { classNamesFunction } from '@uifabric-vue/utilities';
import { DetailsRowFields } from './DetailsRowFields.js';

var getClassNames = classNamesFunction();
var NO_COLUMNS = [];
var DetailsRowBase = function(_super) {
  __extends(DetailsRowBase2, _super);
  function DetailsRowBase2() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.showCheckbox = false;
    return _this;
  }
  Object.defineProperty(DetailsRowBase2.prototype, "classNames", {
    get: function() {
      var _a = this, styles = _a.styles, theme = _a.theme, className = _a.className, compact = _a.compact;
      return __assign({}, getClassNames(styles, {
        theme: theme,
        isSelected: false,
        canSelect: false,
        anySelected: false,
        checkboxCellClassName: "",
        droppingClassName: "",
        className: className,
        compact: compact,
        enableUpdateAnimations: false
      }));
    },
    enumerable: false,
    configurable: true
  });
  Object.defineProperty(DetailsRowBase2.prototype, "rowClassNames", {
    get: function() {
      return {
        isMultiline: this.classNames.isMultiline,
        isRowHeader: this.classNames.isRowHeader,
        cell: this.classNames.cell,
        cellAnimation: this.classNames.cellAnimation,
        cellPadded: this.classNames.cellPadded,
        cellUnpadded: this.classNames.cellUnpadded,
        fields: this.classNames.fields
      };
    },
    enumerable: false,
    configurable: true
  });
  DetailsRowBase2.prototype.measureCell = function(index, onMeasureDone) {
    var _a = this.columns, columns = _a === void 0 ? NO_COLUMNS : _a;
    var column = __assign({}, columns[index]);
    column.minWidth = 0;
    column.maxWidth = 999999;
    delete column.calculatedWidth;
  };
  DetailsRowBase2.prototype.render = function(h) {
    var _this = this;
    var _a = this, classNames = _a.classNames, rowClassNames = _a.rowClassNames, item = _a.item, columns = _a.columns, showCheckbox = _a.showCheckbox;
    return h("div", { class: classNames.root, on: { click: function(ev) {
      return _this.$emit("click", ev);
    } } }, [
      h(DetailsRowFields, {
        attrs: {
          rowClassNames: rowClassNames,
          columns: columns,
          item: item,
          itemIndex: 0,
          columnStartIndex: showCheckbox ? 1 : 0
        },
        scopedSlots: this.$scopedSlots
      })
    ]);
  };
  __decorate([
    Prop({ type: Array, required: true }),
    __metadata("design:type", Array)
  ], DetailsRowBase2.prototype, "columns", void 0);
  __decorate([
    Prop({ type: Object, required: true }),
    __metadata("design:type", Object)
  ], DetailsRowBase2.prototype, "item", void 0);
  __decorate([
    Prop({ type: Boolean, required: true }),
    __metadata("design:type", Boolean)
  ], DetailsRowBase2.prototype, "compact", void 0);
  DetailsRowBase2 = __decorate([
    Component
  ], DetailsRowBase2);
  return DetailsRowBase2;
}(BaseComponent);

export { DetailsRowBase };
