UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

47 lines (45 loc) 2.41 kB
"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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var React = require("react"); var index_1 = require("../../../../index"); var autobind_1 = require("../../../../utilities/autobind"); require("./Rating.Basic.Example.scss"); var RatingBasicExample = (function (_super) { __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(index_1.Rating, { min: 1, max: 5, rating: this.state.rating, onChanged: this._onChanged }), React.createElement(index_1.Rating, { min: 1, max: 5, size: index_1.RatingSize.Large, rating: this.state.rating, onChanged: this._onChanged }), React.createElement(index_1.Rating, { min: 1, max: 10, size: index_1.RatingSize.Large, rating: this.state.rating, onChanged: this._onChanged }), "Disabled:", React.createElement(index_1.Rating, { min: 1, max: 5, rating: this.state.rating, onChanged: this._onChanged, disabled: true }))); }; RatingBasicExample.prototype._onChanged = function (rating) { this.setState({ rating: rating }); }; return RatingBasicExample; }(React.Component)); __decorate([ autobind_1.autobind ], RatingBasicExample.prototype, "_onChanged", null); exports.RatingBasicExample = RatingBasicExample; //# sourceMappingURL=Rating.Basic.Example.js.map