Socket
Socket
Sign inDemoInstall

react-big-calendar

Package Overview
Dependencies
10
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.13.0 to 0.14.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

v0.14.0 - Tue, 02 May 2017 13:14:45 GMT
---------------------------------------
v0.13.0 - Wed, 22 Mar 2017 15:09:54 GMT

@@ -2,0 +9,0 @@ ---------------------------------------

39

lib/addons/dragAndDrop/backgroundWrapper.js

@@ -10,2 +10,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -21,2 +25,6 @@

var _propTypes3 = require('../../utils/propTypes');
var _accessors = require('../../utils/accessors');
var _dates = require('../../utils/dates');

@@ -38,6 +46,3 @@

function getEventTimes(_ref, dropDate, type) {
var start = _ref.start,
end = _ref.end;
function getEventTimes(start, end, dropDate, type) {
// Calculate duration between original start and end dates

@@ -59,5 +64,5 @@ var duration = _dates2.default.diff(start, end);

var propTypes = {
connectDropTarget: _react2.default.PropTypes.func.isRequired,
type: _react2.default.PropTypes.string,
isOver: _react2.default.PropTypes.bool
connectDropTarget: _propTypes2.default.func.isRequired,
type: _propTypes2.default.string,
isOver: _propTypes2.default.bool
};

@@ -141,4 +146,6 @@

DraggableBackgroundWrapper.contextTypes = {
onEventDrop: _react2.default.PropTypes.func,
dragDropManager: _react2.default.PropTypes.object
onEventDrop: _propTypes2.default.func,
dragDropManager: _propTypes2.default.object,
startAccessor: _propTypes3.accessor,
endAccessor: _propTypes3.accessor
};

@@ -156,14 +163,18 @@

var dropTarget = {
drop: function drop(_, monitor, _ref2) {
var props = _ref2.props,
context = _ref2.context;
drop: function drop(_, monitor, _ref) {
var props = _ref.props,
context = _ref.context;
var event = monitor.getItem();
var value = props.value;
var onEventDrop = context.onEventDrop;
var onEventDrop = context.onEventDrop,
startAccessor = context.startAccessor,
endAccessor = context.endAccessor;
var start = (0, _accessors.accessor)(event, startAccessor);
var end = (0, _accessors.accessor)(event, endAccessor);
onEventDrop(_extends({
event: event
}, getEventTimes(event, value, type)));
}, getEventTimes(start, end, value, type)));
}

@@ -170,0 +181,0 @@ };

@@ -5,2 +5,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -44,5 +48,5 @@

var propTypes = {
connectDragSource: _react2.default.PropTypes.func.isRequired,
isDragging: _react2.default.PropTypes.bool.isRequired,
event: _react2.default.PropTypes.object.isRequired
connectDragSource: _propTypes2.default.func.isRequired,
isDragging: _propTypes2.default.bool.isRequired,
event: _propTypes2.default.object.isRequired
};

@@ -49,0 +53,0 @@

@@ -9,2 +9,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -20,2 +24,4 @@

var _propTypes3 = require('../../utils/propTypes');
var _DraggableEventWrapper = require('./DraggableEventWrapper');

@@ -52,3 +58,7 @@

DragAndDropCalendar.prototype.getChildContext = function getChildContext() {
return { onEventDrop: this.props.onEventDrop };
return {
onEventDrop: this.props.onEventDrop,
startAccessor: this.props.startAccessor,
endAccessor: this.props.endAccessor
};
};

@@ -115,4 +125,4 @@

DragAndDropCalendar.propTypes = {
selectable: _react2.default.PropTypes.oneOf([true, false, 'ignoreEvents']).isRequired,
components: _react2.default.PropTypes.object
selectable: _propTypes2.default.oneOf([true, false, 'ignoreEvents']).isRequired,
components: _propTypes2.default.object
};

@@ -122,15 +132,28 @@

DragAndDropCalendar.propTypes = {
onEventDrop: _react2.default.PropTypes.func.isRequired
onEventDrop: _propTypes2.default.func.isRequired,
startAccessor: _propTypes3.accessor,
endAccessor: _propTypes3.accessor
};
DragAndDropCalendar.defaultProps = {
startAccessor: 'start',
endAccessor: 'end'
};
DragAndDropCalendar.contextTypes = {
dragDropManager: _react2.default.PropTypes.object
dragDropManager: _propTypes2.default.object
};
DragAndDropCalendar.childContextTypes = {
onEventDrop: _react2.default.PropTypes.func
onEventDrop: _propTypes2.default.func,
startAccessor: _propTypes3.accessor,
endAccessor: _propTypes3.accessor
};
return (0, _reactDnd.DragDropContext)(backend)(DragAndDropCalendar);
if (backend === false) {
return DragAndDropCalendar;
} else {
return (0, _reactDnd.DragDropContext)(backend)(DragAndDropCalendar);
}
}
module.exports = exports['default'];

@@ -5,2 +5,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -38,3 +42,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -45,41 +49,132 @@ var _eventLevels = require('./utils/eventLevels');

var Agenda = _react2.default.createClass({
displayName: 'Agenda',
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; }
propTypes: {
events: _react2.default.PropTypes.array,
date: _react2.default.PropTypes.instanceOf(Date),
length: _react2.default.PropTypes.number.isRequired,
titleAccessor: _propTypes.accessor.isRequired,
allDayAccessor: _propTypes.accessor.isRequired,
startAccessor: _propTypes.accessor.isRequired,
endAccessor: _propTypes.accessor.isRequired,
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; }
agendaDateFormat: _propTypes.dateFormat,
agendaTimeFormat: _propTypes.dateFormat,
agendaTimeRangeFormat: _propTypes.dateRangeFormat,
culture: _react2.default.PropTypes.string,
var Agenda = function (_React$Component) {
_inherits(Agenda, _React$Component);
components: _react2.default.PropTypes.object.isRequired,
messages: _react.PropTypes.shape({
date: _react.PropTypes.string,
time: _react.PropTypes.string
})
},
function Agenda() {
var _temp, _this, _ret;
getDefaultProps: function getDefaultProps() {
return {
length: 30
};
},
componentDidMount: function componentDidMount() {
_classCallCheck(this, Agenda);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.renderDay = function (day, events, dayKey) {
var _this$props = _this.props,
culture = _this$props.culture,
components = _this$props.components,
titleAccessor = _this$props.titleAccessor,
agendaDateFormat = _this$props.agendaDateFormat;
var EventComponent = components.event;
var DateComponent = components.date;
events = events.filter(function (e) {
return (0, _eventLevels.inRange)(e, day, day, _this.props);
});
return events.map(function (event, idx) {
var dateLabel = idx === 0 && _localizer2.default.format(day, agendaDateFormat, culture);
var first = idx === 0 ? _react2.default.createElement(
'td',
{ rowSpan: events.length, className: 'rbc-agenda-date-cell' },
DateComponent ? _react2.default.createElement(DateComponent, { day: day, label: dateLabel }) : dateLabel
) : false;
var title = (0, _accessors.accessor)(event, titleAccessor);
return _react2.default.createElement(
'tr',
{ key: dayKey + '_' + idx },
first,
_react2.default.createElement(
'td',
{ className: 'rbc-agenda-time-cell' },
_this.timeRangeLabel(day, event)
),
_react2.default.createElement(
'td',
{ className: 'rbc-agenda-event-cell' },
EventComponent ? _react2.default.createElement(EventComponent, { event: event, title: title }) : title
)
);
}, []);
}, _this.timeRangeLabel = function (day, event) {
var _this$props2 = _this.props,
endAccessor = _this$props2.endAccessor,
startAccessor = _this$props2.startAccessor,
allDayAccessor = _this$props2.allDayAccessor,
culture = _this$props2.culture,
messages = _this$props2.messages,
components = _this$props2.components;
var labelClass = '',
TimeComponent = components.time,
label = (0, _messages2.default)(messages).allDay;
var start = (0, _accessors.accessor)(event, startAccessor);
var end = (0, _accessors.accessor)(event, endAccessor);
if (!(0, _accessors.accessor)(event, allDayAccessor)) {
if (_dates2.default.eq(start, end, 'day')) {
label = _localizer2.default.format({ start: start, end: end }, _this.props.agendaTimeRangeFormat, culture);
} else if (_dates2.default.eq(day, start, 'day')) {
label = _localizer2.default.format(start, _this.props.agendaTimeFormat, culture);
} else if (_dates2.default.eq(day, end, 'day')) {
label = _localizer2.default.format(end, _this.props.agendaTimeFormat, culture);
}
}
if (_dates2.default.gt(day, start, 'day')) labelClass = 'rbc-continues-prior';
if (_dates2.default.lt(day, end, 'day')) labelClass += ' rbc-continues-after';
return _react2.default.createElement(
'span',
{ className: labelClass.trim() },
TimeComponent ? _react2.default.createElement(TimeComponent, { event: event, label: label }) : label
);
}, _this._adjustHeader = function () {
var header = _this.refs.header;
var firstRow = _this.refs.tbody.firstChild;
if (!firstRow) return;
var isOverflowing = _this.refs.content.scrollHeight > _this.refs.content.clientHeight;
var widths = _this._widths || [];
_this._widths = [(0, _width2.default)(firstRow.children[0]), (0, _width2.default)(firstRow.children[1])];
if (widths[0] !== _this._widths[0] || widths[1] !== _this._widths[1]) {
_this.refs.dateCol.style.width = _this._widths[0] + 'px';
_this.refs.timeCol.style.width = _this._widths[1] + 'px';
}
if (isOverflowing) {
_class2.default.addClass(header, 'rbc-header-overflowing');
header.style.marginRight = (0, _scrollbarSize2.default)() + 'px';
} else {
_class2.default.removeClass(header, 'rbc-header-overflowing');
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
Agenda.prototype.componentDidMount = function componentDidMount() {
this._adjustHeader();
},
componentDidUpdate: function componentDidUpdate() {
};
Agenda.prototype.componentDidUpdate = function componentDidUpdate() {
this._adjustHeader();
},
render: function render() {
var _this = this;
};
Agenda.prototype.render = function render() {
var _this2 = this;
var _props = this.props,

@@ -97,3 +192,3 @@ length = _props.length,

events = events.filter(function (event) {
return (0, _eventLevels.inRange)(event, date, end, _this.props);
return (0, _eventLevels.inRange)(event, date, end, _this2.props);
});

@@ -145,3 +240,3 @@

range.map(function (day, idx) {
return _this.renderDay(day, events, idx);
return _this2.renderDay(day, events, idx);
})

@@ -152,108 +247,32 @@ )

);
},
renderDay: function renderDay(day, events, dayKey) {
var _this2 = this;
};
var _props2 = this.props,
culture = _props2.culture,
components = _props2.components,
titleAccessor = _props2.titleAccessor,
agendaDateFormat = _props2.agendaDateFormat;
return Agenda;
}(_react2.default.Component);
Agenda.propTypes = {
events: _propTypes2.default.array,
date: _propTypes2.default.instanceOf(Date),
length: _propTypes2.default.number.isRequired,
titleAccessor: _propTypes3.accessor.isRequired,
allDayAccessor: _propTypes3.accessor.isRequired,
startAccessor: _propTypes3.accessor.isRequired,
endAccessor: _propTypes3.accessor.isRequired,
var EventComponent = components.event;
var DateComponent = components.date;
agendaDateFormat: _propTypes3.dateFormat,
agendaTimeFormat: _propTypes3.dateFormat,
agendaTimeRangeFormat: _propTypes3.dateRangeFormat,
culture: _propTypes2.default.string,
events = events.filter(function (e) {
return (0, _eventLevels.inRange)(e, day, day, _this2.props);
});
components: _propTypes2.default.object.isRequired,
messages: _propTypes2.default.shape({
date: _propTypes2.default.string,
time: _propTypes2.default.string
})
};
Agenda.defaultProps = {
length: 30
};
return events.map(function (event, idx) {
var dateLabel = idx === 0 && _localizer2.default.format(day, agendaDateFormat, culture);
var first = idx === 0 ? _react2.default.createElement(
'td',
{ rowSpan: events.length, className: 'rbc-agenda-date-cell' },
DateComponent ? _react2.default.createElement(DateComponent, { day: day, label: dateLabel }) : dateLabel
) : false;
var title = (0, _accessors.accessor)(event, titleAccessor);
return _react2.default.createElement(
'tr',
{ key: dayKey + '_' + idx },
first,
_react2.default.createElement(
'td',
{ className: 'rbc-agenda-time-cell' },
_this2.timeRangeLabel(day, event)
),
_react2.default.createElement(
'td',
{ className: 'rbc-agenda-event-cell' },
EventComponent ? _react2.default.createElement(EventComponent, { event: event, title: title }) : title
)
);
}, []);
},
timeRangeLabel: function timeRangeLabel(day, event) {
var _props3 = this.props,
endAccessor = _props3.endAccessor,
startAccessor = _props3.startAccessor,
allDayAccessor = _props3.allDayAccessor,
culture = _props3.culture,
messages = _props3.messages,
components = _props3.components;
var labelClass = '',
TimeComponent = components.time,
label = (0, _messages2.default)(messages).allDay;
var start = (0, _accessors.accessor)(event, startAccessor);
var end = (0, _accessors.accessor)(event, endAccessor);
if (!(0, _accessors.accessor)(event, allDayAccessor)) {
if (_dates2.default.eq(start, end, 'day')) {
label = _localizer2.default.format({ start: start, end: end }, this.props.agendaTimeRangeFormat, culture);
} else if (_dates2.default.eq(day, start, 'day')) {
label = _localizer2.default.format(start, this.props.agendaTimeFormat, culture);
} else if (_dates2.default.eq(day, end, 'day')) {
label = _localizer2.default.format(end, this.props.agendaTimeFormat, culture);
}
}
if (_dates2.default.gt(day, start, 'day')) labelClass = 'rbc-continues-prior';
if (_dates2.default.lt(day, end, 'day')) labelClass += ' rbc-continues-after';
return _react2.default.createElement(
'span',
{ className: labelClass.trim() },
TimeComponent ? _react2.default.createElement(TimeComponent, { event: event, label: label }) : label
);
},
_adjustHeader: function _adjustHeader() {
var header = this.refs.header;
var firstRow = this.refs.tbody.firstChild;
if (!firstRow) return;
var isOverflowing = this.refs.content.scrollHeight > this.refs.content.clientHeight;
var widths = this._widths || [];
this._widths = [(0, _width2.default)(firstRow.children[0]), (0, _width2.default)(firstRow.children[1])];
if (widths[0] !== this._widths[0] || widths[1] !== this._widths[1]) {
this.refs.dateCol.style.width = this._widths[0] + 'px';
this.refs.timeCol.style.width = this._widths[1] + 'px';
}
if (isOverflowing) {
_class2.default.addClass(header, 'rbc-header-overflowing');
header.style.marginRight = (0, _scrollbarSize2.default)() + 'px';
} else {
_class2.default.removeClass(header, 'rbc-header-overflowing');
}
}
});
Agenda.navigate = function (date, action) {

@@ -260,0 +279,0 @@ switch (action) {

@@ -5,2 +5,8 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -24,3 +30,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -150,3 +156,4 @@ var _selection = require('./utils/selection');

startIdx: currentCell,
endIdx: currentCell
endIdx: currentCell,
action: 'click'
});

@@ -161,3 +168,3 @@ }

selector.on('select', function () {
_this2._selectSlot(_this2.state);
_this2._selectSlot(_extends({}, _this2.state, { action: 'select' }));
_this2._initial = {};

@@ -177,6 +184,9 @@ _this2.setState({ selecting: false });

var endIdx = _ref.endIdx,
startIdx = _ref.startIdx;
startIdx = _ref.startIdx,
action = _ref.action;
if (endIdx !== -1 && startIdx !== -1) this.props.onSelectSlot && this.props.onSelectSlot({
start: startIdx, end: endIdx
start: startIdx,
end: endIdx,
action: action
});

@@ -189,15 +199,15 @@ };

BackgroundCells.propTypes = {
cellWrapperComponent: _propTypes.elementType,
container: _react2.default.PropTypes.func,
selectable: _react2.default.PropTypes.oneOf([true, false, 'ignoreEvents']),
cellWrapperComponent: _propTypes3.elementType,
container: _propTypes2.default.func,
selectable: _propTypes2.default.oneOf([true, false, 'ignoreEvents']),
onSelectSlot: _react2.default.PropTypes.func.isRequired,
onSelectEnd: _react2.default.PropTypes.func,
onSelectStart: _react2.default.PropTypes.func,
onSelectSlot: _propTypes2.default.func.isRequired,
onSelectEnd: _propTypes2.default.func,
onSelectStart: _propTypes2.default.func,
range: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.instanceOf(Date)),
rtl: _react2.default.PropTypes.bool,
type: _react2.default.PropTypes.string
range: _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(Date)),
rtl: _propTypes2.default.bool,
type: _propTypes2.default.string
};
exports.default = BackgroundCells;
module.exports = exports['default'];

@@ -5,6 +5,10 @@ 'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -22,3 +26,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -77,2 +81,8 @@ var _helpers = require('./utils/helpers');

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; }
function viewNames(_views) {

@@ -108,403 +118,484 @@ return !Array.isArray(_views) ? Object.keys(_views) : _views;

*/
var Calendar = _react2.default.createClass({
displayName: 'Calendar',
var Calendar = function (_React$Component) {
_inherits(Calendar, _React$Component);
propTypes: {
function Calendar() {
var _temp, _this, _ret;
/**
* Props passed to main calendar `<div>`.
*/
elementProps: _react.PropTypes.object,
_classCallCheck(this, Calendar);
/**
* The current date value of the calendar. Determines the visible view range
*
* @controllable onNavigate
*/
date: _react.PropTypes.instanceOf(Date),
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
/**
* The current view of the calendar.
*
* @default 'month'
* @controllable onView
*/
view: _react.PropTypes.string,
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret);
}
/**
* An array of event objects to display on the calendar
*/
events: _react.PropTypes.arrayOf(_react.PropTypes.object),
Calendar.prototype.render = function render() {
var _props = this.props,
view = _props.view,
toolbar = _props.toolbar,
events = _props.events,
culture = _props.culture,
_props$components = _props.components,
components = _props$components === undefined ? {} : _props$components,
_props$formats = _props.formats,
formats = _props$formats === undefined ? {} : _props$formats,
style = _props.style,
className = _props.className,
elementProps = _props.elementProps,
current = _props.date,
props = _objectWithoutProperties(_props, ['view', 'toolbar', 'events', 'culture', 'components', 'formats', 'style', 'className', 'elementProps', 'date']);
/**
* Callback fired when the `date` value changes.
*
* @controllable date
*/
onNavigate: _react.PropTypes.func,
formats = (0, _formats2.default)(formats);
/**
* Callback fired when the `view` value changes.
*
* @controllable date
*/
onView: _react.PropTypes.func,
var View = this.getView();
var names = viewNames(this.props.views);
/**
* A callback fired when a date selection is made. Only fires when `selectable` is `true`.
*
* ```js
* function(
* slotInfo: object {
* start: Date,
* end: Date,
* slots: array<Date>
* }
* )
* ```
*/
onSelectSlot: _react.PropTypes.func,
var viewComponents = (0, _defaults2.default)(components[view] || {}, (0, _omit2.default)(components, names), {
eventWrapper: _EventWrapper2.default,
dayWrapper: _BackgroundWrapper2.default,
dateCellWrapper: _BackgroundWrapper2.default
});
/**
* Callback fired when a calendar event is selected.
*
* ```js
* function(event: object, e: SyntheticEvent)
* ```
*/
onSelectEvent: _react.PropTypes.func,
var ToolbarToRender = components.toolbar || _Toolbar2.default;
/**
* Callback fired when dragging a selection in the Time views.
*
* Returning `false` from the handler will prevent a selection.
*
* ```js
* function ({ start: Date, end: Date }) : boolean
* ```
*/
onSelecting: _react.PropTypes.func,
return _react2.default.createElement(
'div',
_extends({}, elementProps, {
className: (0, _classnames2.default)('rbc-calendar', className, {
'rbc-rtl': props.rtl
}),
style: style
}),
toolbar && _react2.default.createElement(ToolbarToRender, {
date: current,
view: view,
views: names,
label: (0, _viewLabel2.default)(current, view, formats, culture),
onViewChange: this.handleViewChange,
onNavigate: this.handleNavigate,
messages: this.props.messages
}),
_react2.default.createElement(View, _extends({
ref: 'view'
}, props, formats, {
culture: culture,
formats: undefined,
events: events,
date: current,
components: viewComponents,
getDrilldownView: this.getDrilldownView,
onNavigate: this.handleNavigate,
onDrillDown: this.handleDrillDown,
onSelectEvent: this.handleSelectEvent,
onSelectSlot: this.handleSelectSlot,
onShowMore: this._showMore
}))
);
};
/**
* An array of built-in view names to allow the calendar to display.
*
* @type Calendar.views
* @default ['month', 'week', 'day', 'agenda']
*/
views: _propTypes.views,
return Calendar;
}(_react2.default.Component);
/**
* The string name of the destination view for drill-down actions, such
* as clicking a date header, or the truncated events links. If
* `getDrilldownView` is also specified it will be used instead.
*
* Set to `null` to disable drill-down actions.
*
* ```js
* <BigCalendar
* drilldownView="agenda"
* />
* ```
*/
drilldownView: _react2.default.PropTypes.string,
Calendar.propTypes = {
/**
* Functionally equivalent to `drilldownView`, but accepts a function
* that can return a view name. It's useful for customizing the drill-down
* actions depending on the target date and triggering view.
*
* Return `null` to disable drill-down actions.
*
* ```js
* <BigCalendar
* getDrilldownView={(targetDate, currentViewName, configuredViewNames) =>
* if (currentViewName === 'month' && configuredViewNames.includes('week'))
* return 'week'
*
* return null;
* }}
* />
* ```
*/
getDrilldownView: _react2.default.PropTypes.func,
/**
* Props passed to main calendar `<div>`.
*/
elementProps: _propTypes2.default.object,
/**
* Determines whether the toolbar is displayed
*/
toolbar: _react.PropTypes.bool,
/**
* The current date value of the calendar. Determines the visible view range
*
* @controllable onNavigate
*/
date: _propTypes2.default.instanceOf(Date),
/**
* Show truncated events in an overlay when you click the "+_x_ more" link.
*/
popup: _react.PropTypes.bool,
/**
* The current view of the calendar.
*
* @default 'month'
* @controllable onView
*/
view: _propTypes2.default.string,
/**
* Distance in pixels, from the edges of the viewport, the "show more" overlay should be positioned.
*
* ```js
* <BigCalendar popupOffset={30}/>
* <BigCalendar popupOffset={{x: 30, y: 20}}/>
* ```
*/
popupOffset: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.shape({ x: _react.PropTypes.number, y: _react.PropTypes.number })]),
/**
* Allows mouse selection of ranges of dates/times.
*
* The 'ignoreEvents' option prevents selection code from running when a
* drag begins over an event. Useful when you want custom event click or drag
* logic
*/
selectable: _react2.default.PropTypes.oneOf([true, false, 'ignoreEvents']),
/**
* An array of event objects to display on the calendar
*/
events: _propTypes2.default.arrayOf(_propTypes2.default.object),
/**
* Determines the selectable time increments in week and day views
*/
step: _react2.default.PropTypes.number,
/**
* Callback fired when the `date` value changes.
*
* @controllable date
*/
onNavigate: _propTypes2.default.func,
/**
* The number of slots per "section" in the time grid views. Adjust with `step`
* to change the default of 1 hour long groups, with 30 minute slots.
*/
timeslots: _react2.default.PropTypes.number,
/**
* Callback fired when the `view` value changes.
*
* @controllable date
*/
onView: _propTypes2.default.func,
/**
*Switch the calendar to a `right-to-left` read direction.
*/
rtl: _react.PropTypes.bool,
/**
* A callback fired when a date selection is made. Only fires when `selectable` is `true`.
*
* ```js
* function(
* slotInfo: object {
* start: Date,
* end: Date,
* slots: array<Date>,
* action: "select" | "click"
* }
* )
* ```
*/
onSelectSlot: _propTypes2.default.func,
/**
* Callback fired when a calendar event is selected.
*
* ```js
* function(event: object, e: SyntheticEvent)
* ```
*/
onSelectEvent: _propTypes2.default.func,
/**
* Callback fired when dragging a selection in the Time views.
*
* Returning `false` from the handler will prevent a selection.
*
* ```js
* function ({ start: Date, end: Date }) : boolean
* ```
*/
onSelecting: _propTypes2.default.func,
/**
* An array of built-in view names to allow the calendar to display.
*
* @type Calendar.views
* @default ['month', 'week', 'day', 'agenda']
*/
views: _propTypes3.views,
/**
* The string name of the destination view for drill-down actions, such
* as clicking a date header, or the truncated events links. If
* `getDrilldownView` is also specified it will be used instead.
*
* Set to `null` to disable drill-down actions.
*
* ```js
* <BigCalendar
* drilldownView="agenda"
* />
* ```
*/
drilldownView: _propTypes2.default.string,
/**
* Functionally equivalent to `drilldownView`, but accepts a function
* that can return a view name. It's useful for customizing the drill-down
* actions depending on the target date and triggering view.
*
* Return `null` to disable drill-down actions.
*
* ```js
* <BigCalendar
* getDrilldownView={(targetDate, currentViewName, configuredViewNames) =>
* if (currentViewName === 'month' && configuredViewNames.includes('week'))
* return 'week'
*
* return null;
* }}
* />
* ```
*/
getDrilldownView: _propTypes2.default.func,
/**
* Determines whether the toolbar is displayed
*/
toolbar: _propTypes2.default.bool,
/**
* Show truncated events in an overlay when you click the "+_x_ more" link.
*/
popup: _propTypes2.default.bool,
/**
* Distance in pixels, from the edges of the viewport, the "show more" overlay should be positioned.
*
* ```js
* <BigCalendar popupOffset={30}/>
* <BigCalendar popupOffset={{x: 30, y: 20}}/>
* ```
*/
popupOffset: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ x: _propTypes2.default.number, y: _propTypes2.default.number })]),
/**
* Allows mouse selection of ranges of dates/times.
*
* The 'ignoreEvents' option prevents selection code from running when a
* drag begins over an event. Useful when you want custom event click or drag
* logic
*/
selectable: _propTypes2.default.oneOf([true, false, 'ignoreEvents']),
/**
* Determines the selectable time increments in week and day views
*/
step: _propTypes2.default.number,
/**
* The number of slots per "section" in the time grid views. Adjust with `step`
* to change the default of 1 hour long groups, with 30 minute slots.
*/
timeslots: _propTypes2.default.number,
/**
*Switch the calendar to a `right-to-left` read direction.
*/
rtl: _propTypes2.default.bool,
/**
* Optionally provide a function that returns an object of className or style props
* to be applied to the the event node.
*
* ```js
* function(
* event: object,
* start: date,
* end: date,
* isSelected: bool
* ) -> { className: string?, style: object? }
* ```
*/
eventPropGetter: _propTypes2.default.func,
/**
* Accessor for the event title, used to display event information. Should
* resolve to a `renderable` value.
*
* @type {(func|string)}
*/
titleAccessor: _propTypes3.accessor,
/**
* Determines whether the event should be considered an "all day" event and ignore time.
* Must resolve to a `boolean` value.
*
* @type {(func|string)}
*/
allDayAccessor: _propTypes3.accessor,
/**
* The start date/time of the event. Must resolve to a JavaScript `Date` object.
*
* @type {(func|string)}
*/
startAccessor: _propTypes3.accessor,
/**
* The end date/time of the event. Must resolve to a JavaScript `Date` object.
*
* @type {(func|string)}
*/
endAccessor: _propTypes3.accessor,
/**
* Constrains the minimum _time_ of the Day and Week views.
*/
min: _propTypes2.default.instanceOf(Date),
/**
* Constrains the maximum _time_ of the Day and Week views.
*/
max: _propTypes2.default.instanceOf(Date),
/**
* Determines how far down the scroll pane is initially scrolled down.
*/
scrollToTime: _propTypes2.default.instanceOf(Date),
/**
* Specify a specific culture code for the Calendar.
*
* **Note: it's generally better to handle this globally via your i18n library.**
*/
culture: _propTypes2.default.string,
/**
* Localizer specific formats, tell the Calendar how to format and display dates.
*
* `format` types are dependent on the configured localizer; both Moment and Globalize
* accept strings of tokens according to their own specification, such as: `'DD mm yyyy'`.
*
* ```jsx
* let formats = {
* dateFormat: 'dd',
*
* dayFormat: (date, culture, localizer) =>
* localizer.format(date, 'DDD', culture),
*
* dayRangeHeaderFormat: ({ start, end }, culture, local) =>
* local.format(start, { date: 'short' }, culture) + ' — ' +
* local.format(end, { date: 'short' }, culture)
* }
*
* <Calendar formats={formats} />
* ```
*
* All localizers accept a function of
* the form `(date: Date, culture: ?string, localizer: Localizer) -> string`
*/
formats: _propTypes2.default.shape({
/**
* Optionally provide a function that returns an object of className or style props
* to be applied to the the event node.
*
* ```js
* function(
* event: object,
* start: date,
* end: date,
* isSelected: bool
* ) -> { className: string?, style: object? }
* ```
* Format for the day of the month heading in the Month view.
* e.g. "01", "02", "03", etc
*/
eventPropGetter: _react.PropTypes.func,
dateFormat: _propTypes3.dateFormat,
/**
* Accessor for the event title, used to display event information. Should
* resolve to a `renderable` value.
* A day of the week format for Week and Day headings,
* e.g. "Wed 01/04"
*
* @type {(func|string)}
*/
titleAccessor: _propTypes.accessor,
dayFormat: _propTypes3.dateFormat,
/**
* Determines whether the event should be considered an "all day" event and ignore time.
* Must resolve to a `boolean` value.
* Week day name format for the Month week day headings,
* e.g: "Sun", "Mon", "Tue", etc
*
* @type {(func|string)}
*/
allDayAccessor: _propTypes.accessor,
weekdayFormat: _propTypes3.dateFormat,
/**
* The start date/time of the event. Must resolve to a JavaScript `Date` object.
*
* @type {(func|string)}
* The timestamp cell formats in Week and Time views, e.g. "4:00 AM"
*/
startAccessor: _propTypes.accessor,
timeGutterFormat: _propTypes3.dateFormat,
/**
* The end date/time of the event. Must resolve to a JavaScript `Date` object.
* Toolbar header format for the Month view, e.g "2015 April"
*
* @type {(func|string)}
*/
endAccessor: _propTypes.accessor,
monthHeaderFormat: _propTypes3.dateFormat,
/**
* Constrains the minimum _time_ of the Day and Week views.
* Toolbar header format for the Week views, e.g. "Mar 29 - Apr 04"
*/
min: _react.PropTypes.instanceOf(Date),
dayRangeHeaderFormat: _propTypes3.dateRangeFormat,
/**
* Constrains the maximum _time_ of the Day and Week views.
* Toolbar header format for the Day view, e.g. "Wednesday Apr 01"
*/
max: _react.PropTypes.instanceOf(Date),
dayHeaderFormat: _propTypes3.dateFormat,
/**
* Determines how far down the scroll pane is initially scrolled down.
* Toolbar header format for the Agenda view, e.g. "4/1/2015 — 5/1/2015"
*/
scrollToTime: _react.PropTypes.instanceOf(Date),
agendaHeaderFormat: _propTypes3.dateFormat,
/**
* Specify a specific culture code for the Calendar.
*
* **Note: it's generally better to handle this globally via your i18n library.**
* A time range format for selecting time slots, e.g "8:00am — 2:00pm"
*/
culture: _react2.default.PropTypes.string,
selectRangeFormat: _propTypes3.dateRangeFormat,
agendaDateFormat: _propTypes3.dateFormat,
agendaTimeFormat: _propTypes3.dateFormat,
agendaTimeRangeFormat: _propTypes3.dateRangeFormat,
/**
* Localizer specific formats, tell the Calendar how to format and display dates.
*
* `format` types are dependent on the configured localizer; both Moment and Globalize
* accept strings of tokens according to their own specification, such as: `'DD mm yyyy'`.
*
* ```jsx
* let formats = {
* dateFormat: 'dd',
*
* dayFormat: (date, culture, localizer) =>
* localizer.format(date, 'DDD', culture),
*
* dayRangeHeaderFormat: ({ start, end }, culture, local) =>
* local.format(start, { date: 'short' }, culture) + ' — ' +
* local.format(end, { date: 'short' }, culture)
* }
*
* <Calendar formats={formats} />
* ```
*
* All localizers accept a function of
* the form `(date: Date, culture: ?string, localizer: Localizer) -> string`
* Time range displayed on events.
*/
formats: _react.PropTypes.shape({
/**
* Format for the day of the month heading in the Month view.
* e.g. "01", "02", "03", etc
*/
dateFormat: _propTypes.dateFormat,
eventTimeRangeFormat: _propTypes3.dateRangeFormat
}),
/**
* A day of the week format for Week and Day headings,
* e.g. "Wed 01/04"
*
*/
dayFormat: _propTypes.dateFormat,
/**
* 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)
* toolbar: MyToolbar,
* agenda: {
* event: MyAgendaEvent // with the agenda view use a different component to render events
* }
* }
* <Calendar components={components} />
* ```
*/
components: _propTypes2.default.shape({
event: _propTypes3.elementType,
eventWrapper: _propTypes3.elementType,
dayWrapper: _propTypes3.elementType,
dateCellWrapper: _propTypes3.elementType,
/**
* Week day name format for the Month week day headings,
* e.g: "Sun", "Mon", "Tue", etc
*
*/
weekdayFormat: _propTypes.dateFormat,
toolbar: _propTypes3.elementType,
/**
* The timestamp cell formats in Week and Time views, e.g. "4:00 AM"
*/
timeGutterFormat: _propTypes.dateFormat,
agenda: _propTypes2.default.shape({
date: _propTypes3.elementType,
time: _propTypes3.elementType,
event: _propTypes3.elementType
}),
/**
* Toolbar header format for the Month view, e.g "2015 April"
*
*/
monthHeaderFormat: _propTypes.dateFormat,
/**
* Toolbar header format for the Week views, e.g. "Mar 29 - Apr 04"
*/
dayRangeHeaderFormat: _propTypes.dateRangeFormat,
/**
* Toolbar header format for the Day view, e.g. "Wednesday Apr 01"
*/
dayHeaderFormat: _propTypes.dateFormat,
/**
* Toolbar header format for the Agenda view, e.g. "4/1/2015 — 5/1/2015"
*/
agendaHeaderFormat: _propTypes.dateFormat,
/**
* A time range format for selecting time slots, e.g "8:00am — 2:00pm"
*/
selectRangeFormat: _propTypes.dateRangeFormat,
agendaDateFormat: _propTypes.dateFormat,
agendaTimeFormat: _propTypes.dateFormat,
agendaTimeRangeFormat: _propTypes.dateRangeFormat,
/**
* Time range displayed on events.
*/
eventTimeRangeFormat: _propTypes.dateRangeFormat
day: _propTypes2.default.shape({
header: _propTypes3.elementType,
event: _propTypes3.elementType
}),
week: _propTypes2.default.shape({
header: _propTypes3.elementType,
event: _propTypes3.elementType
}),
month: _propTypes2.default.shape({
header: _propTypes3.elementType,
event: _propTypes3.elementType
})
}),
/**
* 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)
* toolbar: MyToolbar,
* agenda: {
* event: MyAgendaEvent // with the agenda view use a different component to render events
* }
* }
* <Calendar components={components} />
* ```
*/
components: _react.PropTypes.shape({
event: _propTypes.elementType,
eventWrapper: _propTypes.elementType,
dayWrapper: _propTypes.elementType,
dateCellWrapper: _propTypes.elementType,
/**
* String messages used throughout the component, override to provide localizations
*/
messages: _propTypes2.default.shape({
allDay: _propTypes2.default.node,
previous: _propTypes2.default.node,
next: _propTypes2.default.node,
today: _propTypes2.default.node,
month: _propTypes2.default.node,
week: _propTypes2.default.node,
day: _propTypes2.default.node,
agenda: _propTypes2.default.node,
showMore: _propTypes2.default.func
})
};
Calendar.defaultProps = {
elementProps: {},
popup: false,
toolbar: true,
view: _constants.views.MONTH,
views: [_constants.views.MONTH, _constants.views.WEEK, _constants.views.DAY, _constants.views.AGENDA],
date: now,
step: 30,
toolbar: _propTypes.elementType,
drilldownView: _constants.views.DAY,
agenda: _react.PropTypes.shape({
date: _propTypes.elementType,
time: _propTypes.elementType,
event: _propTypes.elementType
}),
titleAccessor: 'title',
allDayAccessor: 'allDay',
startAccessor: 'start',
endAccessor: 'end'
};
day: _react.PropTypes.shape({
header: _propTypes.elementType,
event: _propTypes.elementType
}),
week: _react.PropTypes.shape({
header: _propTypes.elementType,
event: _propTypes.elementType
}),
month: _react.PropTypes.shape({
header: _propTypes.elementType,
event: _propTypes.elementType
})
}),
var _initialiseProps = function _initialiseProps() {
var _this2 = this;
/**
* String messages used throughout the component, override to provide localizations
*/
messages: _react.PropTypes.shape({
allDay: _react.PropTypes.node,
previous: _react.PropTypes.node,
next: _react.PropTypes.node,
today: _react.PropTypes.node,
month: _react.PropTypes.node,
week: _react.PropTypes.node,
day: _react.PropTypes.node,
agenda: _react.PropTypes.node,
showMore: _react.PropTypes.func
})
},
this.getViews = function () {
var views = _this2.props.views;
getDefaultProps: function getDefaultProps() {
return {
elementProps: {},
popup: false,
toolbar: true,
view: _constants.views.MONTH,
views: [_constants.views.MONTH, _constants.views.WEEK, _constants.views.DAY, _constants.views.AGENDA],
date: now,
step: 30,
drilldownView: _constants.views.DAY,
titleAccessor: 'title',
allDayAccessor: 'allDay',
startAccessor: 'start',
endAccessor: 'end'
};
},
getViews: function getViews() {
var views = this.props.views;
if (Array.isArray(views)) {

@@ -527,84 +618,24 @@ return (0, _transform2.default)(views, function (obj, name) {

return _Views2.default;
},
getView: function getView() {
var views = this.getViews();
};
return views[this.props.view];
},
getDrilldownView: function getDrilldownView(date) {
var _props = this.props,
view = _props.view,
drilldownView = _props.drilldownView,
getDrilldownView = _props.getDrilldownView;
this.getView = function () {
var views = _this2.getViews();
return views[_this2.props.view];
};
if (!getDrilldownView) return drilldownView;
return getDrilldownView(date, view, Object.keys(this.getViews()));
},
render: function render() {
var _props2 = this.props,
this.getDrilldownView = function (date) {
var _props2 = _this2.props,
view = _props2.view,
toolbar = _props2.toolbar,
events = _props2.events,
culture = _props2.culture,
_props2$components = _props2.components,
components = _props2$components === undefined ? {} : _props2$components,
_props2$formats = _props2.formats,
formats = _props2$formats === undefined ? {} : _props2$formats,
style = _props2.style,
className = _props2.className,
elementProps = _props2.elementProps,
current = _props2.date,
props = _objectWithoutProperties(_props2, ['view', 'toolbar', 'events', 'culture', 'components', 'formats', 'style', 'className', 'elementProps', 'date']);
drilldownView = _props2.drilldownView,
getDrilldownView = _props2.getDrilldownView;
formats = (0, _formats2.default)(formats);
var View = this.getView();
var names = viewNames(this.props.views);
if (!getDrilldownView) return drilldownView;
var viewComponents = (0, _defaults2.default)(components[view] || {}, (0, _omit2.default)(components, names), {
eventWrapper: _EventWrapper2.default,
dayWrapper: _BackgroundWrapper2.default,
dateCellWrapper: _BackgroundWrapper2.default
});
return getDrilldownView(date, view, Object.keys(_this2.getViews()));
};
var ToolbarToRender = components.toolbar || _Toolbar2.default;
return _react2.default.createElement(
'div',
_extends({}, elementProps, {
className: (0, _classnames2.default)('rbc-calendar', className, {
'rbc-rtl': props.rtl
}),
style: style
}),
toolbar && _react2.default.createElement(ToolbarToRender, {
date: current,
view: view,
views: names,
label: (0, _viewLabel2.default)(current, view, formats, culture),
onViewChange: this.handleViewChange,
onNavigate: this.handleNavigate,
messages: this.props.messages
}),
_react2.default.createElement(View, _extends({
ref: 'view'
}, props, formats, {
culture: culture,
formats: undefined,
events: events,
date: current,
components: viewComponents,
getDrilldownView: this.getDrilldownView,
onNavigate: this.handleNavigate,
onDrillDown: this.handleDrillDown,
onSelectEvent: this.handleSelectEvent,
onSelectSlot: this.handleSelectSlot,
onShowMore: this._showMore
}))
);
},
handleNavigate: function handleNavigate(action, newDate) {
var _props3 = this.props,
this.handleNavigate = function (action, newDate) {
var _props3 = _this2.props,
view = _props3.view,

@@ -614,3 +645,3 @@ date = _props3.date,

var ViewComponent = this.getView();
var ViewComponent = _this2.getView();

@@ -620,23 +651,27 @@ date = (0, _move2.default)(action, newDate || date, ViewComponent);

onNavigate(date, view);
},
handleViewChange: function handleViewChange(view) {
if (view !== this.props.view && isValidView(view, this.props)) this.props.onView(view);
},
handleSelectEvent: function handleSelectEvent() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
};
this.handleViewChange = function (view) {
if (view !== _this2.props.view && isValidView(view, _this2.props)) _this2.props.onView(view);
};
this.handleSelectEvent = function () {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
(0, _helpers.notify)(this.props.onSelectEvent, args);
},
handleSelectSlot: function handleSelectSlot(slotInfo) {
(0, _helpers.notify)(this.props.onSelectSlot, slotInfo);
},
handleDrillDown: function handleDrillDown(date, view) {
if (view) this.handleViewChange(view);
(0, _helpers.notify)(_this2.props.onSelectEvent, args);
};
this.handleNavigate(_constants.navigate.DATE, date);
}
});
this.handleSelectSlot = function (slotInfo) {
(0, _helpers.notify)(_this2.props.onSelectSlot, slotInfo);
};
this.handleDrillDown = function (date, view) {
if (view) _this2.handleViewChange(view);
_this2.handleNavigate(_constants.navigate.DATE, date);
};
};
exports.default = (0, _uncontrollable2.default)(Calendar, {

@@ -643,0 +678,0 @@ view: 'onView',

@@ -19,2 +19,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -30,3 +34,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -62,26 +66,26 @@ var _eventLevels2 = require('./utils/eventLevels');

var propTypes = {
events: _react2.default.PropTypes.array.isRequired,
range: _react2.default.PropTypes.array.isRequired,
events: _propTypes2.default.array.isRequired,
range: _propTypes2.default.array.isRequired,
rtl: _react2.default.PropTypes.bool,
renderForMeasure: _react2.default.PropTypes.bool,
renderHeader: _react2.default.PropTypes.func,
rtl: _propTypes2.default.bool,
renderForMeasure: _propTypes2.default.bool,
renderHeader: _propTypes2.default.func,
container: _react2.default.PropTypes.func,
selected: _react2.default.PropTypes.object,
selectable: _react2.default.PropTypes.oneOf([true, false, 'ignoreEvents']),
container: _propTypes2.default.func,
selected: _propTypes2.default.object,
selectable: _propTypes2.default.oneOf([true, false, 'ignoreEvents']),
onShowMore: _react2.default.PropTypes.func,
onSelectSlot: _react2.default.PropTypes.func,
onSelectEnd: _react2.default.PropTypes.func,
onSelectStart: _react2.default.PropTypes.func,
onShowMore: _propTypes2.default.func,
onSelectSlot: _propTypes2.default.func,
onSelectEnd: _propTypes2.default.func,
onSelectStart: _propTypes2.default.func,
startAccessor: _propTypes.accessor.isRequired,
endAccessor: _propTypes.accessor.isRequired,
startAccessor: _propTypes3.accessor.isRequired,
endAccessor: _propTypes3.accessor.isRequired,
dateCellWrapper: _propTypes.elementType,
eventComponent: _propTypes.elementType,
eventWrapperComponent: _propTypes.elementType.isRequired,
minRows: _react2.default.PropTypes.number.isRequired,
maxRows: _react2.default.PropTypes.number.isRequired
dateCellWrapper: _propTypes3.elementType,
eventComponent: _propTypes3.elementType,
eventWrapperComponent: _propTypes3.elementType.isRequired,
minRows: _propTypes2.default.number.isRequired,
maxRows: _propTypes2.default.number.isRequired
};

@@ -88,0 +92,0 @@

@@ -7,2 +7,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -26,11 +30,18 @@

var Day = _react2.default.createClass({
displayName: 'Day',
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; }
propTypes: {
date: _react2.default.PropTypes.instanceOf(Date).isRequired
},
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; }
render: function render() {
var Day = function (_React$Component) {
_inherits(Day, _React$Component);
function Day() {
_classCallCheck(this, Day);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Day.prototype.render = function render() {
var _props = this.props,

@@ -45,5 +56,12 @@ date = _props.date,

return _react2.default.createElement(_TimeGrid2.default, _extends({}, props, { start: start, end: end, eventOffset: 10 }));
}
});
};
return Day;
}(_react2.default.Component);
Day.propTypes = {
date: _propTypes2.default.instanceOf(Date).isRequired
};
Day.navigate = function (date, action) {

@@ -50,0 +68,0 @@ switch (action) {

@@ -7,2 +7,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -34,3 +38,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -51,2 +55,8 @@ var _accessors = require('./utils/accessors');

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; }
function snapToSlot(date, step) {

@@ -61,56 +71,31 @@ var roundTo = 1000 * 60 * step;

var DaySlot = _react2.default.createClass({
displayName: 'DaySlot',
var DaySlot = function (_React$Component) {
_inherits(DaySlot, _React$Component);
function DaySlot() {
var _temp, _this, _ret;
propTypes: {
events: _react2.default.PropTypes.array.isRequired,
step: _react2.default.PropTypes.number.isRequired,
min: _react2.default.PropTypes.instanceOf(Date).isRequired,
max: _react2.default.PropTypes.instanceOf(Date).isRequired,
now: _react2.default.PropTypes.instanceOf(Date),
_classCallCheck(this, DaySlot);
rtl: _react2.default.PropTypes.bool,
titleAccessor: _propTypes.accessor,
allDayAccessor: _propTypes.accessor.isRequired,
startAccessor: _propTypes.accessor.isRequired,
endAccessor: _propTypes.accessor.isRequired,
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
selectRangeFormat: _propTypes.dateFormat,
eventTimeRangeFormat: _propTypes.dateFormat,
culture: _react2.default.PropTypes.string,
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret);
}
selected: _react2.default.PropTypes.object,
selectable: _react2.default.PropTypes.oneOf([true, false, 'ignoreEvents']),
eventOffset: _react2.default.PropTypes.number,
DaySlot.prototype.componentDidMount = function componentDidMount() {
this.props.selectable && this._selectable();
};
onSelecting: _react2.default.PropTypes.func,
onSelectSlot: _react2.default.PropTypes.func.isRequired,
onSelectEvent: _react2.default.PropTypes.func.isRequired,
DaySlot.prototype.componentWillUnmount = function componentWillUnmount() {
this._teardownSelectable();
};
className: _react2.default.PropTypes.string,
dragThroughEvents: _react2.default.PropTypes.bool,
eventPropGetter: _react2.default.PropTypes.func,
dayWrapperComponent: _propTypes.elementType,
eventComponent: _propTypes.elementType,
eventWrapperComponent: _propTypes.elementType.isRequired
},
getDefaultProps: function getDefaultProps() {
return { dragThroughEvents: true };
},
getInitialState: function getInitialState() {
return { selecting: false };
},
componentDidMount: function componentDidMount() {
this.props.selectable && this._selectable();
},
componentWillUnmount: function componentWillUnmount() {
this._teardownSelectable();
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
DaySlot.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps.selectable && !this.props.selectable) this._selectable();
if (!nextProps.selectable && this.props.selectable) this._teardownSelectable();
},
render: function render() {
};
DaySlot.prototype.render = function render() {
var _props = this.props,

@@ -159,7 +144,48 @@ min = _props.min,

);
},
renderEvents: function renderEvents() {
var _this = this;
};
var _props2 = this.props,
return DaySlot;
}(_react2.default.Component);
DaySlot.propTypes = {
events: _propTypes2.default.array.isRequired,
step: _propTypes2.default.number.isRequired,
min: _propTypes2.default.instanceOf(Date).isRequired,
max: _propTypes2.default.instanceOf(Date).isRequired,
now: _propTypes2.default.instanceOf(Date),
rtl: _propTypes2.default.bool,
titleAccessor: _propTypes3.accessor,
allDayAccessor: _propTypes3.accessor.isRequired,
startAccessor: _propTypes3.accessor.isRequired,
endAccessor: _propTypes3.accessor.isRequired,
selectRangeFormat: _propTypes3.dateFormat,
eventTimeRangeFormat: _propTypes3.dateFormat,
culture: _propTypes2.default.string,
selected: _propTypes2.default.object,
selectable: _propTypes2.default.oneOf([true, false, 'ignoreEvents']),
eventOffset: _propTypes2.default.number,
onSelecting: _propTypes2.default.func,
onSelectSlot: _propTypes2.default.func.isRequired,
onSelectEvent: _propTypes2.default.func.isRequired,
className: _propTypes2.default.string,
dragThroughEvents: _propTypes2.default.bool,
eventPropGetter: _propTypes2.default.func,
dayWrapperComponent: _propTypes3.elementType,
eventComponent: _propTypes3.elementType,
eventWrapperComponent: _propTypes3.elementType.isRequired
};
DaySlot.defaultProps = { dragThroughEvents: true };
var _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.state = { selecting: false };
this.renderEvents = function () {
var _props2 = _this2.props,
events = _props2.events,

@@ -184,3 +210,3 @@ min = _props2.min,

var styledEvents = (0, _dayViewLayout2.default)({
events: events, startAccessor: startAccessor, endAccessor: endAccessor, min: min, totalMin: this._totalMin, step: step
events: events, startAccessor: startAccessor, endAccessor: endAccessor, min: min, totalMin: _this2._totalMin, step: step
});

@@ -226,3 +252,3 @@

onClick: function onClick(e) {
return _this._select(event, e);
return _this2._select(event, e);
},

@@ -248,7 +274,8 @@ className: (0, _classnames2.default)('rbc-event', className, {

});
},
_slotStyle: function _slotStyle(startSlot, endSlot) {
var top = startSlot / this._totalMin * 100;
var bottom = endSlot / this._totalMin * 100;
};
this._slotStyle = function (startSlot, endSlot) {
var top = startSlot / _this2._totalMin * 100;
var bottom = endSlot / _this2._totalMin * 100;
return {

@@ -258,8 +285,7 @@ top: top + '%',

};
},
_selectable: function _selectable() {
var _this2 = this;
};
var node = (0, _reactDom.findDOMNode)(this);
var selector = this._selector = new _Selection2.default(function () {
this._selectable = function () {
var node = (0, _reactDom.findDOMNode)(_this2);
var selector = _this2._selector = new _Selection2.default(function () {
return (0, _reactDom.findDOMNode)(_this2);

@@ -330,3 +356,3 @@ });

selector.on('click', function (box) {
if (!(0, _Selection.isEvent)((0, _reactDom.findDOMNode)(_this2), box)) _this2._selectSlot(selectionState(box));
if (!(0, _Selection.isEvent)((0, _reactDom.findDOMNode)(_this2), box)) _this2._selectSlot(_extends({}, selectionState(box), { action: 'click' }));

@@ -338,15 +364,18 @@ _this2.setState({ selecting: false });

if (_this2.state.selecting) {
_this2._selectSlot(_this2.state);
_this2._selectSlot(_extends({}, _this2.state, { action: 'select' }));
_this2.setState({ selecting: false });
}
});
},
_teardownSelectable: function _teardownSelectable() {
if (!this._selector) return;
this._selector.teardown();
this._selector = null;
},
_selectSlot: function _selectSlot(_ref3) {
};
this._teardownSelectable = function () {
if (!_this2._selector) return;
_this2._selector.teardown();
_this2._selector = null;
};
this._selectSlot = function (_ref3) {
var startDate = _ref3.startDate,
endDate = _ref3.endDate;
endDate = _ref3.endDate,
action = _ref3.action;

@@ -358,19 +387,21 @@ var current = startDate,

slots.push(current);
current = _dates2.default.add(current, this.props.step, 'minutes');
current = _dates2.default.add(current, _this2.props.step, 'minutes');
}
(0, _helpers.notify)(this.props.onSelectSlot, {
(0, _helpers.notify)(_this2.props.onSelectSlot, {
slots: slots,
start: startDate,
end: endDate
end: endDate,
action: action
});
},
_select: function _select() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
};
this._select = function () {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
(0, _helpers.notify)(this.props.onSelectEvent, args);
}
});
(0, _helpers.notify)(_this2.props.onSelectEvent, args);
};
};

@@ -377,0 +408,0 @@ function minToDate(min, date) {

@@ -7,2 +7,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -20,3 +24,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -36,16 +40,16 @@ var _accessors = require('./utils/accessors');

var propTypes = {
event: _react2.default.PropTypes.object.isRequired,
slotStart: _react2.default.PropTypes.instanceOf(Date),
slotEnd: _react2.default.PropTypes.instanceOf(Date),
event: _propTypes2.default.object.isRequired,
slotStart: _propTypes2.default.instanceOf(Date),
slotEnd: _propTypes2.default.instanceOf(Date),
selected: _react2.default.PropTypes.bool,
eventPropGetter: _react2.default.PropTypes.func,
titleAccessor: _propTypes.accessor,
allDayAccessor: _propTypes.accessor,
startAccessor: _propTypes.accessor,
endAccessor: _propTypes.accessor,
selected: _propTypes2.default.bool,
eventPropGetter: _propTypes2.default.func,
titleAccessor: _propTypes3.accessor,
allDayAccessor: _propTypes3.accessor,
startAccessor: _propTypes3.accessor,
endAccessor: _propTypes3.accessor,
eventComponent: _propTypes.elementType,
eventWrapperComponent: _propTypes.elementType.isRequired,
onSelect: _react2.default.PropTypes.func
eventComponent: _propTypes3.elementType,
eventWrapperComponent: _propTypes3.elementType.isRequired,
onSelect: _propTypes2.default.func
};

@@ -52,0 +56,0 @@

@@ -5,2 +5,8 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -26,2 +32,8 @@

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; }
var isSegmentInSlot = function isSegmentInSlot(seg, slot) {

@@ -36,16 +48,12 @@ return seg.left <= slot && seg.right >= slot;

var EventRow = _react2.default.createClass({
var EventEndingRow = function (_React$Component) {
_inherits(EventEndingRow, _React$Component);
displayName: 'EventRow',
function EventEndingRow() {
_classCallCheck(this, EventEndingRow);
propTypes: {
segments: _react2.default.PropTypes.array,
slots: _react2.default.PropTypes.number,
messages: _react2.default.PropTypes.object,
onShowMore: _react2.default.PropTypes.func
},
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
mixins: [_EventRowMixin2.default],
render: function render() {
EventEndingRow.prototype.render = function render() {
var _props = this.props,

@@ -80,13 +88,17 @@ segments = _props.segments,

if (this.canRenderSlotEvent(left, span)) {
var content = this.renderEvent(event);
var content = _EventRowMixin2.default.renderEvent(this.props, event);
if (gap) row.push(this.renderSpan(gap, key + '_gap'));
if (gap) {
row.push(_EventRowMixin2.default.renderSpan(this.props, gap, key + '_gap'));
}
row.push(this.renderSpan(span, key, content));
row.push(_EventRowMixin2.default.renderSpan(this.props, span, key, content));
lastEnd = current = right + 1;
} else {
if (gap) row.push(this.renderSpan(gap, key + '_gap'));
if (gap) {
row.push(_EventRowMixin2.default.renderSpan(this.props, gap, key + '_gap'));
}
row.push(this.renderSpan(1, key, this.renderShowMore(segments, current)));
row.push(_EventRowMixin2.default.renderSpan(this.props, 1, key, this.renderShowMore(segments, current)));
lastEnd = current = current + 1;

@@ -101,4 +113,5 @@ }

);
},
canRenderSlotEvent: function canRenderSlotEvent(slot, span) {
};
EventEndingRow.prototype.canRenderSlotEvent = function canRenderSlotEvent(slot, span) {
var segments = this.props.segments;

@@ -112,4 +125,7 @@

});
},
renderShowMore: function renderShowMore(segments, slot) {
};
EventEndingRow.prototype.renderShowMore = function renderShowMore(segments, slot) {
var _this2 = this;
var messages = (0, _messages2.default)(this.props.messages);

@@ -124,14 +140,26 @@ var count = eventsInSlot(segments, slot);

className: 'rbc-show-more',
onClick: this._showMore.bind(null, slot)
onClick: function onClick(e) {
return _this2.showMore(slot, e);
}
},
messages.showMore(count)
) : false;
},
_showMore: function _showMore(slot, e) {
};
EventEndingRow.prototype.showMore = function showMore(slot, e) {
e.preventDefault();
this.props.onShowMore(slot);
}
});
};
exports.default = EventRow;
return EventEndingRow;
}(_react2.default.Component);
EventEndingRow.propTypes = _extends({
segments: _propTypes2.default.array,
slots: _propTypes2.default.number,
messages: _propTypes2.default.object,
onShowMore: _propTypes2.default.func
}, _EventRowMixin2.default.propTypes);
EventEndingRow.defaultProps = _extends({}, _EventRowMixin2.default.defaultProps);
exports.default = EventEndingRow;
module.exports = exports['default'];

@@ -5,2 +5,8 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -16,15 +22,20 @@

var EventRow = _react2.default.createClass({
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
displayName: 'EventRow',
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; }
propTypes: {
segments: _react2.default.PropTypes.array
},
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; }
mixins: [_EventRowMixin2.default],
var EventRow = function (_React$Component) {
_inherits(EventRow, _React$Component);
render: function render() {
var _this = this;
function EventRow() {
_classCallCheck(this, EventRow);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
EventRow.prototype.render = function render() {
var _this2 = this;
var segments = this.props.segments;

@@ -47,7 +58,7 @@

var content = _this.renderEvent(event);
var content = _EventRowMixin2.default.renderEvent(_this2.props, event);
if (gap) row.push(_this.renderSpan(gap, key + '_gap'));
if (gap) row.push(_EventRowMixin2.default.renderSpan(_this2.props, gap, key + '_gap'));
row.push(_this.renderSpan(span, key, content));
row.push(_EventRowMixin2.default.renderSpan(_this2.props, span, key, content));

@@ -59,6 +70,12 @@ lastEnd = right + 1;

);
}
});
};
return EventRow;
}(_react2.default.Component);
EventRow.propTypes = _extends({
segments: _propTypes2.default.array
}, _EventRowMixin2.default.propTypes);
EventRow.defaultProps = _extends({}, _EventRowMixin2.default.defaultProps);
exports.default = EventRow;
module.exports = exports['default'];

@@ -5,2 +5,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -20,3 +24,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -29,42 +33,41 @@ var _eventLevels = require('./utils/eventLevels');

/* eslint-disable react/prop-types */
exports.default = {
propType: {
slots: _react.PropTypes.number.isRequired,
end: _react.PropTypes.instanceOf(Date),
start: _react.PropTypes.instanceOf(Date),
propTypes: {
slots: _propTypes2.default.number.isRequired,
end: _propTypes2.default.instanceOf(Date),
start: _propTypes2.default.instanceOf(Date),
selected: _react.PropTypes.array,
eventPropGetter: _react.PropTypes.func,
titleAccessor: _propTypes.accessor,
allDayAccessor: _propTypes.accessor,
startAccessor: _propTypes.accessor,
endAccessor: _propTypes.accessor,
selected: _propTypes2.default.array,
eventPropGetter: _propTypes2.default.func,
titleAccessor: _propTypes3.accessor,
allDayAccessor: _propTypes3.accessor,
startAccessor: _propTypes3.accessor,
endAccessor: _propTypes3.accessor,
eventComponent: _propTypes.elementType,
eventWrapperComponent: _propTypes.elementType.isRequired,
onSelect: _react2.default.PropTypes.func
eventComponent: _propTypes3.elementType,
eventWrapperComponent: _propTypes3.elementType.isRequired,
onSelect: _propTypes2.default.func
},
getDefaultProps: function getDefaultProps() {
return {
segments: [],
selected: [],
slots: 7
};
defaultProps: {
segments: [],
selected: [],
slots: 7
},
renderEvent: function renderEvent(event) {
var _props = this.props,
eventPropGetter = _props.eventPropGetter,
selected = _props.selected,
start = _props.start,
end = _props.end,
startAccessor = _props.startAccessor,
endAccessor = _props.endAccessor,
titleAccessor = _props.titleAccessor,
allDayAccessor = _props.allDayAccessor,
eventComponent = _props.eventComponent,
eventWrapperComponent = _props.eventWrapperComponent,
onSelect = _props.onSelect;
renderEvent: function renderEvent(props, event) {
var eventPropGetter = props.eventPropGetter,
selected = props.selected,
start = props.start,
end = props.end,
startAccessor = props.startAccessor,
endAccessor = props.endAccessor,
titleAccessor = props.titleAccessor,
allDayAccessor = props.allDayAccessor,
eventComponent = props.eventComponent,
eventWrapperComponent = props.eventWrapperComponent,
onSelect = props.onSelect;
return _react2.default.createElement(_EventCell2.default, {

@@ -85,5 +88,5 @@ event: event,

},
renderSpan: function renderSpan(len, key) {
var content = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ' ';
var slots = this.props.slots;
renderSpan: function renderSpan(props, len, key) {
var content = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ' ';
var slots = props.slots;

@@ -90,0 +93,0 @@

@@ -11,10 +11,25 @@ 'use strict';

var EventWrapper = _react2.default.createClass({
displayName: 'EventWrapper',
render: function render() {
return this.props.children;
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; }
var EventWrapper = function (_React$Component) {
_inherits(EventWrapper, _React$Component);
function EventWrapper() {
_classCallCheck(this, EventWrapper);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
});
EventWrapper.prototype.render = function render() {
return this.props.children;
};
return EventWrapper;
}(_react2.default.Component);
exports.default = EventWrapper;
module.exports = exports['default'];

@@ -5,2 +5,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -23,3 +27,3 @@

Header.propTypes = {
label: _react2.default.PropTypes.node
label: _propTypes2.default.node
};

@@ -26,0 +30,0 @@

@@ -6,4 +6,6 @@ 'use strict';

var _react = require('react');
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _invariant = require('invariant');

@@ -17,3 +19,3 @@

var localePropType = _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]);
var localePropType = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]);

@@ -20,0 +22,0 @@ function _format(localizer, formatter, value, format, culture) {

@@ -46,3 +46,3 @@ 'use strict';

end = _ref2.end;
return local.format(start, 'LT', culture) + ' — ' + local.format(end, 'h:mm', culture);
return local.format(start, 'LT', culture) + ' — ' + local.format(end, 'LT', culture);
};

@@ -49,0 +49,0 @@

@@ -7,2 +7,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -58,3 +62,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -67,2 +71,8 @@ var _eventLevels = require('./utils/eventLevels');

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; }
var eventsForWeek = function eventsForWeek(evts, start, end, props) {

@@ -75,65 +85,72 @@ return evts.filter(function (e) {

var propTypes = {
events: _react2.default.PropTypes.array.isRequired,
date: _react2.default.PropTypes.instanceOf(Date),
events: _propTypes2.default.array.isRequired,
date: _propTypes2.default.instanceOf(Date),
min: _react2.default.PropTypes.instanceOf(Date),
max: _react2.default.PropTypes.instanceOf(Date),
min: _propTypes2.default.instanceOf(Date),
max: _propTypes2.default.instanceOf(Date),
step: _react2.default.PropTypes.number,
now: _react2.default.PropTypes.instanceOf(Date),
step: _propTypes2.default.number,
now: _propTypes2.default.instanceOf(Date),
scrollToTime: _react2.default.PropTypes.instanceOf(Date),
eventPropGetter: _react2.default.PropTypes.func,
scrollToTime: _propTypes2.default.instanceOf(Date),
eventPropGetter: _propTypes2.default.func,
culture: _react2.default.PropTypes.string,
dayFormat: _propTypes.dateFormat,
culture: _propTypes2.default.string,
dayFormat: _propTypes3.dateFormat,
rtl: _react2.default.PropTypes.bool,
width: _react2.default.PropTypes.number,
rtl: _propTypes2.default.bool,
width: _propTypes2.default.number,
titleAccessor: _propTypes.accessor.isRequired,
allDayAccessor: _propTypes.accessor.isRequired,
startAccessor: _propTypes.accessor.isRequired,
endAccessor: _propTypes.accessor.isRequired,
titleAccessor: _propTypes3.accessor.isRequired,
allDayAccessor: _propTypes3.accessor.isRequired,
startAccessor: _propTypes3.accessor.isRequired,
endAccessor: _propTypes3.accessor.isRequired,
selected: _react2.default.PropTypes.object,
selectable: _react2.default.PropTypes.oneOf([true, false, 'ignoreEvents']),
selected: _propTypes2.default.object,
selectable: _propTypes2.default.oneOf([true, false, 'ignoreEvents']),
onNavigate: _react2.default.PropTypes.func,
onSelectSlot: _react2.default.PropTypes.func,
onSelectEvent: _react2.default.PropTypes.func,
onShowMore: _react2.default.PropTypes.func,
onDrillDown: _react2.default.PropTypes.func,
getDrilldownView: _react2.default.PropTypes.func.isRequired,
onNavigate: _propTypes2.default.func,
onSelectSlot: _propTypes2.default.func,
onSelectEvent: _propTypes2.default.func,
onShowMore: _propTypes2.default.func,
onDrillDown: _propTypes2.default.func,
getDrilldownView: _propTypes2.default.func.isRequired,
dateFormat: _propTypes.dateFormat,
dateFormat: _propTypes3.dateFormat,
weekdayFormat: _propTypes.dateFormat,
popup: _react2.default.PropTypes.bool,
weekdayFormat: _propTypes3.dateFormat,
popup: _propTypes2.default.bool,
messages: _react2.default.PropTypes.object,
components: _react2.default.PropTypes.object.isRequired,
popupOffset: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.number, _react2.default.PropTypes.shape({
x: _react2.default.PropTypes.number,
y: _react2.default.PropTypes.number
messages: _propTypes2.default.object,
components: _propTypes2.default.object.isRequired,
popupOffset: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({
x: _propTypes2.default.number,
y: _propTypes2.default.number
})])
};
var MonthView = _react2.default.createClass({
var MonthView = function (_React$Component) {
_inherits(MonthView, _React$Component);
displayName: 'MonthView',
function MonthView() {
_classCallCheck(this, MonthView);
propTypes: propTypes,
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
getInitialState: function getInitialState() {
return {
var _this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args)));
_initialiseProps.call(_this);
_this._bgRows = [];
_this._pendingSelection = [];
_this.state = {
rowLimit: 5,
needLimitMeasure: true
};
},
componentWillMount: function componentWillMount() {
this._bgRows = [];
this._pendingSelection = [];
},
componentWillReceiveProps: function componentWillReceiveProps(_ref) {
return _this;
}
MonthView.prototype.componentWillReceiveProps = function componentWillReceiveProps(_ref) {
var date = _ref.date;

@@ -144,6 +161,7 @@

});
},
componentDidMount: function componentDidMount() {
var _this = this;
};
MonthView.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
var running = void 0;

@@ -157,19 +175,19 @@

running = false;
_this.setState({ needLimitMeasure: true }); //eslint-disable-line
_this2.setState({ needLimitMeasure: true }); //eslint-disable-line
});
}
}, false);
},
componentDidUpdate: function componentDidUpdate() {
};
MonthView.prototype.componentDidUpdate = function componentDidUpdate() {
if (this.state.needLimitMeasure) this.measureRowLimit(this.props);
},
componentWillUnmount: function componentWillUnmount() {
};
MonthView.prototype.componentWillUnmount = function componentWillUnmount() {
window.removeEventListener('resize', this._resizeListener, false);
},
getContainer: function getContainer() {
return (0, _reactDom.findDOMNode)(this);
},
render: function render() {
var _this2 = this;
};
MonthView.prototype.render = function render() {
var _this3 = this;
var _props = this.props,

@@ -191,14 +209,105 @@ date = _props.date,

{ className: 'rbc-row rbc-month-header' },
this._headers(weeks[0], weekdayFormat, culture)
this.renderHeaders(weeks[0], weekdayFormat, culture)
),
weeks.map(function (week, idx) {
return _this2.renderWeek(week, idx);
return _this3.renderWeek(week, idx);
}),
this.props.popup && this._renderOverlay()
this.props.popup && this.renderOverlay()
);
},
renderWeek: function renderWeek(week, weekIdx) {
var _this3 = this;
};
var _props2 = this.props,
MonthView.prototype.renderHeaders = function renderHeaders(row, format, culture) {
var first = row[0];
var last = row[row.length - 1];
var HeaderComponent = this.props.components.header || _Header2.default;
return _dates2.default.range(first, last, 'day').map(function (day, idx) {
return _react2.default.createElement(
'div',
{ key: 'header_' + idx, className: 'rbc-header', style: (0, _eventLevels.segStyle)(1, 7) },
_react2.default.createElement(HeaderComponent, {
date: day,
label: _localizer2.default.format(day, format, culture),
localizer: _localizer2.default,
format: format,
culture: culture
})
);
});
};
MonthView.prototype.renderOverlay = function renderOverlay() {
var _this4 = this;
var overlay = this.state && this.state.overlay || {};
var components = this.props.components;
return _react2.default.createElement(
_Overlay2.default,
{
rootClose: true,
placement: 'bottom',
container: this,
show: !!overlay.position,
onHide: function onHide() {
return _this4.setState({ overlay: null });
}
},
_react2.default.createElement(_Popup2.default, _extends({}, this.props, {
eventComponent: components.event,
eventWrapperComponent: components.eventWrapper,
position: overlay.position,
events: overlay.events,
slotStart: overlay.date,
slotEnd: overlay.end,
onSelect: this.handleSelectEvent
}))
);
};
MonthView.prototype.measureRowLimit = function measureRowLimit() {
this.setState({
needLimitMeasure: false,
rowLimit: this.refs.slotRow.getRowLimit()
});
};
MonthView.prototype.selectDates = function selectDates(slotInfo) {
var slots = this._pendingSelection.slice();
this._pendingSelection = [];
slots.sort(function (a, b) {
return +a - +b;
});
(0, _helpers.notify)(this.props.onSelectSlot, {
slots: slots,
start: slots[0],
end: slots[slots.length - 1],
action: slotInfo.action
});
};
MonthView.prototype.clearSelection = function clearSelection() {
clearTimeout(this._selectTimer);
this._pendingSelection = [];
};
return MonthView;
}(_react2.default.Component);
MonthView.displayName = 'MonthView';
MonthView.propTypes = propTypes;
var _initialiseProps = function _initialiseProps() {
var _this5 = this;
this.getContainer = function () {
return (0, _reactDom.findDOMNode)(_this5);
};
this.renderWeek = function (week, weekIdx) {
var _props2 = _this5.props,
events = _props2.events,

@@ -214,3 +323,3 @@ components = _props2.components,

selected = _props2.selected;
var _state = this.state,
var _state = _this5.state,
needLimitMeasure = _state.needLimitMeasure,

@@ -220,5 +329,5 @@ rowLimit = _state.rowLimit;

events = eventsForWeek(events, week[0], week[week.length - 1], this.props);
events = eventsForWeek(events, week[0], week[week.length - 1], _this5.props);
events.sort(function (a, b) {
return (0, _eventLevels.sortEvents)(a, b, _this3.props);
return (0, _eventLevels.sortEvents)(a, b, _this5.props);
});

@@ -229,3 +338,3 @@

ref: weekIdx === 0 ? 'slotRow' : undefined,
container: this.getContainer,
container: _this5.getContainer,
className: 'rbc-month-row',

@@ -238,3 +347,2 @@ range: week,

messages: messages,
titleAccessor: titleAccessor,

@@ -245,10 +353,7 @@ startAccessor: startAccessor,

eventPropGetter: eventPropGetter,
renderHeader: this.readerDateHeading,
renderHeader: _this5.readerDateHeading,
renderForMeasure: needLimitMeasure,
onShowMore: this.handleShowMore,
onSelect: this.handleSelectEvent,
onSelectSlot: this.handleSelectSlot,
onShowMore: _this5.handleShowMore,
onSelect: _this5.handleSelectEvent,
onSelectSlot: _this5.handleSelectSlot,
eventComponent: components.event,

@@ -258,11 +363,10 @@ eventWrapperComponent: components.eventWrapper,

});
},
readerDateHeading: function readerDateHeading(_ref2) {
var _this4 = this;
};
var date = _ref2.date,
className = _ref2.className,
props = _objectWithoutProperties(_ref2, ['date', 'className']);
this.readerDateHeading = function (_ref3) {
var date = _ref3.date,
className = _ref3.className,
props = _objectWithoutProperties(_ref3, ['date', 'className']);
var _props3 = this.props,
var _props3 = _this5.props,
currentDate = _props3.date,

@@ -289,3 +393,3 @@ getDrilldownView = _props3.getDrilldownView,

onClick: function onClick(e) {
return _this4.handleHeadingClick(date, drilldownView, e);
return _this5.handleHeadingClick(date, drilldownView, e);
}

@@ -300,102 +404,30 @@ },

);
},
_headers: function _headers(row, format, culture) {
var first = row[0];
var last = row[row.length - 1];
var HeaderComponent = this.props.components.header || _Header2.default;
};
return _dates2.default.range(first, last, 'day').map(function (day, idx) {
return _react2.default.createElement(
'div',
{
key: 'header_' + idx,
className: 'rbc-header',
style: (0, _eventLevels.segStyle)(1, 7)
},
_react2.default.createElement(HeaderComponent, {
date: day,
label: _localizer2.default.format(day, format, culture),
localizer: _localizer2.default,
format: format,
culture: culture
})
);
});
},
_renderOverlay: function _renderOverlay() {
var _this5 = this;
this.handleSelectSlot = function (range, slotInfo) {
_this5._pendingSelection = _this5._pendingSelection.concat(range);
var overlay = this.state && this.state.overlay || {};
var components = this.props.components;
return _react2.default.createElement(
_Overlay2.default,
{
rootClose: true,
placement: 'bottom',
container: this,
show: !!overlay.position,
onHide: function onHide() {
return _this5.setState({ overlay: null });
}
},
_react2.default.createElement(_Popup2.default, _extends({}, this.props, {
eventComponent: components.event,
eventWrapperComponent: components.eventWrapper,
position: overlay.position,
events: overlay.events,
slotStart: overlay.date,
slotEnd: overlay.end,
onSelect: this.handleSelectEvent
}))
);
},
measureRowLimit: function measureRowLimit() {
this.setState({
needLimitMeasure: false,
rowLimit: this.refs.slotRow.getRowLimit()
clearTimeout(_this5._selectTimer);
_this5._selectTimer = setTimeout(function () {
return _this5.selectDates(slotInfo);
});
},
handleSelectSlot: function handleSelectSlot(range) {
var _this6 = this;
};
this._pendingSelection = this._pendingSelection.concat(range);
clearTimeout(this._selectTimer);
this._selectTimer = setTimeout(function () {
return _this6._selectDates();
});
},
handleHeadingClick: function handleHeadingClick(date, view, e) {
this.handleHeadingClick = function (date, view, e) {
e.preventDefault();
this.clearSelection();
(0, _helpers.notify)(this.props.onDrillDown, [date, view]);
},
handleSelectEvent: function handleSelectEvent() {
this.clearSelection();
_this5.clearSelection();
(0, _helpers.notify)(_this5.props.onDrillDown, [date, view]);
};
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
this.handleSelectEvent = function () {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
(0, _helpers.notify)(this.props.onSelectEvent, args);
},
_selectDates: function _selectDates() {
var slots = this._pendingSelection.slice();
_this5.clearSelection();
(0, _helpers.notify)(_this5.props.onSelectEvent, args);
};
this._pendingSelection = [];
slots.sort(function (a, b) {
return +a - +b;
});
(0, _helpers.notify)(this.props.onSelectSlot, {
slots: slots,
start: slots[0],
end: slots[slots.length - 1]
});
},
handleShowMore: function handleShowMore(events, date, cell, slot) {
var _props4 = this.props,
this.handleShowMore = function (events, date, cell, slot) {
var _props4 = _this5.props,
popup = _props4.popup,

@@ -407,8 +439,8 @@ onDrillDown = _props4.onDrillDown,

this.clearSelection();
_this5.clearSelection();
if (popup) {
var position = (0, _position2.default)(cell, (0, _reactDom.findDOMNode)(this));
var position = (0, _position2.default)(cell, (0, _reactDom.findDOMNode)(_this5));
this.setState({
_this5.setState({
overlay: { date: date, events: events, position: position }

@@ -421,8 +453,4 @@ });

(0, _helpers.notify)(onShowMore, [events, date, slot]);
},
clearSelection: function clearSelection() {
clearTimeout(this._selectTimer);
this._pendingSelection = [];
}
});
};
};

@@ -442,4 +470,4 @@ MonthView.navigate = function (date, action) {

MonthView.range = function (date, _ref3) {
var culture = _ref3.culture;
MonthView.range = function (date, _ref2) {
var culture = _ref2.culture;

@@ -446,0 +474,0 @@ var start = _dates2.default.firstVisibleDay(date, culture);

@@ -7,2 +7,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -34,3 +38,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -48,9 +52,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var propTypes = {
position: _react2.default.PropTypes.object,
popupOffset: _react2.default.PropTypes.number,
events: _react2.default.PropTypes.array,
selected: _react2.default.PropTypes.object,
eventComponent: _propTypes.elementType,
eventWrapperComponent: _propTypes.elementType,
dayHeaderFormat: _propTypes.dateFormat
position: _propTypes2.default.object,
popupOffset: _propTypes2.default.number,
events: _propTypes2.default.array,
selected: _propTypes2.default.object,
eventComponent: _propTypes3.elementType,
eventWrapperComponent: _propTypes3.elementType,
dayHeaderFormat: _propTypes3.dateFormat
};

@@ -57,0 +61,0 @@

@@ -5,2 +5,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -18,3 +22,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -113,14 +117,14 @@ var _BackgroundWrapper = require('./BackgroundWrapper');

TimeColumn.propTypes = {
step: _react.PropTypes.number.isRequired,
culture: _react.PropTypes.string,
timeslots: _react.PropTypes.number.isRequired,
now: _react.PropTypes.instanceOf(Date).isRequired,
min: _react.PropTypes.instanceOf(Date).isRequired,
max: _react.PropTypes.instanceOf(Date).isRequired,
showLabels: _react.PropTypes.bool,
timeGutterFormat: _react.PropTypes.string,
type: _react.PropTypes.string.isRequired,
className: _react.PropTypes.string,
step: _propTypes2.default.number.isRequired,
culture: _propTypes2.default.string,
timeslots: _propTypes2.default.number.isRequired,
now: _propTypes2.default.instanceOf(Date).isRequired,
min: _propTypes2.default.instanceOf(Date).isRequired,
max: _propTypes2.default.instanceOf(Date).isRequired,
showLabels: _propTypes2.default.bool,
timeGutterFormat: _propTypes2.default.string,
type: _propTypes2.default.string.isRequired,
className: _propTypes2.default.string,
dayWrapperComponent: _propTypes.elementType
dayWrapperComponent: _propTypes3.elementType
};

@@ -127,0 +131,0 @@ TimeColumn.defaultProps = {

@@ -7,2 +7,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -54,3 +58,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -79,3 +83,3 @@ var _helpers = require('./utils/helpers');

_this.handleSelectAllDaySlot = function (slots) {
_this.handleSelectAllDaySlot = function (slots, slotInfo) {
var onSelectSlot = _this.props.onSelectSlot;

@@ -86,3 +90,4 @@

start: slots[0],
end: slots[slots.length - 1]
end: slots[slots.length - 1],
action: slotInfo.action
});

@@ -469,37 +474,37 @@ };

TimeGrid.propTypes = {
events: _react2.default.PropTypes.array.isRequired,
events: _propTypes2.default.array.isRequired,
step: _react2.default.PropTypes.number,
start: _react2.default.PropTypes.instanceOf(Date),
end: _react2.default.PropTypes.instanceOf(Date),
min: _react2.default.PropTypes.instanceOf(Date),
max: _react2.default.PropTypes.instanceOf(Date),
now: _react2.default.PropTypes.instanceOf(Date),
step: _propTypes2.default.number,
start: _propTypes2.default.instanceOf(Date),
end: _propTypes2.default.instanceOf(Date),
min: _propTypes2.default.instanceOf(Date),
max: _propTypes2.default.instanceOf(Date),
now: _propTypes2.default.instanceOf(Date),
scrollToTime: _react2.default.PropTypes.instanceOf(Date),
eventPropGetter: _react2.default.PropTypes.func,
dayFormat: _propTypes.dateFormat,
culture: _react2.default.PropTypes.string,
scrollToTime: _propTypes2.default.instanceOf(Date),
eventPropGetter: _propTypes2.default.func,
dayFormat: _propTypes3.dateFormat,
culture: _propTypes2.default.string,
rtl: _react2.default.PropTypes.bool,
width: _react2.default.PropTypes.number,
rtl: _propTypes2.default.bool,
width: _propTypes2.default.number,
titleAccessor: _propTypes.accessor.isRequired,
allDayAccessor: _propTypes.accessor.isRequired,
startAccessor: _propTypes.accessor.isRequired,
endAccessor: _propTypes.accessor.isRequired,
titleAccessor: _propTypes3.accessor.isRequired,
allDayAccessor: _propTypes3.accessor.isRequired,
startAccessor: _propTypes3.accessor.isRequired,
endAccessor: _propTypes3.accessor.isRequired,
selected: _react2.default.PropTypes.object,
selectable: _react2.default.PropTypes.oneOf([true, false, 'ignoreEvents']),
selected: _propTypes2.default.object,
selectable: _propTypes2.default.oneOf([true, false, 'ignoreEvents']),
onNavigate: _react2.default.PropTypes.func,
onSelectSlot: _react2.default.PropTypes.func,
onSelectEnd: _react2.default.PropTypes.func,
onSelectStart: _react2.default.PropTypes.func,
onSelectEvent: _react2.default.PropTypes.func,
onDrillDown: _react2.default.PropTypes.func,
getDrilldownView: _react2.default.PropTypes.func.isRequired,
onNavigate: _propTypes2.default.func,
onSelectSlot: _propTypes2.default.func,
onSelectEnd: _propTypes2.default.func,
onSelectStart: _propTypes2.default.func,
onSelectEvent: _propTypes2.default.func,
onDrillDown: _propTypes2.default.func,
getDrilldownView: _propTypes2.default.func.isRequired,
messages: _react2.default.PropTypes.object,
components: _react2.default.PropTypes.object.isRequired
messages: _propTypes2.default.object,
components: _propTypes2.default.object.isRequired
};

@@ -506,0 +511,0 @@ TimeGrid.defaultProps = {

@@ -5,2 +5,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -14,3 +18,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -60,8 +64,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

TimeSlot.propTypes = {
dayWrapperComponent: _propTypes.elementType,
value: _react.PropTypes.instanceOf(Date).isRequired,
isNow: _react.PropTypes.bool,
showLabel: _react.PropTypes.bool,
content: _react.PropTypes.string,
culture: _react.PropTypes.string
dayWrapperComponent: _propTypes3.elementType,
value: _propTypes2.default.instanceOf(Date).isRequired,
isNow: _propTypes2.default.bool,
showLabel: _propTypes2.default.bool,
content: _propTypes2.default.string,
culture: _propTypes2.default.string
};

@@ -68,0 +72,0 @@ TimeSlot.defaultProps = {

@@ -5,2 +5,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -22,3 +26,3 @@

var _propTypes = require('./utils/propTypes');
var _propTypes3 = require('./utils/propTypes');

@@ -84,10 +88,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

TimeSlotGroup.propTypes = {
dayWrapperComponent: _propTypes.elementType,
timeslots: _react.PropTypes.number.isRequired,
step: _react.PropTypes.number.isRequired,
value: _react.PropTypes.instanceOf(Date).isRequired,
showLabels: _react.PropTypes.bool,
isNow: _react.PropTypes.bool,
timeGutterFormat: _react.PropTypes.string,
culture: _react.PropTypes.string
dayWrapperComponent: _propTypes3.elementType,
timeslots: _propTypes2.default.number.isRequired,
step: _propTypes2.default.number.isRequired,
value: _propTypes2.default.instanceOf(Date).isRequired,
showLabels: _propTypes2.default.bool,
isNow: _propTypes2.default.bool,
timeGutterFormat: _propTypes2.default.string,
culture: _propTypes2.default.string
};

@@ -94,0 +98,0 @@ TimeSlotGroup.defaultProps = {

@@ -5,2 +5,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -123,10 +127,10 @@

Toolbar.propTypes = {
view: _react2.default.PropTypes.string.isRequired,
views: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.string).isRequired,
label: _react2.default.PropTypes.node.isRequired,
messages: _react2.default.PropTypes.object,
onNavigate: _react2.default.PropTypes.func.isRequired,
onViewChange: _react2.default.PropTypes.func.isRequired
view: _propTypes2.default.string.isRequired,
views: _propTypes2.default.arrayOf(_propTypes2.default.string).isRequired,
label: _propTypes2.default.node.isRequired,
messages: _propTypes2.default.object,
onNavigate: _propTypes2.default.func.isRequired,
onViewChange: _propTypes2.default.func.isRequired
};
exports.default = Toolbar;
module.exports = exports['default'];

@@ -6,4 +6,6 @@ 'use strict';

var _react = require('react');
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _localizer = require('../localizer');

@@ -42,3 +44,3 @@

var eventComponent = exports.eventComponent = _react.PropTypes.oneOfType([_elementType2.default, _react.PropTypes.shape({
var eventComponent = exports.eventComponent = _propTypes2.default.oneOfType([_elementType2.default, _propTypes2.default.shape({
month: _elementType2.default,

@@ -54,3 +56,3 @@ week: _elementType2.default,

var accessor = exports.accessor = _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]);
var accessor = exports.accessor = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]);

@@ -61,3 +63,3 @@ var dateFormat = exports.dateFormat = (0, _createChainableTypeChecker2.default)(function () {

var dateRangeFormat = exports.dateRangeFormat = _react.PropTypes.func;
var dateRangeFormat = exports.dateRangeFormat = _propTypes2.default.func;

@@ -82,3 +84,3 @@ /**

*/
var views = exports.views = _react.PropTypes.oneOfType([_react.PropTypes.arrayOf(_react.PropTypes.oneOf(viewNames)), (0, _all2.default)([_react.PropTypes.object, function (props, name) {
var views = exports.views = _propTypes2.default.oneOfType([_propTypes2.default.arrayOf(_propTypes2.default.oneOf(viewNames)), (0, _all2.default)([_propTypes2.default.object, function (props, name) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {

@@ -85,0 +87,0 @@ args[_key - 2] = arguments[_key];

@@ -7,2 +7,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -30,14 +34,18 @@

var Week = _react2.default.createClass({
displayName: 'Week',
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; }
propTypes: {
date: _react2.default.PropTypes.instanceOf(Date).isRequired
},
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; }
getDefaultProps: function getDefaultProps() {
return _TimeGrid2.default.defaultProps;
},
render: function render() {
var Week = function (_React$Component) {
_inherits(Week, _React$Component);
function Week() {
_classCallCheck(this, Week);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Week.prototype.render = function render() {
var _props = this.props,

@@ -52,5 +60,13 @@ date = _props.date,

return _react2.default.createElement(_TimeGrid2.default, _extends({}, props, { start: start, end: end, eventOffset: 15 }));
}
});
};
return Week;
}(_react2.default.Component);
Week.propTypes = {
date: _propTypes2.default.instanceOf(Date).isRequired
};
Week.defaultProps = _TimeGrid2.default.defaultProps;
Week.navigate = function (date, action) {

@@ -57,0 +73,0 @@ switch (action) {

{
"name": "react-big-calendar",
"version": "0.13.0",
"version": "0.14.0",
"description": "Calendar! with events",

@@ -43,4 +43,4 @@ "author": "Jason Quense <monastic.panic@gmail.com>",

"peerDependencies": {
"react": "^0.14.0 || ^15.0.0",
"react-dom": "^0.14.0 || ^15.0.0"
"react": "^0.14.9 || ^15.3.0",
"react-dom": "^0.14.9 || ^15.3.0"
},

@@ -74,7 +74,7 @@ "devDependencies": {

"postcss-loader": "^0.6.0",
"react": "^15.0.0",
"react": "^15.3.0",
"react-bootstrap": "^0.28.0",
"react-dnd": "^2.1.4",
"react-dnd-html5-backend": "^2.1.2",
"react-dom": "^15.0.0",
"react-dom": "^15.3.0",
"release-script": "^1.0.0",

@@ -93,2 +93,3 @@ "rimraf": "^2.4.2",

"lodash": "^4.17.4",
"prop-types": "^15.5.8",
"react-overlays": "^0.6.0",

@@ -95,0 +96,0 @@ "react-prop-types": "^0.4.0",

@@ -20,3 +20,3 @@ react-big-calendar

* Retrieve dependencies: `npm install`
* Start: `npm run examples [port]` (default port is 3000)
* Start: `npm run examples`
* Open [localhost:3000/examples/index.html](http://localhost:3000/examples/index.html).

@@ -23,0 +23,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc