Skip to content

Commit

Permalink
fix: bug undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-nathan committed May 13, 2024
1 parent 8970d9d commit b017774
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 41 deletions.
8 changes: 8 additions & 0 deletions dist/react-big-calendar.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4247,6 +4247,14 @@ var ResourceHeader = function ResourceHeader(_ref) {
var label = _ref.label
return /*#__PURE__*/ React.createElement(React.Fragment, null, label)
}
ResourceHeader.propTypes =
process.env.NODE_ENV !== 'production'
? {
label: PropTypes.node,
index: PropTypes.number,
resource: PropTypes.object,
}
: {}

var TimeGridHeader = /*#__PURE__*/ (function (_React$Component) {
_inherits(TimeGridHeader, _React$Component)
Expand Down
6 changes: 0 additions & 6 deletions dist/react-big-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -47708,12 +47708,6 @@
label
)
}
Header.propTypes =
'development' !== 'production'
? {
label: propTypesExports.node,
}
: {}

var DateHeader = function DateHeader(_ref) {
var label = _ref.label,
Expand Down
5 changes: 3 additions & 2 deletions dist/react-big-calendar.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -13924,8 +13924,9 @@
t
)
: le.createElement('span', null, t)
},
gk = ['date', 'className'],
}
mk.propTypes = {}
var gk = ['date', 'className'],
yk = (function (e) {
function t() {
var e
Expand Down
39 changes: 20 additions & 19 deletions lib/CustomWeekEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,27 @@ var DayEvents = function DayEvents(props) {
gap: eventGap,
},
},
Array.from(Array(visibleNumber).keys()).map(function (idx) {
var event = events[idx]
var title = event.title,
color = event.color,
name = event.name,
id = event.id
return /*#__PURE__*/ _react.default.createElement(
'div',
{
className: 'rbc-custom-week-day-event',
key: id,
style: {
width: eventWidth,
background: color,
visibleNumber > 0 &&
Array.from(Array(visibleNumber).keys()).map(function (idx) {
var event = events[idx]
var title = event.title,
color = event.color,
name = event.name,
id = event.id
return /*#__PURE__*/ _react.default.createElement(
'div',
{
className: 'rbc-custom-week-day-event',
key: id,
style: {
width: eventWidth,
background: color,
},
title: name,
},
title: name,
},
title
)
})
title
)
})
)
)
}
Expand Down
10 changes: 10 additions & 0 deletions lib/EventCustomRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var _callSuper2 = _interopRequireDefault(
var _inherits2 = _interopRequireDefault(
require('@babel/runtime/helpers/inherits')
)
var _propTypes = _interopRequireDefault(require('prop-types'))
var _clsx = _interopRequireDefault(require('clsx'))
var _react = _interopRequireDefault(require('react'))
var _EventRowMixin = _interopRequireDefault(require('./EventRowMixin'))
Expand Down Expand Up @@ -73,6 +74,15 @@ var EventCustomRow = /*#__PURE__*/ (function (_React$Component) {
])
return EventCustomRow
})(_react.default.Component)
EventCustomRow.propTypes =
process.env.NODE_ENV !== 'production'
? (0, _objectSpread2.default)(
{
segments: _propTypes.default.array,
},
_EventRowMixin.default.propTypes
)
: {}
EventCustomRow.defaultProps = (0, _objectSpread2.default)(
{},
_EventRowMixin.default.defaultProps
Expand Down
10 changes: 10 additions & 0 deletions lib/EventRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var _callSuper2 = _interopRequireDefault(
var _inherits2 = _interopRequireDefault(
require('@babel/runtime/helpers/inherits')
)
var _propTypes = _interopRequireDefault(require('prop-types'))
var _clsx = _interopRequireDefault(require('clsx'))
var _react = _interopRequireDefault(require('react'))
var _EventRowMixin = _interopRequireDefault(require('./EventRowMixin'))
Expand Down Expand Up @@ -73,6 +74,15 @@ var EventRow = /*#__PURE__*/ (function (_React$Component) {
])
return EventRow
})(_react.default.Component)
EventRow.propTypes =
process.env.NODE_ENV !== 'production'
? (0, _objectSpread2.default)(
{
segments: _propTypes.default.array,
},
_EventRowMixin.default.propTypes
)
: {}
EventRow.defaultProps = (0, _objectSpread2.default)(
{},
_EventRowMixin.default.defaultProps
Expand Down
9 changes: 9 additions & 0 deletions lib/ResourceHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Object.defineProperty(exports, '__esModule', {
value: true,
})
exports.default = void 0
var _propTypes = _interopRequireDefault(require('prop-types'))
var _react = _interopRequireDefault(require('react'))
var ResourceHeader = function ResourceHeader(_ref) {
var label = _ref.label
Expand All @@ -15,4 +16,12 @@ var ResourceHeader = function ResourceHeader(_ref) {
label
)
}
ResourceHeader.propTypes =
process.env.NODE_ENV !== 'production'
? {
label: _propTypes.default.node,
index: _propTypes.default.number,
resource: _propTypes.default.object,
}
: {}
var _default = (exports.default = ResourceHeader)
11 changes: 11 additions & 0 deletions lib/TimeSlotGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var _inherits2 = _interopRequireDefault(
require('@babel/runtime/helpers/inherits')
)
var _clsx = _interopRequireDefault(require('clsx'))
var _propTypes = _interopRequireDefault(require('prop-types'))
var _react = _interopRequireWildcard(require('react'))
var _BackgroundWrapper = _interopRequireDefault(require('./BackgroundWrapper'))
var TimeSlotGroup = (exports.default = /*#__PURE__*/ (function (_Component) {
Expand Down Expand Up @@ -82,3 +83,13 @@ var TimeSlotGroup = (exports.default = /*#__PURE__*/ (function (_Component) {
])
return TimeSlotGroup
})(_react.Component))
TimeSlotGroup.propTypes =
process.env.NODE_ENV !== 'production'
? {
renderSlot: _propTypes.default.func,
group: _propTypes.default.array.isRequired,
resource: _propTypes.default.any,
components: _propTypes.default.object,
getters: _propTypes.default.object,
}
: {}
29 changes: 15 additions & 14 deletions src/CustomWeekEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,22 @@ const DayEvents = (props) => {
className="rbc-custom-week-day-events"
style={{ padding, gap: eventGap }}
>
{Array.from(Array(visibleNumber).keys()).map((idx) => {
const event = events[idx]
{visibleNumber > 0 &&
Array.from(Array(visibleNumber).keys()).map((idx) => {
const event = events[idx]

const { title, color, name, id } = event
return (
<div
className="rbc-custom-week-day-event"
key={id}
style={{ width: eventWidth, background: color }}
title={name}
>
{title}
</div>
)
})}
const { title, color, name, id } = event
return (
<div
className="rbc-custom-week-day-event"
key={id}
style={{ width: eventWidth, background: color }}
title={name}
>
{title}
</div>
)
})}
</div>
</>
)
Expand Down

0 comments on commit b017774

Please sign in to comment.