react-big-calendar
Advanced tools
Comparing version 0.23.0 to 0.24.0
@@ -55,3 +55,3 @@ "use strict"; | ||
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (nextProps.selectable && !this.props.selectable) this._selectable(); | ||
@@ -58,0 +58,0 @@ if (!nextProps.selectable && this.props.selectable) this._teardownSelectable(); |
@@ -24,4 +24,2 @@ "use strict"; | ||
var _warning = _interopRequireDefault(require("warning")); | ||
var _helpers = require("./utils/helpers"); | ||
@@ -143,3 +141,5 @@ | ||
} else { | ||
process.env.NODE_ENV !== "production" ? (0, _warning.default)(true, 'onRangeChange prop not supported for this view') : void 0; | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.error('onRangeChange prop not supported for this view'); | ||
} | ||
} | ||
@@ -221,3 +221,3 @@ } | ||
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
this.setState({ | ||
@@ -239,2 +239,3 @@ context: this.getContext(nextProps) | ||
slotPropGetter = _ref2.slotPropGetter, | ||
slotGroupPropGetter = _ref2.slotGroupPropGetter, | ||
dayPropGetter = _ref2.dayPropGetter, | ||
@@ -263,2 +264,5 @@ view = _ref2.view, | ||
}, | ||
slotGroupProp: function slotGroupProp() { | ||
return slotGroupPropGetter && slotGroupPropGetter.apply(void 0, arguments) || {}; | ||
}, | ||
dayProp: function dayProp() { | ||
@@ -820,3 +824,3 @@ return dayPropGetter && dayPropGetter.apply(void 0, arguments) || {}; | ||
* Optionally provide a function that returns an object of className or style props | ||
* to be applied to the the time-slot node. Caution! Styles that change layout or | ||
* to be applied to the time-slot node. Caution! Styles that change layout or | ||
* position may break the calendar in unexpected ways. | ||
@@ -831,2 +835,11 @@ * | ||
/** | ||
* Optionally provide a function that returns an object of props to be applied | ||
* to the time-slot group node. Useful to dynamically change the sizing of time nodes. | ||
* ```js | ||
* () => { style?: Object } | ||
* ``` | ||
*/ | ||
slotGroupPropGetter: _propTypes.default.func, | ||
/** | ||
* Optionally provide a function that returns an object of className or style props | ||
@@ -833,0 +846,0 @@ * to be applied to the the day background. Caution! Styles that change layout or |
@@ -298,3 +298,3 @@ "use strict"; | ||
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (nextProps.selectable && !this.props.selectable) this._selectable(); | ||
@@ -301,0 +301,0 @@ if (!nextProps.selectable && this.props.selectable) this._teardownSelectable(); |
@@ -6,3 +6,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.Navigate = exports.Views = exports.DateLocalizer = exports.move = exports.globalizeLocalizer = exports.momentLocalizer = exports.Calendar = exports.components = void 0; | ||
exports.Navigate = exports.Views = exports.DateLocalizer = exports.move = exports.dateFnsLocalizer = exports.globalizeLocalizer = exports.momentLocalizer = exports.Calendar = exports.components = void 0; | ||
@@ -29,2 +29,6 @@ var _EventWrapper = _interopRequireDefault(require("./EventWrapper")); | ||
var _dateFns = _interopRequireDefault(require("./localizers/date-fns")); | ||
exports.dateFnsLocalizer = _dateFns.default; | ||
var _move = _interopRequireDefault(require("./utils/move")); | ||
@@ -31,0 +35,0 @@ |
@@ -17,4 +17,2 @@ "use strict"; | ||
var _warning = _interopRequireDefault(require("warning")); | ||
var dateRangeFormat = function dateRangeFormat(_ref, culture, local) { | ||
@@ -101,4 +99,7 @@ var start = _ref.start, | ||
} catch (e) { | ||
process.env.NODE_ENV !== "production" ? (0, _warning.default)(true, "Failed to accurately determine first day of the week.\n Is supplemental data loaded into CLDR?") : void 0; // maybe cldr supplemental is not loaded? revert to original method | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.error('Failed to accurately determine first day of the week.' + ' Is supplemental data loaded into CLDR?'); | ||
} // maybe cldr supplemental is not loaded? revert to original method | ||
var date = new Date(); //cldr-data doesn't seem to be zero based | ||
@@ -105,0 +106,0 @@ |
@@ -221,3 +221,3 @@ "use strict"; | ||
_proto.componentWillReceiveProps = function componentWillReceiveProps(_ref2) { | ||
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(_ref2) { | ||
var date = _ref2.date; | ||
@@ -224,0 +224,0 @@ this.setState({ |
@@ -121,3 +121,3 @@ "use strict"; | ||
_proto.componentWillMount = function componentWillMount() { | ||
_proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() { | ||
this.calculateScroll(); | ||
@@ -154,3 +154,3 @@ }; | ||
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
var _this$props = this.props, | ||
@@ -275,3 +275,4 @@ range = _this$props.range, | ||
components: components, | ||
className: "rbc-time-gutter" | ||
className: "rbc-time-gutter", | ||
getters: getters | ||
}), this.renderEvents(range, rangeEvents, getNow()))); | ||
@@ -278,0 +279,0 @@ }; |
@@ -65,3 +65,3 @@ "use strict"; | ||
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
var min = nextProps.min, | ||
@@ -84,3 +84,4 @@ max = nextProps.max, | ||
resource = _this$props3.resource, | ||
components = _this$props3.components; | ||
components = _this$props3.components, | ||
getters = _this$props3.getters; | ||
return _react.default.createElement("div", { | ||
@@ -94,3 +95,4 @@ className: "rbc-time-gutter rbc-time-column" | ||
components: components, | ||
renderSlot: _this2.renderSlot | ||
renderSlot: _this2.renderSlot, | ||
getters: getters | ||
}); | ||
@@ -111,2 +113,3 @@ })); | ||
components: _propTypes.default.object.isRequired, | ||
getters: _propTypes.default.object, | ||
localizer: _propTypes.default.object.isRequired, | ||
@@ -113,0 +116,0 @@ resource: _propTypes.default.string |
@@ -43,5 +43,6 @@ "use strict"; | ||
Wrapper = _this$props$component2 === void 0 ? _BackgroundWrapper.default : _this$props$component2; | ||
return _react.default.createElement("div", { | ||
var groupProps = getters ? getters.slotGroupProp() : {}; | ||
return _react.default.createElement("div", (0, _extends2.default)({ | ||
className: "rbc-timeslot-group" | ||
}, group.map(function (value, idx) { | ||
}, groupProps), group.map(function (value, idx) { | ||
var slotProps = getters ? getters.slotProp(value, resource) : {}; | ||
@@ -48,0 +49,0 @@ return _react.default.createElement(Wrapper, { |
{ | ||
"name": "react-big-calendar", | ||
"version": "0.23.0", | ||
"version": "0.24.0", | ||
"description": "Calendar! with events", | ||
@@ -140,4 +140,3 @@ "author": { | ||
"react-overlays": "^2.0.0-0", | ||
"uncontrollable": "^7.0.0", | ||
"warning": "^4.0.2" | ||
"uncontrollable": "^7.0.0" | ||
}, | ||
@@ -144,0 +143,0 @@ "resolutions": { |
@@ -54,3 +54,3 @@ # react-big-calendar | ||
endAccessor="end" | ||
style={{height: 500}} | ||
style={{ height: 500 }} | ||
/> | ||
@@ -76,3 +76,3 @@ </div> | ||
endAccessor="end" | ||
style={{height: 500}} | ||
style={{ height: 500 }} | ||
/> | ||
@@ -83,2 +83,34 @@ </div> | ||
#### date-fns 2.0 | ||
```js | ||
import { Calendar, dateFnsLocalizer } from 'react-big-calendar' | ||
import format from 'date-fns/format' | ||
import parse from 'date-fns/parse' | ||
import startOfWeek from 'date-fns/startOfWeek' | ||
import getDay from 'date-fns/getDay' | ||
const locales = { | ||
'en-US': require('date-fns/locale/en-US'), | ||
} | ||
const localizer = dateFnsLocalizer({ | ||
format, | ||
parse, | ||
startOfWeek, | ||
getDay, | ||
locales, | ||
}) | ||
const MyCalendar = props => ( | ||
<div> | ||
<Calendar | ||
localizer={localizer} | ||
events={myEventsList} | ||
startAccessor="start" | ||
endAccessor="end" | ||
style={{ height: 500 }} | ||
/> | ||
</div> | ||
) | ||
``` | ||
## Custom Styling | ||
@@ -85,0 +117,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1133255
13
75
26275
130
- Removedwarning@^4.0.2