UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

49 lines (47 loc) 2.45 kB
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 __()); }; define(["require", "exports", 'react', '../../../../index', './Dropdown.Basic.Example.scss'], function (require, exports, React, index_1) { "use strict"; var DropdownBasicExample = (function (_super) { __extends(DropdownBasicExample, _super); function DropdownBasicExample() { _super.call(this); this.state = { selectedItem: null }; } 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