UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

33 lines 2.38 kB
define(["require", "exports", "tslib", "react", "office-ui-fabric-react/lib/Utilities", "office-ui-fabric-react/lib/Rating", "./Rating.Basic.Example.scss"], function (require, exports, tslib_1, React, Utilities_1, Rating_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RatingBasicExample = (function (_super) { tslib_1.__extends(RatingBasicExample, _super); function RatingBasicExample() { var _this = _super.call(this) || this; _this.state = { rating: null }; return _this; } RatingBasicExample.prototype.render = function () { return (React.createElement("div", { className: 'ms-RatingBasicExample' }, React.createElement(Rating_1.Rating, { min: 1, max: 5, rating: this.state.rating, onChanged: this._onChanged, onFocus: function () { return console.log('onFocus called'); }, onBlur: function () { return console.log('onBlur called'); } }), React.createElement(Rating_1.Rating, { min: 1, max: 5, size: Rating_1.RatingSize.Large, rating: this.state.rating, onChanged: this._onChanged, onFocus: function () { return console.log('onFocus called'); }, onBlur: function () { return console.log('onBlur called'); } }), React.createElement(Rating_1.Rating, { min: 1, max: 10, size: Rating_1.RatingSize.Large, rating: this.state.rating, onChanged: this._onChanged, onFocus: function () { return console.log('onFocus called'); }, onBlur: function () { return console.log('onBlur called'); } }), "Disabled:", React.createElement(Rating_1.Rating, { min: 1, max: 5, rating: this.state.rating, onChanged: this._onChanged, disabled: true, onFocus: function () { return console.log('onFocus called'); }, onBlur: function () { return console.log('onBlur called'); } }))); }; RatingBasicExample.prototype._onChanged = function (rating) { this.setState({ rating: rating }); }; tslib_1.__decorate([ Utilities_1.autobind ], RatingBasicExample.prototype, "_onChanged", null); return RatingBasicExample; }(React.Component)); exports.RatingBasicExample = RatingBasicExample; }); //# sourceMappingURL=Rating.Basic.Example.js.map