import { __decorate, __extends, __metadata } from "tslib";
import { Component, Prop } from 'vue-property-decorator';
import { classNamesFunction, toMatrix } from '@uifabric-vue/utilities';
import BaseComponent from '../../components/BaseComponent';
var getClassNames = classNamesFunction();
var GridBase = /** @class */ (function (_super) {
    __extends(GridBase, _super);
    function GridBase() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Object.defineProperty(GridBase.prototype, "rowsOfItems", {
        get: function () {
            var _a = this, items = _a.items, columnCount = _a.columnCount;
            return toMatrix(items, columnCount);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(GridBase.prototype, "classNames", {
        get: function () {
            var _a = this, theme = _a.theme, styles = _a.styles;
            return getClassNames(styles, { theme: theme });
        },
        enumerable: false,
        configurable: true
    });
    GridBase.prototype.render = function (h) {
        var _this = this;
        var _a = this, classNames = _a.classNames, rowsOfItems = _a.rowsOfItems;
        return h('table', {
            class: classNames.root,
        }, [
            h('tbody', rowsOfItems.map(function (rows, rowIndex) { return h('tr', {
                key: "".concat(_this.uid, "-").concat(rowIndex, "-row"),
                attrs: { role: 'row' },
            }, rows.map(function (cell, cellIndex) { return h('td', {
                key: "".concat(_this.uid, "-").concat(rowIndex, "-").concat(cellIndex, "-cell"),
                class: classNames.tableCell,
            }, _this.$scopedSlots.default ? _this.$scopedSlots.default({ cell: cell, index: cellIndex }) : null); })); })),
        ]);
    };
    __decorate([
        Prop(),
        __metadata("design:type", Array)
    ], GridBase.prototype, "items", void 0);
    __decorate([
        Prop(),
        __metadata("design:type", Number)
    ], GridBase.prototype, "columnCount", void 0);
    GridBase = __decorate([
        Component({
            components: {},
            inheritAttrs: false,
        })
    ], GridBase);
    return GridBase;
}(BaseComponent));
export { GridBase };
//# sourceMappingURL=Grid.base.js.map