office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
51 lines (49 loc) • 2.39 kB
JavaScript
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = require("react");
var index_1 = require("../../../../index");
require("./Dropdown.Basic.Example.scss");
var DropdownBasicExample = (function (_super) {
__extends(DropdownBasicExample, _super);
function DropdownBasicExample() {
var _this = _super.call(this) || this;
_this.state = {
selectedItem: null
};
return _this;
}
DropdownBasicExample.prototype.render = function () {
var _this = this;
var selectedItem = this.state.selectedItem;
return (React.createElement("div", { className: 'ms-DropdownBasicExample' },
React.createElement(index_1.Dropdown, { label: 'Basic example:', options: [
{ key: 'A', text: 'Option a' },
{ key: 'B', text: 'Option b' },
{ key: 'C', text: 'Option c' },
{ key: 'D', text: 'Option d' },
{ key: 'E', text: 'Option e' },
{ key: 'F', text: 'Option f' },
{ key: 'G', text: 'Option g' },
{ key: 'H', text: 'Option h' },
{ key: 'I', text: 'Option i' },
{ key: 'J', text: 'Option j' },
], onChanged: function (item) { return _this.setState({ selectedItem: item }); } }),
React.createElement("div", null, "Item selected: " + (selectedItem ? selectedItem.text : '<none>')),
React.createElement(index_1.Dropdown, { label: 'Disabled example:', defaultSelectedKey: 'D', options: [
{ key: 'A', text: 'Option a' },
{ key: 'B', text: 'Option b' },
{ key: 'C', text: 'Option c' },
{ key: 'D', text: 'Option d' },
{ key: 'E', text: 'Option e' },
{ key: 'F', text: 'Option f' },
{ key: 'G', text: 'Option g' },
], disabled: true })));
};
return DropdownBasicExample;
}(React.Component));
exports.DropdownBasicExample = DropdownBasicExample;
//# sourceMappingURL=Dropdown.Basic.Example.js.map