import { __assign, __decorate, __extends, __metadata } from "tslib";
import { Component, Prop } from 'vue-property-decorator';
import BaseComponent from '../../BaseComponent';
import { classNamesFunction } from '@uifabric-vue/utilities';
import { DetailsRowFields } from './DetailsRowFields';
var getClassNames = classNamesFunction();
var NO_COLUMNS = [];
var DetailsRowBase = /** @class */ (function (_super) {
    __extends(DetailsRowBase, _super);
    function DetailsRowBase() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.showCheckbox = false;
        return _this;
    }
    Object.defineProperty(DetailsRowBase.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(DetailsRowBase.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
    });
    /**
     * measure cell at index. and call the call back with the measured cell width when finish measure
     *
     * @param index - The cell index
     * @param onMeasureDone - The call back function when finish measure
     */
    DetailsRowBase.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;
        // this.setState({
        //   columnMeasureInfo: {
        //     index,
        //     column,
        //     onMeasureDone,
        //   },
        // })
    };
    DetailsRowBase.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,
                    // cells-by-column: {cellsByColumn},
                    columns: columns,
                    item: item,
                    itemIndex: 0,
                    columnStartIndex: showCheckbox ? 1 : 0,
                },
                scopedSlots: this.$scopedSlots,
            }),
        ]);
    };
    __decorate([
        Prop({ type: Array, required: true }),
        __metadata("design:type", Array)
    ], DetailsRowBase.prototype, "columns", void 0);
    __decorate([
        Prop({ type: Object, required: true }),
        __metadata("design:type", Object)
    ], DetailsRowBase.prototype, "item", void 0);
    __decorate([
        Prop({ type: Boolean, required: true }),
        __metadata("design:type", Boolean)
    ], DetailsRowBase.prototype, "compact", void 0);
    DetailsRowBase = __decorate([
        Component
    ], DetailsRowBase);
    return DetailsRowBase;
}(BaseComponent));
export { DetailsRowBase };
//# sourceMappingURL=DetailsRow.base.js.map