react-day-picker
Advanced tools
Comparing version 0.8.1 to 0.8.2
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; | ||
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; }; })(); | ||
var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _inherits = function (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) subClass.__proto__ = superClass; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _React$Component$PropTypes = require('react'); | ||
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) subClass.__proto__ = superClass; } | ||
var _React$Component$PropTypes2 = _interopRequireWildcard(_React$Component$PropTypes); | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _moment = require('moment'); | ||
var _moment2 = _interopRequireWildcard(_moment); | ||
var _moment2 = _interopRequireDefault(_moment); | ||
var _weeks = require('./CalendarUtils'); | ||
var _CalendarUtils = require('./CalendarUtils'); | ||
@@ -132,5 +132,5 @@ var DayPicker = (function (_Component) { | ||
return _React$Component$PropTypes2['default'].createElement( | ||
return _react2['default'].createElement( | ||
'div', | ||
null, | ||
{ className: this.props.className, style: this.props.style }, | ||
months | ||
@@ -144,6 +144,6 @@ ); | ||
var isLastMonth = monthIndex === this.props.numberOfMonths - 1; | ||
return _React$Component$PropTypes2['default'].createElement( | ||
return _react2['default'].createElement( | ||
'table', | ||
{ key: monthIndex, className: 'DayPicker' }, | ||
_React$Component$PropTypes2['default'].createElement( | ||
_react2['default'].createElement( | ||
'caption', | ||
@@ -155,3 +155,3 @@ { className: 'DayPicker-caption' }, | ||
), | ||
_React$Component$PropTypes2['default'].createElement( | ||
_react2['default'].createElement( | ||
'thead', | ||
@@ -161,3 +161,3 @@ null, | ||
), | ||
_React$Component$PropTypes2['default'].createElement( | ||
_react2['default'].createElement( | ||
'tbody', | ||
@@ -175,3 +175,3 @@ null, | ||
return _React$Component$PropTypes2['default'].createElement('span', { ref: 'btn-' + position, className: className, | ||
return _react2['default'].createElement('span', { ref: 'btn-' + position, className: className, | ||
style: { float: position }, onClick: handler.bind(this) }); | ||
@@ -184,4 +184,4 @@ } | ||
return _weeks.weeks(month).map(function (week, i) { | ||
return _React$Component$PropTypes2['default'].createElement( | ||
return (0, _CalendarUtils.weeks)(month).map(function (week, i) { | ||
return _react2['default'].createElement( | ||
'tr', | ||
@@ -198,6 +198,6 @@ { key: i, className: 'DayPicker-week' }, | ||
for (var i = 0; i < 7; i++) { | ||
header.push(_React$Component$PropTypes2['default'].createElement( | ||
header.push(_react2['default'].createElement( | ||
'th', | ||
{ key: i, className: 'DayPicker-weekday' }, | ||
_moment2['default']().weekday(i).format('dd') | ||
(0, _moment2['default'])().weekday(i).format('dd') | ||
)); | ||
@@ -245,3 +245,3 @@ } | ||
if (outside && !this.props.enableOutsideDays) { | ||
return _React$Component$PropTypes2['default'].createElement('td', { className: className, ref: key, key: key }); | ||
return _react2['default'].createElement('td', { className: className, ref: key, key: key }); | ||
} else { | ||
@@ -255,3 +255,3 @@ var modifiers = this.getModifiersForDay(day); | ||
}).join(''); | ||
return _React$Component$PropTypes2['default'].createElement( | ||
return _react2['default'].createElement( | ||
'td', | ||
@@ -272,22 +272,22 @@ { ref: key, key: key, | ||
enableOutsideDays: _React$Component$PropTypes.PropTypes.bool, | ||
enableOutsideDays: _react.PropTypes.bool, | ||
// default is current month | ||
initialMonth: _React$Component$PropTypes.PropTypes.object, | ||
initialMonth: _react.PropTypes.object, | ||
// default is 1 | ||
numberOfMonths: _React$Component$PropTypes.PropTypes.number, | ||
numberOfMonths: _react.PropTypes.number, | ||
modifiers: _React$Component$PropTypes.PropTypes.object, | ||
modifiers: _react.PropTypes.object, | ||
onDayClick: _React$Component$PropTypes.PropTypes.func, | ||
onDayClick: _react.PropTypes.func, | ||
// requires react-tap-event-plugin | ||
onDayTouchTap: _React$Component$PropTypes.PropTypes.func, | ||
onDayTouchTap: _react.PropTypes.func, | ||
onDayMouseEnter: _React$Component$PropTypes.PropTypes.func, | ||
onDayMouseLeave: _React$Component$PropTypes.PropTypes.func, | ||
onDayMouseEnter: _react.PropTypes.func, | ||
onDayMouseLeave: _react.PropTypes.func, | ||
onNextMonthClick: _React$Component$PropTypes.PropTypes.func, | ||
onPrevMonthClick: _React$Component$PropTypes.PropTypes.func | ||
onNextMonthClick: _react.PropTypes.func, | ||
onPrevMonthClick: _react.PropTypes.func | ||
@@ -299,3 +299,3 @@ }, | ||
value: { | ||
initialMonth: _moment2['default'](), | ||
initialMonth: (0, _moment2['default'])(), | ||
numberOfMonths: 1, | ||
@@ -308,5 +308,5 @@ enableOutsideDays: false | ||
return DayPicker; | ||
})(_React$Component$PropTypes.Component); | ||
})(_react.Component); | ||
exports['default'] = DayPicker; | ||
module.exports = exports['default']; |
@@ -40,4 +40,4 @@ import React, { Component } from 'react'; | ||
modifiers={ this.getModifiers() } | ||
onDayTouchTap={this.handleDayTouchTap.bind(this)} /> | ||
onDayTouchTap={this.handleDayTouchTap.bind(this)} | ||
className="my-date-picker"/> | ||
</div> | ||
@@ -44,0 +44,0 @@ ); |
{ | ||
"name": "react-day-picker", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "Minimalistic date picker component for React and momentjs.", | ||
@@ -39,4 +39,4 @@ "main": "./dist/DayPicker.js", | ||
"autoprefixer-loader": "^1.2.0", | ||
"babel": "^5.1.10", | ||
"babel-core": "^5.1.10", | ||
"babel": "^5.3.3", | ||
"babel-core": "^5.3.3", | ||
"babel-jest": "^5.0.1", | ||
@@ -46,3 +46,3 @@ "babel-loader": "^5.0.0", | ||
"jest-cli": "^0.4.0", | ||
"react-tap-event-plugin": "git+https://github.com/gpbl/react-tap-event-plugin.git", | ||
"react-tap-event-plugin": "^0.1.6", | ||
"sass-loader": "0.4.2", | ||
@@ -49,0 +49,0 @@ "style-loader": "^0.10.2", |
@@ -96,3 +96,3 @@ # react-day-picker | ||
onDayTouchTap={Function} | ||
onMouseEnter={Function} | ||
onDayMouseEnter={Function} | ||
onDayMouseLeave={Function} | ||
@@ -99,0 +99,0 @@ onPrevMonthClick={Function} |
@@ -122,3 +122,3 @@ import React, { Component, PropTypes } from 'react'; | ||
return ( | ||
<div> | ||
<div className={this.props.className} style={this.props.style}> | ||
{months} | ||
@@ -125,0 +125,0 @@ </div> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
453889
26
1947