react-big-calendar
Advanced tools
Comparing version 0.9.2 to 0.9.3
@@ -0,1 +1,8 @@ | ||
v0.9.3 - Sat, 28 Nov 2015 20:00:24 GMT | ||
-------------------------------------- | ||
- [fff1914](../../commit/fff1914) [fixed] pass culture to View | ||
v0.9.2 - Thu, 12 Nov 2015 23:34:33 GMT | ||
@@ -2,0 +9,0 @@ -------------------------------------- |
@@ -11,3 +11,3 @@ 'use strict'; | ||
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; } | ||
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; } | ||
@@ -35,2 +35,4 @@ var _react = require('react'); | ||
var DisplayCells = (function (_React$Component) { | ||
_inherits(DisplayCells, _React$Component); | ||
function DisplayCells() { | ||
@@ -44,4 +46,2 @@ _classCallCheck(this, DisplayCells); | ||
_inherits(DisplayCells, _React$Component); | ||
DisplayCells.prototype.componentDidMount = function componentDidMount() { | ||
@@ -48,0 +48,0 @@ this.props.selectable && this._selectable(); |
@@ -78,2 +78,11 @@ 'use strict'; | ||
/** | ||
* react-big-calendar is full featured Calendar component for managing events and dates. It uses | ||
* modern `flexbox` for layout making it super responsive and performant. Leaving most of the layout heavy lifting | ||
* to the browser. | ||
* | ||
* Big Calendar is unopiniated about editing and moving events, prefering to let you implement it in a way that makes | ||
* the most sense to your app. It also tries not to be prescriptive about your event data structures, just tell it | ||
* how to find the start and end datetimes and you can pass it whatever you want. | ||
*/ | ||
var Calendar = _react2['default'].createClass({ | ||
@@ -85,2 +94,4 @@ displayName: 'Calendar', | ||
* The current date value of the calendar. Determines the visible view range | ||
* | ||
* @controllable onNavigate | ||
*/ | ||
@@ -90,2 +101,10 @@ date: _react.PropTypes.instanceOf(Date), | ||
/** | ||
* The current view of the calendar. | ||
* | ||
* @default 'month' | ||
* @controllable onView | ||
*/ | ||
view: _react.PropTypes.string, | ||
/** | ||
* An array of event objects to display on the calendar | ||
@@ -97,2 +116,4 @@ */ | ||
* Callback fired when the `date` value changes. | ||
* | ||
* @controllable date | ||
*/ | ||
@@ -102,4 +123,11 @@ onNavigate: _react.PropTypes.func, | ||
/** | ||
* A callback fired when a date selection is made. | ||
* Callback fired when the `view` value changes. | ||
* | ||
* @controllable date | ||
*/ | ||
onView: _react.PropTypes.func, | ||
/** | ||
* A callback fired when a date selection is made. Only fires when `selectable` is `true`. | ||
* | ||
* ```js | ||
@@ -118,3 +146,3 @@ * function( | ||
/** | ||
* Callback fired when an event node is selected. | ||
* Callback fired when a calendar event is selected. | ||
* | ||
@@ -128,3 +156,6 @@ * ```js | ||
/** | ||
* An array of built in view names | ||
* An array of built-in view names to allow the calendar to display. | ||
* | ||
* @type Calendar.views | ||
* @default ['month', 'week', 'day', 'agenda'] | ||
*/ | ||
@@ -202,2 +233,5 @@ views: _utilsPropTypes.views, | ||
/** | ||
* Localizer specific formats, tell the Calendar how to format and display dates. | ||
*/ | ||
formats: _react.PropTypes.shape({ | ||
@@ -246,2 +280,17 @@ /** | ||
/** | ||
* Customize how different sections of the calendar render by providing custom Components. | ||
* In particular the `Event` component can be specified for the entire calendar, or you can | ||
* provide an individual component for each view type. | ||
* | ||
* ```jsx | ||
* let components = { | ||
* event: MyEvent, // used by each view (Month, Day, Week) | ||
* agenda: { | ||
* event: MyAgendaEvent // with the agenda view use a different component to render events | ||
* } | ||
* } | ||
* <Calendar components={components} /> | ||
* ``` | ||
*/ | ||
components: _react.PropTypes.shape({ | ||
@@ -329,3 +378,4 @@ event: _utilsPropTypes.elementType, | ||
onViewChange: this._view, | ||
onNavigate: this._navigate | ||
onNavigate: this._navigate, | ||
messages: this.props.messages | ||
}), | ||
@@ -335,2 +385,3 @@ _react2['default'].createElement(View, _extends({ | ||
}, props, formats, { | ||
culture: culture, | ||
formats: undefined, | ||
@@ -337,0 +388,0 @@ events: events, |
@@ -81,3 +81,3 @@ 'use strict'; | ||
renderSpan: function renderSpan(len, key) { | ||
var content = arguments[2] === undefined ? ' ' : arguments[2]; | ||
var content = arguments.length <= 2 || arguments[2] === undefined ? ' ' : arguments[2]; | ||
var slots = this.props.slots; | ||
@@ -84,0 +84,0 @@ |
@@ -15,9 +15,9 @@ 'use strict'; | ||
var _momentLocalizer = require('./moment-localizer'); | ||
var _localizersMoment = require('./localizers/moment'); | ||
var _momentLocalizer2 = _interopRequireDefault(_momentLocalizer); | ||
var _localizersMoment2 = _interopRequireDefault(_localizersMoment); | ||
var _globalizeLocalizer = require('./globalize-localizer'); | ||
var _localizersGlobalize = require('./localizers/globalize'); | ||
var _globalizeLocalizer2 = _interopRequireDefault(_globalizeLocalizer); | ||
var _localizersGlobalize2 = _interopRequireDefault(_localizersGlobalize); | ||
@@ -32,7 +32,10 @@ var _utilsViewLabel = require('./utils/viewLabel'); | ||
var _utilsConstants = require('./utils/constants'); | ||
_extends(_Calendar2['default'], { | ||
setLocalizer: _localizer.set, | ||
globalizeLocalizer: _globalizeLocalizer2['default'], | ||
momentLocalizer: _momentLocalizer2['default'], | ||
globalizeLocalizer: _localizersGlobalize2['default'], | ||
momentLocalizer: _localizersMoment2['default'], | ||
label: _utilsViewLabel2['default'], | ||
views: _utilsConstants.views, | ||
move: _utilsMove2['default'] | ||
@@ -39,0 +42,0 @@ }); |
@@ -65,2 +65,3 @@ 'use strict'; | ||
localizer = new DateLocalizer(newLocalizer); | ||
return localizer; | ||
} | ||
@@ -70,11 +71,17 @@ | ||
parse: function parse() { | ||
return localizer.parse.apply(localizer, arguments); | ||
var _localizer; | ||
return (_localizer = localizer).parse.apply(_localizer, arguments); | ||
}, | ||
format: function format() { | ||
return localizer.format.apply(localizer, arguments); | ||
var _localizer2; | ||
return (_localizer2 = localizer).format.apply(_localizer2, arguments); | ||
}, | ||
startOfWeek: function startOfWeek() { | ||
return localizer.startOfWeek.apply(localizer, arguments); | ||
var _localizer3; | ||
return (_localizer3 = localizer).startOfWeek.apply(_localizer3, arguments); | ||
} | ||
@@ -81,0 +88,0 @@ }; |
@@ -146,3 +146,3 @@ 'use strict'; | ||
running = false; | ||
_this.setState({ needLimitMeasure: true }); | ||
_this.setState({ needLimitMeasure: true }); //eslint-disable-line | ||
}); | ||
@@ -510,3 +510,2 @@ } | ||
exports['default'] = MonthView; | ||
module.exports = exports['default']; | ||
//eslint-disable-line | ||
module.exports = exports['default']; |
@@ -13,3 +13,3 @@ 'use strict'; | ||
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; } | ||
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; } | ||
@@ -43,2 +43,4 @@ var _react = require('react'); | ||
var Popup = (function (_React$Component) { | ||
_inherits(Popup, _React$Component); | ||
function Popup() { | ||
@@ -50,4 +52,2 @@ _classCallCheck(this, Popup); | ||
_inherits(Popup, _React$Component); | ||
Popup.prototype.componentDidMount = function componentDidMount() { | ||
@@ -75,3 +75,3 @@ var _props$popupOffset = this.props.popupOffset; | ||
this.setState({ topOffset: topOffset, leftOffset: leftOffset }); | ||
this.setState({ topOffset: topOffset, leftOffset: leftOffset }); //eslint-disable-line | ||
} | ||
@@ -98,4 +98,3 @@ }; | ||
left: left - leftOffset, | ||
minWidth: width + width / 2, | ||
height: 300 | ||
minWidth: width + width / 2 | ||
}; | ||
@@ -126,3 +125,2 @@ | ||
exports['default'] = Popup; | ||
module.exports = exports['default']; | ||
//eslint-disable-line | ||
module.exports = exports['default']; |
@@ -36,3 +36,3 @@ 'use strict'; | ||
function Selection(node) { | ||
var global = arguments[1] === undefined ? false : arguments[1]; | ||
var global = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; | ||
@@ -56,2 +56,7 @@ _classCallCheck(this, Selection); | ||
/** | ||
* Resolve the disance prop from either an Int or an Object | ||
* @return {Object} | ||
*/ | ||
Selection.prototype.on = function on(type, handler) { | ||
@@ -216,8 +221,4 @@ var handlers = this._listeners[type] || (this._listeners[type] = []); | ||
/** | ||
* Resolve the disance prop from either an Int or an Object | ||
* @return {Object} | ||
*/ | ||
function normalizeDistance() { | ||
var distance = arguments[0] === undefined ? 0 : arguments[0]; | ||
var distance = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; | ||
@@ -238,3 +239,3 @@ if (typeof distance !== 'object') distance = { top: distance, left: distance, right: distance, bottom: distance }; | ||
function objectsCollide(nodeA, nodeB) { | ||
var tolerance = arguments[2] === undefined ? 0 : arguments[2]; | ||
var tolerance = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; | ||
@@ -261,3 +262,9 @@ var _getBoundsForNode = getBoundsForNode(nodeA); | ||
// 'a' bottom doesn't touch 'b' top | ||
aBottom - tolerance < bTop || aTop + tolerance > bBottom || aRight - tolerance < bLeft || aLeft + tolerance > bRight); | ||
aBottom - tolerance < bTop || | ||
// 'a' top doesn't touch 'b' bottom | ||
aTop + tolerance > bBottom || | ||
// 'a' right doesn't touch 'b' left | ||
aRight - tolerance < bLeft || | ||
// 'a' left doesn't touch 'b' right | ||
aLeft + tolerance > bRight); | ||
} | ||
@@ -286,8 +293,2 @@ | ||
exports['default'] = Selection; | ||
// 'a' top doesn't touch 'b' bottom | ||
// 'a' right doesn't touch 'b' left | ||
// 'a' left doesn't touch 'b' right | ||
exports['default'] = Selection; |
@@ -82,3 +82,3 @@ 'use strict'; | ||
range: function range(start, end) { | ||
var unit = arguments[2] === undefined ? 'day' : arguments[2]; | ||
var unit = arguments.length <= 2 || arguments[2] === undefined ? 'day' : arguments[2]; | ||
@@ -85,0 +85,0 @@ var current = start, |
@@ -44,8 +44,7 @@ 'use strict'; | ||
var per = span / slots * 100 + '%'; | ||
return { flexBasis: per, maxWidth: per } // IE10/11 need max-width. flex-basis doesn't respect box-sizing | ||
; | ||
return { flexBasis: per, maxWidth: per }; // IE10/11 need max-width. flex-basis doesn't respect box-sizing | ||
} | ||
function eventLevels(rowSegments) { | ||
var limit = arguments[1] === undefined ? Infinity : arguments[1]; | ||
var limit = arguments.length <= 1 || arguments[1] === undefined ? Infinity : arguments[1]; | ||
@@ -113,4 +112,3 @@ var i = undefined, | ||
|| !!_accessors.accessor(evtB, allDayAccessor) - !!_accessors.accessor(evtA, allDayAccessor) // then allDay single day events | ||
|| +_accessors.accessor(evtA, startAccessor) - +_accessors.accessor(evtB, startAccessor) // then sort by start time | ||
; | ||
|| +_accessors.accessor(evtA, startAccessor) - +_accessors.accessor(evtB, startAccessor); // then sort by start time | ||
} |
@@ -18,3 +18,3 @@ 'use strict'; | ||
function instanceId(component) { | ||
var suffix = arguments[1] === undefined ? '' : arguments[1]; | ||
var suffix = arguments.length <= 1 || arguments[1] === undefined ? '' : arguments[1]; | ||
@@ -21,0 +21,0 @@ component.__id || (component.__id = uniqueId('rw_')); |
@@ -30,3 +30,3 @@ "use strict"; | ||
return y >= box.top && y <= box.bottom && (x >= box.left && x <= box.right); | ||
return y >= box.top && y <= box.bottom && x >= box.left && x <= box.right; | ||
} | ||
@@ -79,8 +79,8 @@ | ||
else if (start.y < box.y) { | ||
// select cells to the right of the start cell | ||
endIdx = lastSlotIdx; | ||
} else { | ||
// select cells to the left of the start cell | ||
startIdx = 0; | ||
} | ||
// select cells to the right of the start cell | ||
endIdx = lastSlotIdx; | ||
} else { | ||
// select cells to the left of the start cell | ||
startIdx = 0; | ||
} | ||
} | ||
@@ -87,0 +87,0 @@ |
{ | ||
"name": "react-big-calendar", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "Calendar! with events", | ||
@@ -29,3 +29,3 @@ "author": "Jason Quense <monastic.panic@gmail.com>", | ||
"build": "npm run clean && babel src --out-dir lib && npm run assets & npm run less", | ||
"build:examples": "npm run clean:examples && babel-node ./webpack/run-webpack --config docs.config.js", | ||
"build:examples": "npm run clean:examples && webpack --config webpack/docs.config.es6.js", | ||
"examples": "npm run clean:examples && babel-node ./examples/server.js", | ||
@@ -44,4 +44,4 @@ "lint": "eslint src test", | ||
"autoprefixer-core": "^5.2.1", | ||
"babel": "5.6.14", | ||
"babel-core": "5.6.15", | ||
"babel": "^5.8.34", | ||
"babel-core": "^5.8.34", | ||
"babel-eslint": "^3.1.20", | ||
@@ -53,2 +53,3 @@ "babel-loader": "^5.3.0", | ||
"chance": "^0.7.6", | ||
"component-metadata-loader": "^1.0.0", | ||
"cpy": "^3.4.1", | ||
@@ -55,0 +56,0 @@ "css-loader": "^0.15.6", |
react-big-calendar | ||
======================== | ||
An event Calendar component built for React. Inspired by [Full Calendar](http://fullcalendar.io/). | ||
An event Calendar component built for React. | ||
[__DEMO and Docs__](http://intljusticemission.github.io/react-big-calendar/examples/index.html). | ||
big calendar is built for modern browsers (read: ie10+) and uses flexbox over the classic tables-ception approach. | ||
[__DEMO__](http://jquense.github.io/react-big-calendar/examples/index.html) | ||
To run the example locally, `git clone`, `npm install` and `npm run examples`, hosted at localhost:3000. | ||
Inspired by [Full Calendar](http://fullcalendar.io/). | ||
## Use and Setup | ||
@@ -18,3 +19,2 @@ | ||
### Localization and Date Formatting | ||
@@ -21,0 +21,0 @@ |
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
151402
3036
55