var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
define(["require", "exports", "react", "office-ui-fabric-react/lib/TextField", "office-ui-fabric-react/lib/DetailsList", "office-ui-fabric-react/lib/MarqueeSelection"], function (require, exports, React, TextField_1, DetailsList_1, MarqueeSelection_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var _items = [];
    var _columns = [
        {
            key: 'column1',
            name: 'Name',
            fieldName: 'name',
            minWidth: 100,
            maxWidth: 200,
            isResizable: true,
            ariaLabel: 'Operations for name'
        },
        {
            key: 'column2',
            name: 'Value',
            fieldName: 'value',
            minWidth: 100,
            maxWidth: 200,
            isResizable: true,
            ariaLabel: 'Operations for value'
        },
    ];
    var DetailsListBasicExample = (function (_super) {
        __extends(DetailsListBasicExample, _super);
        function DetailsListBasicExample() {
            var _this = _super.call(this) || this;
            // Populate with items for demos.
            if (_items.length === 0) {
                for (var i = 0; i < 200; i++) {
                    _items.push({
                        key: i,
                        name: 'Item ' + i,
                        value: i
                    });
                }
            }
            _this._selection = new DetailsList_1.Selection({
                onSelectionChanged: function () { return _this.setState({ selectionDetails: _this._getSelectionDetails() }); }
            });
            _this.state = {
                items: _items,
                selectionDetails: _this._getSelectionDetails()
            };
            return _this;
        }
        DetailsListBasicExample.prototype.render = function () {
            var _this = this;
            var _a = this.state, items = _a.items, selectionDetails = _a.selectionDetails;
            return (React.createElement("div", null,
                React.createElement("div", null, selectionDetails),
                React.createElement(TextField_1.TextField, { label: 'Filter by name:', onChanged: function (text) { return _this.setState({ items: text ? _items.filter(function (i) { return i.name.toLowerCase().indexOf(text) > -1; }) : _items }); } }),
                React.createElement(MarqueeSelection_1.MarqueeSelection, { selection: this._selection },
                    React.createElement(DetailsList_1.DetailsList, { items: items, columns: _columns, setKey: 'set', layoutMode: DetailsList_1.DetailsListLayoutMode.fixedColumns, selection: this._selection, selectionPreservedOnEmptyClick: true, ariaLabelForSelectionColumn: 'Toggle selection', ariaLabelForSelectAllCheckbox: 'Toggle selection for all items', onItemInvoked: function (item) { return alert("Item invoked: " + item.name); } }))));
        };
        DetailsListBasicExample.prototype._getSelectionDetails = function () {
            var selectionCount = this._selection.getSelectedCount();
            switch (selectionCount) {
                case 0:
                    return 'No items selected';
                case 1:
                    return '1 item selected: ' + this._selection.getSelection()[0].name;
                default:
                    return selectionCount + " items selected";
            }
        };
        return DetailsListBasicExample;
    }(React.Component));
    exports.DetailsListBasicExample = DetailsListBasicExample;
});

//# sourceMappingURL=DetailsList.Basic.Example.js.map
