UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

1 lines 1.47 kB
module.exports = "import * as React from 'react';\r\nimport {\r\n Rating, RatingSize\r\n} from '../../../../index';\r\nimport { autobind } from '../../../../utilities/autobind';\r\n\r\nimport './Rating.Basic.Example.scss';\r\n\r\nexport class RatingBasicExample extends React.Component<any, any> {\r\n constructor() {\r\n super();\r\n\r\n this.state = {\r\n rating: null\r\n };\r\n }\r\n\r\n public render() {\r\n return (\r\n <div className='ms-RatingBasicExample'>\r\n <Rating\r\n min={ 1 }\r\n max={ 5 }\r\n rating={ this.state.rating }\r\n onChanged={ this._onChanged }\r\n />\r\n\r\n <Rating\r\n min={ 1 }\r\n max={ 5 }\r\n size={ RatingSize.Large }\r\n rating={ this.state.rating }\r\n onChanged={ this._onChanged }\r\n />\r\n\r\n <Rating\r\n min={ 1 }\r\n max={ 10 }\r\n size={ RatingSize.Large }\r\n rating={ this.state.rating }\r\n onChanged={ this._onChanged }\r\n />\r\n\r\n Disabled:\r\n <Rating\r\n min={ 1 }\r\n max={ 5 }\r\n rating={ this.state.rating }\r\n onChanged={ this._onChanged }\r\n disabled={ true }\r\n />\r\n </div>\r\n );\r\n }\r\n\r\n @autobind\r\n private _onChanged(rating: number) {\r\n this.setState({\r\n rating: rating\r\n });\r\n }\r\n}\r\n";