UNPKG

wix-style-react

Version:
53 lines (41 loc) 2.67 kB
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } import React from 'react'; import Calendar from '../../src/Calendar'; var YearMonthsCalendarExample = function (_React$Component) { _inherits(YearMonthsCalendarExample, _React$Component); function YearMonthsCalendarExample(props) { _classCallCheck(this, YearMonthsCalendarExample); var _this = _possibleConstructorReturn(this, (YearMonthsCalendarExample.__proto__ || Object.getPrototypeOf(YearMonthsCalendarExample)).call(this, props)); _this.state = { date: new Date('2017/05/01'), excludePastDates: true }; return _this; } _createClass(YearMonthsCalendarExample, [{ key: 'onChange', value: function onChange(date) { this.setState({ date: date }); } }, { key: 'render', value: function render() { var _this2 = this; return React.createElement(Calendar, { showMonthDropdown: true, showYearDropdown: true, onChange: function onChange(date) { return _this2.onChange(date); }, value: this.state.date }); } }]); return YearMonthsCalendarExample; }(React.Component); export default (function () { return React.createElement(YearMonthsCalendarExample, null); });