define(["require", "exports", "tslib", "office-ui-fabric-react/lib/Button", "office-ui-fabric-react/lib/DetailsList", "react"], function (require, exports, tslib_1, Button_1, DetailsList_1, React) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var DetailsListProportionalColumnsExample = /** @class */ (function (_super) {
        tslib_1.__extends(DetailsListProportionalColumnsExample, _super);
        function DetailsListProportionalColumnsExample(props) {
            var _this = _super.call(this, props) || this;
            _this._onColumnButtonInvoked = function () {
                alert('Custom header button invoked');
            };
            _this._onItemInvoked = function (item) {
                alert("Item invoked: " + item.name);
            };
            // Populate with items for demos.
            _this._allItems = [];
            for (var i = 0; i < 200; i++) {
                _this._allItems.push({
                    key: i,
                    name: 'Item ' + i,
                    value: i,
                });
            }
            _this._columns = [
                {
                    key: 'column1',
                    name: 'Number 1',
                    fieldName: 'name',
                    flexGrow: 1,
                    minWidth: 100,
                    isResizable: true,
                    getValueKey: _this._getValueKey,
                    onRenderHeader: function (colProps, defaultRender) { return (React.createElement(Button_1.ActionButton, { onClick: _this._onColumnButtonInvoked }, (defaultRender && defaultRender(colProps)) || React.createElement(React.Fragment, null))); },
                },
                {
                    key: 'column2',
                    name: 'Number 2',
                    fieldName: 'value',
                    minWidth: 100,
                    isResizable: true,
                },
                {
                    key: 'column3',
                    name: 'Number 3',
                    fieldName: 'value',
                    flexGrow: 2,
                    minWidth: 100,
                    isResizable: true,
                },
            ];
            _this.state = {
                items: _this._allItems,
            };
            return _this;
        }
        DetailsListProportionalColumnsExample.prototype.componentWillUnmount = function () {
            clearInterval(this._updateTimer);
        };
        DetailsListProportionalColumnsExample.prototype.render = function () {
            var items = this.state.items;
            return (React.createElement(DetailsList_1.DetailsList, { items: items, columns: this._columns, setKey: "set", layoutMode: DetailsList_1.DetailsListLayoutMode.fixedColumns, selectionPreservedOnEmptyClick: true, ariaLabelForSelectionColumn: "Toggle selection", ariaLabelForSelectAllCheckbox: "Toggle selection for all items", checkButtonAriaLabel: "Row checkbox", onItemInvoked: this._onItemInvoked, enableUpdateAnimations: true, getCellValueKey: this._getCellValueKey }));
        };
        DetailsListProportionalColumnsExample.prototype._getValueKey = function (item, index, column) {
            var key = item && column && column.fieldName
                ? item[column.fieldName]
                : index;
            return key.toString();
        };
        DetailsListProportionalColumnsExample.prototype._getCellValueKey = function (item, index, column) {
            var key = item && column && column.fieldName
                ? item[column.fieldName]
                : index;
            return key.toString();
        };
        return DetailsListProportionalColumnsExample;
    }(React.Component));
    exports.DetailsListProportionalColumnsExample = DetailsListProportionalColumnsExample;
});
//# sourceMappingURL=DetailsList.ProportionalColumns.Example.js.map