react-big-schedule 5.4.9-beta.1 → 5.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AgendaView.js +17 -11
- package/dist/components/BodyView.js +4 -2
- package/dist/components/HeaderView.js +5 -3
- package/dist/components/ResourceEvents.js +31 -13
- package/dist/components/ResourceView.js +3 -1
- package/dist/components/SchedulerData.js +49 -4
- package/dist/components/index.js +348 -271
- package/package.json +3 -3
|
@@ -6,15 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _AgendaResourceEvents = _interopRequireDefault(require("./AgendaResourceEvents"));
|
|
9
|
-
var _react = require("react");
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
11
|
function AgendaView(props) {
|
|
19
12
|
var schedulerData = props.schedulerData;
|
|
20
13
|
var config = schedulerData.config,
|
|
@@ -24,10 +17,20 @@ function AgendaView(props) {
|
|
|
24
17
|
var resourceName = schedulerData.isEventPerspective ? config.taskName : config.resourceName;
|
|
25
18
|
var agendaViewHeader = config.agendaViewHeader;
|
|
26
19
|
var resourceEventsList = renderData.map(function (item) {
|
|
27
|
-
return /*#__PURE__*/(0,
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AgendaResourceEvents["default"], {
|
|
28
21
|
resourceEvents: item,
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
schedulerData: schedulerData,
|
|
23
|
+
subtitleGetter: props.subtitleGetter,
|
|
24
|
+
eventItemClick: props.eventItemClick,
|
|
25
|
+
viewEventClick: props.viewEventClick,
|
|
26
|
+
viewEventText: props.viewEventText,
|
|
27
|
+
viewEvent2Click: props.viewEvent2Click,
|
|
28
|
+
viewEvent2Text: props.viewEvent2Text,
|
|
29
|
+
slotClickedFunc: props.slotClickedFunc,
|
|
30
|
+
slotItemTemplateResolver: props.slotItemTemplateResolver,
|
|
31
|
+
eventItemTemplateResolver: props.eventItemTemplateResolver,
|
|
32
|
+
eventItemPopoverTemplateResolver: props.eventItemPopoverTemplateResolver
|
|
33
|
+
}, item.slotId);
|
|
31
34
|
});
|
|
32
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
33
36
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
@@ -64,6 +67,9 @@ AgendaView.propTypes = {
|
|
|
64
67
|
viewEventText: _propTypes["default"].string,
|
|
65
68
|
viewEvent2Click: _propTypes["default"].func,
|
|
66
69
|
viewEvent2Text: _propTypes["default"].string,
|
|
67
|
-
slotClickedFunc: _propTypes["default"].func
|
|
70
|
+
slotClickedFunc: _propTypes["default"].func,
|
|
71
|
+
slotItemTemplateResolver: _propTypes["default"].func,
|
|
72
|
+
eventItemTemplateResolver: _propTypes["default"].func,
|
|
73
|
+
eventItemPopoverTemplateResolver: _propTypes["default"].func
|
|
68
74
|
};
|
|
69
75
|
var _default = exports["default"] = AgendaView;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -54,6 +55,7 @@ function BodyView(_ref) {
|
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
BodyView.propTypes = {
|
|
57
|
-
schedulerData: _propTypes["default"].object.isRequired
|
|
58
|
+
schedulerData: _propTypes["default"].object.isRequired,
|
|
59
|
+
schedulerDataVersion: _propTypes["default"].number
|
|
58
60
|
};
|
|
59
|
-
var _default = exports["default"] = BodyView;
|
|
61
|
+
var _default = exports["default"] = /*#__PURE__*/_react["default"].memo(BodyView);
|
|
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
9
|
var _default2 = require("../config/default");
|
|
9
|
-
var _react = require("react");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
13
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
14
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
@@ -86,7 +87,7 @@ function HeaderView(_ref) {
|
|
|
86
87
|
children: ["W", group.week]
|
|
87
88
|
}, "week-".concat(group.year, "-").concat(group.week, "-").concat(idx));
|
|
88
89
|
});
|
|
89
|
-
}, [showWeekNumber, headers, localeDayjs]);
|
|
90
|
+
}, [showWeekNumber, headers, localeDayjs, config.headerBorderColor]);
|
|
90
91
|
|
|
91
92
|
// Extract common style creation logic
|
|
92
93
|
var createCellStyle = (0, _react.useCallback)(function (item, width, isLastCell) {
|
|
@@ -178,6 +179,7 @@ function HeaderView(_ref) {
|
|
|
178
179
|
}
|
|
179
180
|
HeaderView.propTypes = {
|
|
180
181
|
schedulerData: _propTypes["default"].object.isRequired,
|
|
182
|
+
schedulerDataVersion: _propTypes["default"].number,
|
|
181
183
|
nonAgendaCellHeaderTemplateResolver: _propTypes["default"].func
|
|
182
184
|
};
|
|
183
|
-
var _default = exports["default"] = HeaderView;
|
|
185
|
+
var _default = exports["default"] = /*#__PURE__*/_react["default"].memo(HeaderView);
|
|
@@ -17,12 +17,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
19
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
20
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
22
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
21
23
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
24
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
23
25
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
24
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
26
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
27
27
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
28
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -42,7 +42,7 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
42
42
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
43
43
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
44
44
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
45
|
-
var ResourceEvents = /*#__PURE__*/function (
|
|
45
|
+
var ResourceEvents = /*#__PURE__*/function (_PureComponent) {
|
|
46
46
|
function ResourceEvents(props) {
|
|
47
47
|
var _this;
|
|
48
48
|
_classCallCheck(this, ResourceEvents);
|
|
@@ -270,7 +270,7 @@ var ResourceEvents = /*#__PURE__*/function (_Component) {
|
|
|
270
270
|
_this.supportTouch = false; // 'ontouchstart' in window;
|
|
271
271
|
return _this;
|
|
272
272
|
}
|
|
273
|
-
_inherits(ResourceEvents,
|
|
273
|
+
_inherits(ResourceEvents, _PureComponent);
|
|
274
274
|
return _createClass(ResourceEvents, [{
|
|
275
275
|
key: "componentDidMount",
|
|
276
276
|
value: function componentDidMount() {
|
|
@@ -312,10 +312,11 @@ var ResourceEvents = /*#__PURE__*/function (_Component) {
|
|
|
312
312
|
var cellWidth = schedulerData.getContentCellWidth();
|
|
313
313
|
var cellMaxEvents = schedulerData.getCellMaxEvents();
|
|
314
314
|
var rowWidth = schedulerData.getContentTableWidth();
|
|
315
|
-
var selectedArea = isSelecting ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedArea["default"],
|
|
315
|
+
var selectedArea = isSelecting ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedArea["default"], {
|
|
316
|
+
schedulerData: schedulerData,
|
|
316
317
|
left: left,
|
|
317
318
|
width: width
|
|
318
|
-
})
|
|
319
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
|
|
319
320
|
var eventList = [];
|
|
320
321
|
resourceEvents.headerItems.forEach(function (headerItem, index) {
|
|
321
322
|
if (headerItem.count > 0 || headerItem.summary !== undefined) {
|
|
@@ -372,8 +373,8 @@ var ResourceEvents = /*#__PURE__*/function (_Component) {
|
|
|
372
373
|
_width = evt.span * cellWidth - (index > 0 ? 5 : 6) > 0 ? evt.span * cellWidth - (index > 0 ? 5 : 6) : 0;
|
|
373
374
|
}
|
|
374
375
|
var top = marginTop + idx * config.eventItemLineHeight;
|
|
375
|
-
var eventItem = /*#__PURE__*/(0,
|
|
376
|
-
|
|
376
|
+
var eventItem = /*#__PURE__*/(0, _jsxRuntime.jsx)(_EventItem["default"], {
|
|
377
|
+
schedulerData: schedulerData,
|
|
377
378
|
eventItem: evt.eventItem,
|
|
378
379
|
dndSource: dndSource,
|
|
379
380
|
isStart: isStart,
|
|
@@ -384,7 +385,20 @@ var ResourceEvents = /*#__PURE__*/function (_Component) {
|
|
|
384
385
|
top: top,
|
|
385
386
|
leftIndex: index,
|
|
386
387
|
rightIndex: index + evt.span
|
|
387
|
-
|
|
388
|
+
// Passing through functional props
|
|
389
|
+
,
|
|
390
|
+
eventItemClick: _this2.props.eventItemClick,
|
|
391
|
+
viewEventClick: _this2.props.viewEventClick,
|
|
392
|
+
viewEventText: _this2.props.viewEventText,
|
|
393
|
+
viewEvent2Click: _this2.props.viewEvent2Click,
|
|
394
|
+
viewEvent2Text: _this2.props.viewEvent2Text,
|
|
395
|
+
eventItemTemplateResolver: _this2.props.eventItemTemplateResolver,
|
|
396
|
+
subtitleGetter: _this2.props.subtitleGetter,
|
|
397
|
+
updateEventStart: _this2.props.updateEventStart,
|
|
398
|
+
updateEventEnd: _this2.props.updateEventEnd,
|
|
399
|
+
moveEvent: _this2.props.moveEvent,
|
|
400
|
+
conflictOccurred: _this2.props.conflictOccurred
|
|
401
|
+
});
|
|
388
402
|
eventList.push(eventItem);
|
|
389
403
|
}
|
|
390
404
|
});
|
|
@@ -392,15 +406,18 @@ var ResourceEvents = /*#__PURE__*/function (_Component) {
|
|
|
392
406
|
var _left2 = index * cellWidth + (index > 0 ? 2 : 3);
|
|
393
407
|
var _width2 = cellWidth - (index > 0 ? 5 : 6);
|
|
394
408
|
var top = marginTop + headerItem.addMoreIndex * config.eventItemLineHeight;
|
|
395
|
-
var addMoreItem = /*#__PURE__*/(0,
|
|
396
|
-
|
|
409
|
+
var addMoreItem = /*#__PURE__*/(0, _jsxRuntime.jsx)(_AddMore["default"], {
|
|
410
|
+
schedulerData: schedulerData,
|
|
397
411
|
headerItem: headerItem,
|
|
398
412
|
number: headerItem.addMore,
|
|
399
413
|
left: _left2,
|
|
400
414
|
width: _width2,
|
|
401
415
|
top: top,
|
|
402
416
|
clickAction: _this2.onAddMoreClick
|
|
403
|
-
|
|
417
|
+
// Any specific AddMore requirements
|
|
418
|
+
,
|
|
419
|
+
onSetAddMoreState: _this2.props.onSetAddMoreState
|
|
420
|
+
});
|
|
404
421
|
eventList.push(addMoreItem);
|
|
405
422
|
}
|
|
406
423
|
if (headerItem.summary !== undefined) {
|
|
@@ -437,10 +454,11 @@ var ResourceEvents = /*#__PURE__*/function (_Component) {
|
|
|
437
454
|
});
|
|
438
455
|
}
|
|
439
456
|
}]);
|
|
440
|
-
}(_react.
|
|
457
|
+
}(_react.PureComponent); // Wrapper component to use useDrop hook
|
|
441
458
|
_defineProperty(ResourceEvents, "propTypes", {
|
|
442
459
|
resourceEvents: _propTypes.PropTypes.object.isRequired,
|
|
443
460
|
schedulerData: _propTypes.PropTypes.object.isRequired,
|
|
461
|
+
schedulerDataVersion: _propTypes.PropTypes.number,
|
|
444
462
|
dndSource: _propTypes.PropTypes.object.isRequired,
|
|
445
463
|
onSetAddMoreState: _propTypes.PropTypes.func,
|
|
446
464
|
updateEventStart: _propTypes.PropTypes.func,
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
8
|
var _icons = require("@ant-design/icons");
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -149,10 +150,11 @@ function ResourceView(_ref) {
|
|
|
149
150
|
}
|
|
150
151
|
ResourceView.propTypes = {
|
|
151
152
|
schedulerData: _propTypes["default"].object.isRequired,
|
|
153
|
+
schedulerDataVersion: _propTypes["default"].number,
|
|
152
154
|
contentScrollbarHeight: _propTypes["default"].number.isRequired,
|
|
153
155
|
slotClickedFunc: _propTypes["default"].func,
|
|
154
156
|
slotItemTemplateResolver: _propTypes["default"].func,
|
|
155
157
|
toggleExpandFunc: _propTypes["default"].func,
|
|
156
158
|
CustomResourceCell: _propTypes["default"].func
|
|
157
159
|
};
|
|
158
|
-
var _default = exports["default"] = ResourceView;
|
|
160
|
+
var _default = exports["default"] = /*#__PURE__*/_react["default"].memo(ResourceView);
|
|
@@ -47,6 +47,8 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
47
47
|
this.documentHeight = 0;
|
|
48
48
|
this.schedulerHeaderHeight = 0;
|
|
49
49
|
this._shouldReloadViewType = false;
|
|
50
|
+
this.version = 0;
|
|
51
|
+
this._versionChangeCallback = null;
|
|
50
52
|
this.calendarPopoverLocale = undefined;
|
|
51
53
|
_dayjs["default"].extend(_quarterOfYear["default"]);
|
|
52
54
|
_dayjs["default"].extend(_weekday["default"]);
|
|
@@ -82,6 +84,24 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
82
84
|
this.config.agendaViewHeader = applyIfProvided('agendaViewHeader', this.config.agendaViewHeader);
|
|
83
85
|
this.config.weekNumberLabel = applyIfProvided('weekNumberLabel', this.config.weekNumberLabel);
|
|
84
86
|
}
|
|
87
|
+
}, {
|
|
88
|
+
key: "setVersionChangeNotifier",
|
|
89
|
+
value: function setVersionChangeNotifier(callback) {
|
|
90
|
+
this._versionChangeCallback = typeof callback === 'function' ? callback : null;
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "bumpVersion",
|
|
94
|
+
value: function bumpVersion() {
|
|
95
|
+
this.version += 1;
|
|
96
|
+
if (typeof this._versionChangeCallback === 'function') {
|
|
97
|
+
this._versionChangeCallback(this.version);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "getVersion",
|
|
102
|
+
value: function getVersion() {
|
|
103
|
+
return this.version;
|
|
104
|
+
}
|
|
85
105
|
}, {
|
|
86
106
|
key: "setSchedulerLocale",
|
|
87
107
|
value: function setSchedulerLocale(preset) {
|
|
@@ -105,6 +125,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
105
125
|
this.resources = Array.from(new Set(resources));
|
|
106
126
|
this._createRenderData();
|
|
107
127
|
this.setScrollToSpecialDayjs(true);
|
|
128
|
+
this.bumpVersion();
|
|
108
129
|
}
|
|
109
130
|
}, {
|
|
110
131
|
key: "setEventGroupsAutoGenerated",
|
|
@@ -121,6 +142,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
121
142
|
this.eventGroupsAutoGenerated = false;
|
|
122
143
|
this._createRenderData();
|
|
123
144
|
this.setScrollToSpecialDayjs(true);
|
|
145
|
+
this.bumpVersion();
|
|
124
146
|
}
|
|
125
147
|
}, {
|
|
126
148
|
key: "setMinuteStep",
|
|
@@ -130,6 +152,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
130
152
|
this.config.minuteStep = minuteStep;
|
|
131
153
|
this._createHeaders();
|
|
132
154
|
this._createRenderData();
|
|
155
|
+
this.bumpVersion();
|
|
133
156
|
}
|
|
134
157
|
}
|
|
135
158
|
}, {
|
|
@@ -160,6 +183,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
160
183
|
if (existedResources.length === 0) {
|
|
161
184
|
this.resources.push(resource);
|
|
162
185
|
this._createRenderData();
|
|
186
|
+
this.bumpVersion();
|
|
163
187
|
}
|
|
164
188
|
}
|
|
165
189
|
}, {
|
|
@@ -171,6 +195,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
171
195
|
if (existedEventGroups.length === 0) {
|
|
172
196
|
this.eventGroups.push(eventGroup);
|
|
173
197
|
this._createRenderData();
|
|
198
|
+
this.bumpVersion();
|
|
174
199
|
}
|
|
175
200
|
}
|
|
176
201
|
}, {
|
|
@@ -180,7 +205,10 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
180
205
|
this.eventGroups.forEach(function (item, idx) {
|
|
181
206
|
if (item.id === eventGroupId) index = idx;
|
|
182
207
|
});
|
|
183
|
-
if (index !== -1)
|
|
208
|
+
if (index !== -1) {
|
|
209
|
+
this.eventGroups.splice(index, 1);
|
|
210
|
+
this.bumpVersion();
|
|
211
|
+
}
|
|
184
212
|
}
|
|
185
213
|
}, {
|
|
186
214
|
key: "containsEventGroupId",
|
|
@@ -199,6 +227,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
199
227
|
if (this.eventGroupsAutoGenerated) this._generateEventGroups();
|
|
200
228
|
if (this.config.recurringEventsEnabled) this._handleRecurringEvents();
|
|
201
229
|
this._createRenderData();
|
|
230
|
+
this.bumpVersion();
|
|
202
231
|
}
|
|
203
232
|
}, {
|
|
204
233
|
key: "setScrollToSpecialDayjs",
|
|
@@ -212,6 +241,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
212
241
|
this.events = [];
|
|
213
242
|
this._createHeaders();
|
|
214
243
|
this._createRenderData();
|
|
244
|
+
this.bumpVersion();
|
|
215
245
|
}
|
|
216
246
|
}, {
|
|
217
247
|
key: "next",
|
|
@@ -220,6 +250,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
220
250
|
this.events = [];
|
|
221
251
|
this._createHeaders();
|
|
222
252
|
this._createRenderData();
|
|
253
|
+
this.bumpVersion();
|
|
223
254
|
}
|
|
224
255
|
}, {
|
|
225
256
|
key: "setDate",
|
|
@@ -229,6 +260,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
229
260
|
this.events = [];
|
|
230
261
|
this._createHeaders();
|
|
231
262
|
this._createRenderData();
|
|
263
|
+
this.bumpVersion();
|
|
232
264
|
}
|
|
233
265
|
}, {
|
|
234
266
|
key: "setViewType",
|
|
@@ -294,6 +326,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
294
326
|
this._createHeaders();
|
|
295
327
|
this._createRenderData();
|
|
296
328
|
this.setScrollToSpecialDayjs(true);
|
|
329
|
+
this.bumpVersion();
|
|
297
330
|
}
|
|
298
331
|
}
|
|
299
332
|
}, {
|
|
@@ -338,6 +371,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
338
371
|
slotEntered = false;
|
|
339
372
|
}
|
|
340
373
|
});
|
|
374
|
+
this.bumpVersion();
|
|
341
375
|
}
|
|
342
376
|
}, {
|
|
343
377
|
key: "isResourceViewResponsive",
|
|
@@ -486,6 +520,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
486
520
|
this._attachEvent(newEvent);
|
|
487
521
|
if (this.eventGroupsAutoGenerated) this._generateEventGroups();
|
|
488
522
|
this._createRenderData();
|
|
523
|
+
this.bumpVersion();
|
|
489
524
|
}
|
|
490
525
|
}, {
|
|
491
526
|
key: "updateEventStart",
|
|
@@ -494,12 +529,14 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
494
529
|
event.start = newStart;
|
|
495
530
|
this._attachEvent(event);
|
|
496
531
|
this._createRenderData();
|
|
532
|
+
this.bumpVersion();
|
|
497
533
|
}
|
|
498
534
|
}, {
|
|
499
535
|
key: "updateEventEnd",
|
|
500
536
|
value: function updateEventEnd(event, newEnd) {
|
|
501
537
|
event.end = newEnd;
|
|
502
538
|
this._createRenderData();
|
|
539
|
+
this.bumpVersion();
|
|
503
540
|
}
|
|
504
541
|
}, {
|
|
505
542
|
key: "swapEvent",
|
|
@@ -531,6 +568,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
531
568
|
this._attachEvent(eventSource);
|
|
532
569
|
this._attachEvent(eventDest);
|
|
533
570
|
this._createRenderData();
|
|
571
|
+
this.bumpVersion();
|
|
534
572
|
}
|
|
535
573
|
}, {
|
|
536
574
|
key: "swapEvent2",
|
|
@@ -555,6 +593,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
555
593
|
this._attachEvent(tempEventSource);
|
|
556
594
|
this._attachEvent(tempEventDest);
|
|
557
595
|
this._createRenderData();
|
|
596
|
+
this.bumpVersion();
|
|
558
597
|
}
|
|
559
598
|
}, {
|
|
560
599
|
key: "moveEvent",
|
|
@@ -568,6 +607,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
568
607
|
event.start = newStart;
|
|
569
608
|
this._attachEvent(event);
|
|
570
609
|
this._createRenderData();
|
|
610
|
+
this.bumpVersion();
|
|
571
611
|
}
|
|
572
612
|
}, {
|
|
573
613
|
key: "isEventInTimeWindow",
|
|
@@ -581,6 +621,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
581
621
|
if (index !== -1) {
|
|
582
622
|
this.events.splice(index, 1);
|
|
583
623
|
this._createRenderData();
|
|
624
|
+
this.bumpVersion();
|
|
584
625
|
}
|
|
585
626
|
}
|
|
586
627
|
}, {
|
|
@@ -593,6 +634,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
593
634
|
if (index !== -1) {
|
|
594
635
|
this.events.splice(index, 1);
|
|
595
636
|
this._createRenderData();
|
|
637
|
+
this.bumpVersion();
|
|
596
638
|
}
|
|
597
639
|
}
|
|
598
640
|
}, {
|
|
@@ -615,22 +657,25 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
|
|
|
615
657
|
}, {
|
|
616
658
|
key: "_setDocumentWidth",
|
|
617
659
|
value: function _setDocumentWidth(documentWidth) {
|
|
618
|
-
if (documentWidth >= 0) {
|
|
660
|
+
if (documentWidth >= 0 && documentWidth !== this.documentWidth) {
|
|
619
661
|
this.documentWidth = documentWidth;
|
|
662
|
+
this.bumpVersion();
|
|
620
663
|
}
|
|
621
664
|
}
|
|
622
665
|
}, {
|
|
623
666
|
key: "_setDocumentHeight",
|
|
624
667
|
value: function _setDocumentHeight(documentHeight) {
|
|
625
|
-
if (documentHeight >= 0) {
|
|
668
|
+
if (documentHeight >= 0 && documentHeight !== this.documentHeight) {
|
|
626
669
|
this.documentHeight = documentHeight;
|
|
670
|
+
this.bumpVersion();
|
|
627
671
|
}
|
|
628
672
|
}
|
|
629
673
|
}, {
|
|
630
674
|
key: "_setSchedulerHeaderHeight",
|
|
631
675
|
value: function _setSchedulerHeaderHeight(schedulerHeaderHeight) {
|
|
632
|
-
if (schedulerHeaderHeight >= 0) {
|
|
676
|
+
if (schedulerHeaderHeight >= 0 && schedulerHeaderHeight !== this.schedulerHeaderHeight) {
|
|
633
677
|
this.schedulerHeaderHeight = schedulerHeaderHeight;
|
|
678
|
+
this.bumpVersion();
|
|
634
679
|
}
|
|
635
680
|
}
|
|
636
681
|
}, {
|
package/dist/components/index.js
CHANGED
|
@@ -102,28 +102,96 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
102
102
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
103
103
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
104
104
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
105
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
106
|
-
|
|
105
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
106
|
+
var initDndContext = function initDndContext(schedulerData, dndSources) {
|
|
107
|
+
var sources = [];
|
|
108
|
+
sources.push(new _DnDSource["default"](function (dndProps) {
|
|
109
|
+
return dndProps.eventItem;
|
|
110
|
+
}, schedulerData.config.dragAndDropEnabled));
|
|
111
|
+
if (dndSources !== undefined && dndSources.length > 0) {
|
|
112
|
+
sources = [].concat(_toConsumableArray(sources), _toConsumableArray(dndSources));
|
|
113
|
+
}
|
|
114
|
+
return new _DnDContext["default"](sources);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Renders the scheduler UI with resource and agenda views, responsive sizing, and drag-and-drop support.
|
|
119
|
+
* Optimized to minimize unnecessary re-renders through memoized callbacks, stable refs, and
|
|
120
|
+
* selectively updated state.
|
|
107
121
|
*
|
|
108
122
|
* @param {object} props - Component properties.
|
|
109
|
-
* @param {SchedulerData} props.schedulerData -
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* @param {function(SchedulerData
|
|
117
|
-
*
|
|
118
|
-
* @param {function(SchedulerData
|
|
119
|
-
*
|
|
120
|
-
* @param {
|
|
121
|
-
*
|
|
122
|
-
* @param {function}
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
123
|
+
* @param {SchedulerData} props.schedulerData - The view model driving all scheduler state,
|
|
124
|
+
* configuration, layout data, and rendering logic.
|
|
125
|
+
* @param {Array<DnDSource>} [props.dndSources] - Additional drag-and-drop sources merged into
|
|
126
|
+
* the scheduler's DnD context on first mount. The DnD context is initialized once and never rebuilt.
|
|
127
|
+
* @param {React.RefObject<HTMLElement>} [props.parentRef] - Ref to the parent container element.
|
|
128
|
+
* When provided alongside `responsiveByParent: true` in config, a ResizeObserver tracks the
|
|
129
|
+
* parent's dimensions and triggers layout updates instead of listening to the window resize event.
|
|
130
|
+
* @param {function(SchedulerData):void} props.prevClick - Callback invoked when the user navigates
|
|
131
|
+
* to the previous time range.
|
|
132
|
+
* @param {function(SchedulerData):void} props.nextClick - Callback invoked when the user navigates
|
|
133
|
+
* to the next time range.
|
|
134
|
+
* @param {function(SchedulerData, object):void} props.onViewChange - Callback invoked when the
|
|
135
|
+
* view type, agenda toggle, or event perspective changes.
|
|
136
|
+
* @param {function(SchedulerData, string|Date):void} props.onSelectDate - Callback invoked when
|
|
137
|
+
* the user selects a new date from the calendar popover.
|
|
138
|
+
* @param {function(SchedulerData, object):void} [props.onSetAddMoreState] - Callback invoked when
|
|
139
|
+
* a '+N more' overflow indicator is clicked, used to control the AddMorePopover visibility and position.
|
|
140
|
+
* @param {function(SchedulerData, object, string):void} [props.updateEventStart] - Callback invoked
|
|
141
|
+
* when the user resizes the start of an event.
|
|
142
|
+
* @param {function(SchedulerData, object, string):void} [props.updateEventEnd] - Callback invoked
|
|
143
|
+
* when the user resizes the end of an event.
|
|
144
|
+
* @param {function(SchedulerData, object, string, string, string, string):void} [props.moveEvent] -
|
|
145
|
+
* Callback invoked when an event is dragged to a new slot or time range.
|
|
146
|
+
* @param {function} [props.movingEvent] - Callback invoked continuously while an event is being dragged.
|
|
147
|
+
* * @param {function(SchedulerData, object, string, string, string, string, string, string):void}
|
|
148
|
+
* [props.conflictOccurred] -
|
|
149
|
+
* Callback invoked when a scheduling conflict is detected during create, move, or resize.
|
|
150
|
+
* @param {function(SchedulerData, object):string} [props.subtitleGetter] - Returns a subtitle string
|
|
151
|
+
* displayed in the event item popover.
|
|
152
|
+
* @param {function(SchedulerData, object):void} [props.eventItemClick] - Callback invoked when an
|
|
153
|
+
* event item is clicked.
|
|
154
|
+
* @param {function(SchedulerData, object):void} [props.viewEventClick] - Callback invoked when the
|
|
155
|
+
* primary action link in the event popover is clicked.
|
|
156
|
+
* @param {string} [props.viewEventText] - Label text for the primary action link in the event popover.
|
|
157
|
+
* @param {function(SchedulerData, object):void} [props.viewEvent2Click] - Callback invoked when the
|
|
158
|
+
* secondary action link in the event popover is clicked.
|
|
159
|
+
* @param {string} [props.viewEvent2Text] - Label text for the secondary action link in the event popover.
|
|
160
|
+
* @param {function(SchedulerData, string, string, string, string, string, object):void} [props.newEvent] -
|
|
161
|
+
* Callback invoked when a new event is created by clicking and dragging on an empty cell, or when
|
|
162
|
+
* an external item is dropped into the scheduler.
|
|
163
|
+
* @param {function} [props.eventItemTemplateResolver] - Returns a custom JSX element used to render
|
|
164
|
+
* each event item, overriding the default appearance.
|
|
165
|
+
* @param {function(SchedulerData, object):void} [props.slotClickedFunc] - Callback invoked when a
|
|
166
|
+
* resource slot label in the left column is clicked.
|
|
167
|
+
* @param {function(SchedulerData, string):void} [props.toggleExpandFunc] - Callback invoked when a
|
|
168
|
+
* parent resource slot's expand or collapse control is clicked.
|
|
169
|
+
* @param {function} [props.slotItemTemplateResolver] - Returns a custom JSX element used to render
|
|
170
|
+
* each resource slot cell in the left column.
|
|
171
|
+
* @param {function} [props.nonAgendaCellHeaderTemplateResolver] - Returns a custom JSX element used
|
|
172
|
+
* to render individual header cells in the timeline header row.
|
|
173
|
+
* @param {function(SchedulerData, HTMLElement, number):void} [props.onScrollLeft] - Callback invoked
|
|
174
|
+
* when the scheduler content is scrolled to the leftmost position.
|
|
175
|
+
* @param {function(SchedulerData, HTMLElement, number):void} [props.onScrollRight] - Callback invoked
|
|
176
|
+
* when the scheduler content is scrolled to the rightmost position.
|
|
177
|
+
* @param {function(SchedulerData, HTMLElement, number):void} [props.onScrollTop] - Callback invoked
|
|
178
|
+
* when the scheduler content is scrolled to the topmost position.
|
|
179
|
+
* @param {function(SchedulerData, HTMLElement, number):void} [props.onScrollBottom] - Callback invoked
|
|
180
|
+
* when the scheduler content is scrolled to the bottommost position.
|
|
181
|
+
* @param {React.ReactNode} [props.leftCustomHeader] - Custom content rendered on the left side of
|
|
182
|
+
* the scheduler header toolbar.
|
|
183
|
+
* @param {React.ReactNode} [props.rightCustomHeader] - Custom content rendered on the right side of
|
|
184
|
+
* the scheduler header toolbar.
|
|
185
|
+
* @param {function} [props.CustomResourceHeader] - Optional component rendered inside the resource
|
|
186
|
+
* column header cell, replacing the default resource name label.
|
|
187
|
+
* @param {function} [props.CustomResourceCell] - Optional component rendered inside each resource
|
|
188
|
+
* slot cell in the left column.
|
|
189
|
+
* @param {object} [props.configTableHeaderStyle] - Optional inline style object merged into the
|
|
190
|
+
* resource column header container, used to override default header styling.
|
|
191
|
+
* @returns {JSX.Element} The root scheduler table element containing the header toolbar, resource
|
|
192
|
+
* column, timeline header, and all resource event rows.
|
|
126
193
|
*/
|
|
194
|
+
|
|
127
195
|
function Scheduler(props) {
|
|
128
196
|
var schedulerData = props.schedulerData,
|
|
129
197
|
dndSources = props.dndSources,
|
|
@@ -135,184 +203,143 @@ function Scheduler(props) {
|
|
|
135
203
|
leftCustomHeader = props.leftCustomHeader,
|
|
136
204
|
rightCustomHeader = props.rightCustomHeader,
|
|
137
205
|
CustomResourceHeader = props.CustomResourceHeader,
|
|
138
|
-
configTableHeaderStyle = props.configTableHeaderStyle
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return
|
|
145
|
-
}, schedulerData.config.dragAndDropEnabled));
|
|
146
|
-
if (dndSources !== undefined && dndSources.length > 0) {
|
|
147
|
-
sources = [].concat(_toConsumableArray(sources), _toConsumableArray(dndSources));
|
|
148
|
-
}
|
|
149
|
-
return new _DnDContext["default"](sources);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
// State initialization
|
|
153
|
-
var _useState = (0, _react.useState)({
|
|
154
|
-
dndContext: initDndContext(),
|
|
155
|
-
contentScrollbarHeight: 17,
|
|
156
|
-
contentScrollbarWidth: 17,
|
|
157
|
-
resourceScrollbarHeight: 17,
|
|
158
|
-
resourceScrollbarWidth: 17,
|
|
159
|
-
documentWidth: 0,
|
|
160
|
-
documentHeight: 0,
|
|
161
|
-
headerHeight: 0
|
|
206
|
+
configTableHeaderStyle = props.configTableHeaderStyle,
|
|
207
|
+
onScrollLeft = props.onScrollLeft,
|
|
208
|
+
onScrollRight = props.onScrollRight,
|
|
209
|
+
onScrollTop = props.onScrollTop,
|
|
210
|
+
onScrollBottom = props.onScrollBottom;
|
|
211
|
+
var _useState = (0, _react.useState)(function () {
|
|
212
|
+
return initDndContext(schedulerData, dndSources);
|
|
162
213
|
}),
|
|
163
|
-
_useState2 = _slicedToArray(_useState,
|
|
164
|
-
|
|
165
|
-
|
|
214
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
215
|
+
dndContext = _useState2[0];
|
|
216
|
+
var _useState3 = (0, _react.useState)(17),
|
|
217
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
218
|
+
contentScrollbarHeight = _useState4[0],
|
|
219
|
+
setContentScrollbarHeight = _useState4[1];
|
|
220
|
+
var _useState5 = (0, _react.useState)(17),
|
|
221
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
222
|
+
contentScrollbarWidth = _useState6[0],
|
|
223
|
+
setContentScrollbarWidth = _useState6[1];
|
|
224
|
+
var _useState7 = (0, _react.useState)(17),
|
|
225
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
226
|
+
resourceScrollbarHeight = _useState8[0],
|
|
227
|
+
setResourceScrollbarHeight = _useState8[1];
|
|
228
|
+
var _useState9 = (0, _react.useState)(17),
|
|
229
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
230
|
+
resourceScrollbarWidth = _useState0[0],
|
|
231
|
+
setResourceScrollbarWidth = _useState0[1];
|
|
232
|
+
var _useState1 = (0, _react.useState)(0),
|
|
233
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
234
|
+
setRenderTrigger = _useState10[1];
|
|
166
235
|
|
|
167
|
-
//
|
|
168
|
-
var currentAreaRef = (0, _react.useRef)(-1);
|
|
169
|
-
var scrollLeftRef = (0, _react.useRef)(0);
|
|
170
|
-
var scrollTopRef = (0, _react.useRef)(0);
|
|
236
|
+
// Scroll sync refs
|
|
171
237
|
var schedulerHeadRef = (0, _react.useRef)(null);
|
|
172
|
-
var schedulerHeaderRef = (0, _react.useRef)(null);
|
|
173
238
|
var schedulerResourceRef = (0, _react.useRef)(null);
|
|
174
239
|
var schedulerContentRef = (0, _react.useRef)(null);
|
|
175
240
|
var schedulerContentBgTableRef = (0, _react.useRef)(null);
|
|
241
|
+
|
|
242
|
+
// Layout/header refs
|
|
243
|
+
var schedulerHeaderRef = (0, _react.useRef)(null);
|
|
244
|
+
|
|
245
|
+
// Observer refs
|
|
176
246
|
var ulObserverRef = (0, _react.useRef)(null);
|
|
177
247
|
var headerObserverRef = (0, _react.useRef)(null);
|
|
178
248
|
|
|
179
|
-
//
|
|
249
|
+
// Scroll position tracking
|
|
250
|
+
var currentAreaRef = (0, _react.useRef)(-1);
|
|
251
|
+
var scrollLeftRef = (0, _react.useRef)(0);
|
|
252
|
+
var scrollTopRef = (0, _react.useRef)(0);
|
|
253
|
+
var scrollbarSizeRef = (0, _react.useRef)({
|
|
254
|
+
contentScrollbarHeight: 17,
|
|
255
|
+
contentScrollbarWidth: 17,
|
|
256
|
+
resourceScrollbarHeight: 17,
|
|
257
|
+
resourceScrollbarWidth: 17
|
|
258
|
+
});
|
|
259
|
+
(0, _react.useEffect)(function () {
|
|
260
|
+
if (typeof schedulerData.setVersionChangeNotifier === 'function') {
|
|
261
|
+
schedulerData.setVersionChangeNotifier(setRenderTrigger);
|
|
262
|
+
return function () {
|
|
263
|
+
return schedulerData.setVersionChangeNotifier(null);
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
return undefined;
|
|
267
|
+
}, [schedulerData]);
|
|
180
268
|
var onWindowResize = (0, _react.useCallback)(function () {
|
|
181
269
|
schedulerData._setDocumentWidth(document.documentElement.clientWidth);
|
|
182
270
|
schedulerData._setDocumentHeight(document.documentElement.clientHeight);
|
|
183
|
-
setState(function (prevState) {
|
|
184
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
185
|
-
documentWidth: document.documentElement.clientWidth,
|
|
186
|
-
documentHeight: document.documentElement.clientHeight
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
271
|
}, [schedulerData]);
|
|
190
|
-
|
|
191
|
-
// Effect for window resize event
|
|
192
272
|
(0, _react.useEffect)(function () {
|
|
193
273
|
if (schedulerData.isSchedulerResponsive() && !schedulerData.config.responsiveByParent || parentRef === undefined) {
|
|
194
274
|
schedulerData._setDocumentWidth(document.documentElement.clientWidth);
|
|
195
275
|
schedulerData._setDocumentHeight(document.documentElement.clientHeight);
|
|
196
276
|
window.addEventListener('resize', onWindowResize);
|
|
197
277
|
return function () {
|
|
198
|
-
window.removeEventListener('resize', onWindowResize);
|
|
278
|
+
return window.removeEventListener('resize', onWindowResize);
|
|
199
279
|
};
|
|
200
280
|
}
|
|
201
281
|
}, [schedulerData, parentRef, onWindowResize]);
|
|
202
|
-
|
|
203
|
-
// Effect for parent element resize observation
|
|
204
282
|
(0, _react.useEffect)(function () {
|
|
205
|
-
if (parentRef !== undefined) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
ulObserverRef.current.observe(parentRef.current);
|
|
223
|
-
return function () {
|
|
224
|
-
if (ulObserverRef.current && parentRef.current) {
|
|
225
|
-
ulObserverRef.current.unobserve(parentRef.current);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
}
|
|
283
|
+
if (parentRef !== undefined && schedulerData.config.responsiveByParent && !!parentRef.current) {
|
|
284
|
+
schedulerData._setDocumentWidth(parentRef.current.offsetWidth);
|
|
285
|
+
ulObserverRef.current = new ResizeObserver(function () {
|
|
286
|
+
if (parentRef.current) {
|
|
287
|
+
schedulerData._setDocumentWidth(parentRef.current.offsetWidth);
|
|
288
|
+
schedulerData._setDocumentHeight(parentRef.current.offsetHeight);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
ulObserverRef.current.observe(parentRef.current);
|
|
292
|
+
return function () {
|
|
293
|
+
if (ulObserverRef.current && parentRef.current) {
|
|
294
|
+
ulObserverRef.current.unobserve(parentRef.current);
|
|
295
|
+
}
|
|
296
|
+
};
|
|
229
297
|
}
|
|
230
298
|
}, [parentRef, schedulerData]);
|
|
231
|
-
|
|
232
|
-
// Effect for scheduler header resize observation
|
|
233
299
|
(0, _react.useEffect)(function () {
|
|
234
|
-
if (
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
// Get computed styles for margins
|
|
245
|
-
var style = window.getComputedStyle(node);
|
|
246
|
-
var marginTop = parseFloat(style.marginTop) || 0;
|
|
247
|
-
var marginBottom = parseFloat(style.marginBottom) || 0;
|
|
248
|
-
// Total height including margins
|
|
249
|
-
var totalHeight = rect.height + marginTop + marginBottom;
|
|
250
|
-
schedulerData._setSchedulerHeaderHeight(totalHeight);
|
|
251
|
-
setState(function (prevState) {
|
|
252
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
253
|
-
headerHeight: totalHeight
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
});
|
|
300
|
+
if (schedulerData.config.responsiveByParent && !!schedulerHeaderRef.current) {
|
|
301
|
+
schedulerData._setDocumentWidth(schedulerHeaderRef.current.offsetWidth);
|
|
302
|
+
schedulerData._setDocumentHeight(schedulerHeaderRef.current.offsetHeight);
|
|
303
|
+
headerObserverRef.current = new ResizeObserver(function (entries) {
|
|
304
|
+
entries.forEach(function (entry) {
|
|
305
|
+
var node = entry.target;
|
|
306
|
+
var rect = node.getBoundingClientRect();
|
|
307
|
+
var style = window.getComputedStyle(node);
|
|
308
|
+
var totalHeight = rect.height + (parseFloat(style.marginTop) || 0) + (parseFloat(style.marginBottom) || 0);
|
|
309
|
+
schedulerData._setSchedulerHeaderHeight(totalHeight);
|
|
257
310
|
});
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
}
|
|
311
|
+
});
|
|
312
|
+
headerObserverRef.current.observe(schedulerHeaderRef.current);
|
|
313
|
+
return function () {
|
|
314
|
+
if (headerObserverRef.current && schedulerHeaderRef.current) {
|
|
315
|
+
headerObserverRef.current.unobserve(schedulerHeaderRef.current);
|
|
316
|
+
}
|
|
317
|
+
};
|
|
265
318
|
}
|
|
266
319
|
}, [schedulerHeaderRef, schedulerData]);
|
|
267
|
-
|
|
268
|
-
// Resolving scrollbar sizes
|
|
269
320
|
var resolveScrollbarSize = (0, _react.useCallback)(function () {
|
|
270
|
-
var
|
|
271
|
-
var
|
|
272
|
-
var
|
|
273
|
-
var
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
321
|
+
var prev = scrollbarSizeRef.current;
|
|
322
|
+
var newContentHeight = schedulerContentRef.current ? schedulerContentRef.current.offsetHeight - schedulerContentRef.current.clientHeight : 17;
|
|
323
|
+
var newContentWidth = schedulerContentRef.current ? schedulerContentRef.current.offsetWidth - schedulerContentRef.current.clientWidth : 17;
|
|
324
|
+
var newResourceHeight = schedulerResourceRef.current ? schedulerResourceRef.current.offsetHeight - schedulerResourceRef.current.clientHeight : 17;
|
|
325
|
+
var newResourceWidth = schedulerResourceRef.current ? schedulerResourceRef.current.offsetWidth - schedulerResourceRef.current.clientWidth : 17;
|
|
326
|
+
if (newContentHeight !== prev.contentScrollbarHeight) {
|
|
327
|
+
setContentScrollbarHeight(newContentHeight);
|
|
328
|
+
scrollbarSizeRef.current.contentScrollbarHeight = newContentHeight;
|
|
277
329
|
}
|
|
278
|
-
if (
|
|
279
|
-
|
|
280
|
-
|
|
330
|
+
if (newContentWidth !== prev.contentScrollbarWidth) {
|
|
331
|
+
setContentScrollbarWidth(newContentWidth);
|
|
332
|
+
scrollbarSizeRef.current.contentScrollbarWidth = newContentWidth;
|
|
281
333
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
|
|
286
|
-
contentScrollbarHeight: contentScrollbarHeight
|
|
287
|
-
});
|
|
288
|
-
needSet = true;
|
|
334
|
+
if (newResourceHeight !== prev.resourceScrollbarHeight) {
|
|
335
|
+
setResourceScrollbarHeight(newResourceHeight);
|
|
336
|
+
scrollbarSizeRef.current.resourceScrollbarHeight = newResourceHeight;
|
|
289
337
|
}
|
|
290
|
-
if (
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
});
|
|
294
|
-
needSet = true;
|
|
338
|
+
if (newResourceWidth !== prev.resourceScrollbarWidth) {
|
|
339
|
+
setResourceScrollbarWidth(newResourceWidth);
|
|
340
|
+
scrollbarSizeRef.current.resourceScrollbarWidth = newResourceWidth;
|
|
295
341
|
}
|
|
296
|
-
|
|
297
|
-
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
|
|
298
|
-
resourceScrollbarHeight: resourceScrollbarHeight
|
|
299
|
-
});
|
|
300
|
-
needSet = true;
|
|
301
|
-
}
|
|
302
|
-
if (resourceScrollbarWidth !== state.resourceScrollbarWidth) {
|
|
303
|
-
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
|
|
304
|
-
resourceScrollbarWidth: resourceScrollbarWidth
|
|
305
|
-
});
|
|
306
|
-
needSet = true;
|
|
307
|
-
}
|
|
308
|
-
if (needSet) {
|
|
309
|
-
setState(function (prevState) {
|
|
310
|
-
return _objectSpread(_objectSpread({}, prevState), tmpState);
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
}, [state.contentScrollbarHeight, state.contentScrollbarWidth, state.resourceScrollbarHeight, state.resourceScrollbarWidth]);
|
|
314
|
-
|
|
315
|
-
// Effect for scrollToSpecialDayjs functionality
|
|
342
|
+
}, []);
|
|
316
343
|
(0, _react.useEffect)(function () {
|
|
317
344
|
resolveScrollbarSize();
|
|
318
345
|
var localeDayjs = schedulerData.localeDayjs,
|
|
@@ -325,10 +352,7 @@ function Scheduler(props) {
|
|
|
325
352
|
if (specialDayjs >= start && specialDayjs <= end) {
|
|
326
353
|
var index = 0;
|
|
327
354
|
schedulerData.headers.forEach(function (item) {
|
|
328
|
-
|
|
329
|
-
if (specialDayjs >= header) {
|
|
330
|
-
index += 1;
|
|
331
|
-
}
|
|
355
|
+
if (specialDayjs >= localeDayjs(new Date(item.time))) index += 1;
|
|
332
356
|
});
|
|
333
357
|
schedulerContentRef.current.scrollLeft = (index - 1) * schedulerData.getContentCellWidth();
|
|
334
358
|
schedulerData.setScrollToSpecialDayjs(false);
|
|
@@ -336,8 +360,6 @@ function Scheduler(props) {
|
|
|
336
360
|
}
|
|
337
361
|
}
|
|
338
362
|
}, [schedulerData, resolveScrollbarSize]);
|
|
339
|
-
|
|
340
|
-
// Mouse event handlers
|
|
341
363
|
var onSchedulerHeadMouseOver = (0, _react.useCallback)(function () {
|
|
342
364
|
currentAreaRef.current = 2;
|
|
343
365
|
}, []);
|
|
@@ -356,10 +378,8 @@ function Scheduler(props) {
|
|
|
356
378
|
currentAreaRef.current = -1;
|
|
357
379
|
}, []);
|
|
358
380
|
var onSchedulerResourceScroll = (0, _react.useCallback)(function () {
|
|
359
|
-
if (schedulerResourceRef.current) {
|
|
360
|
-
|
|
361
|
-
schedulerContentRef.current.scrollTop = schedulerResourceRef.current.scrollTop;
|
|
362
|
-
}
|
|
381
|
+
if (schedulerResourceRef.current && (currentAreaRef.current === 1 || currentAreaRef.current === -1) && schedulerContentRef.current.scrollTop !== schedulerResourceRef.current.scrollTop) {
|
|
382
|
+
schedulerContentRef.current.scrollTop = schedulerResourceRef.current.scrollTop;
|
|
363
383
|
}
|
|
364
384
|
}, []);
|
|
365
385
|
var onSchedulerContentMouseOver = (0, _react.useCallback)(function () {
|
|
@@ -379,10 +399,6 @@ function Scheduler(props) {
|
|
|
379
399
|
}
|
|
380
400
|
}
|
|
381
401
|
}
|
|
382
|
-
var onScrollLeft = props.onScrollLeft,
|
|
383
|
-
onScrollRight = props.onScrollRight,
|
|
384
|
-
onScrollTop = props.onScrollTop,
|
|
385
|
-
onScrollBottom = props.onScrollBottom;
|
|
386
402
|
if (schedulerContentRef.current.scrollLeft !== scrollLeftRef.current) {
|
|
387
403
|
if (schedulerContentRef.current.scrollLeft === 0 && onScrollLeft !== undefined) {
|
|
388
404
|
onScrollLeft(schedulerData, schedulerContentRef.current, schedulerContentRef.current.scrollWidth - schedulerContentRef.current.clientWidth);
|
|
@@ -400,9 +416,8 @@ function Scheduler(props) {
|
|
|
400
416
|
}
|
|
401
417
|
scrollLeftRef.current = schedulerContentRef.current.scrollLeft;
|
|
402
418
|
scrollTopRef.current = schedulerContentRef.current.scrollTop;
|
|
403
|
-
}, [
|
|
419
|
+
}, [schedulerData, onScrollLeft, onScrollRight, onScrollTop, onScrollBottom]); // ✅ no props ref
|
|
404
420
|
|
|
405
|
-
// Event handlers
|
|
406
421
|
var handleViewChange = (0, _react.useCallback)(function (e) {
|
|
407
422
|
var viewType = parseInt(e.target.value.charAt(0), 10);
|
|
408
423
|
var showAgenda = e.target.value.charAt(1) === '1';
|
|
@@ -414,47 +429,93 @@ function Scheduler(props) {
|
|
|
414
429
|
});
|
|
415
430
|
}, [onViewChange, schedulerData]);
|
|
416
431
|
var goNext = (0, _react.useCallback)(function () {
|
|
417
|
-
nextClick(schedulerData);
|
|
432
|
+
return nextClick(schedulerData);
|
|
418
433
|
}, [nextClick, schedulerData]);
|
|
419
434
|
var goBack = (0, _react.useCallback)(function () {
|
|
420
|
-
prevClick(schedulerData);
|
|
435
|
+
return prevClick(schedulerData);
|
|
421
436
|
}, [prevClick, schedulerData]);
|
|
422
437
|
var onSelect = (0, _react.useCallback)(function (date) {
|
|
423
|
-
onSelectDate(schedulerData, date);
|
|
438
|
+
return onSelectDate(schedulerData, date);
|
|
424
439
|
}, [onSelectDate, schedulerData]);
|
|
425
|
-
|
|
426
|
-
// Rendering
|
|
427
440
|
var viewType = schedulerData.viewType,
|
|
428
441
|
renderData = schedulerData.renderData,
|
|
429
442
|
showAgenda = schedulerData.showAgenda,
|
|
430
443
|
config = schedulerData.config;
|
|
431
444
|
var width = schedulerData.getSchedulerWidth();
|
|
432
|
-
var contentScrollbarHeight = state.contentScrollbarHeight,
|
|
433
|
-
contentScrollbarWidth = state.contentScrollbarWidth,
|
|
434
|
-
resourceScrollbarHeight = state.resourceScrollbarHeight,
|
|
435
|
-
resourceScrollbarWidth = state.resourceScrollbarWidth;
|
|
436
445
|
var showWeekNumber = config.showWeekNumber,
|
|
437
446
|
weekNumberRowHeight = config.weekNumberRowHeight;
|
|
438
|
-
var
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
var
|
|
447
|
-
|
|
447
|
+
var schedulerDataVersion = schedulerData.getVersion ? schedulerData.getVersion() : 0;
|
|
448
|
+
var schedulerWidth = schedulerData.getContentTableWidth() - 1;
|
|
449
|
+
var weekNumberRowStyle = (0, _react.useMemo)(function () {
|
|
450
|
+
return {
|
|
451
|
+
height: weekNumberRowHeight
|
|
452
|
+
};
|
|
453
|
+
}, [weekNumberRowHeight]);
|
|
454
|
+
var weekNumberThStyle = (0, _react.useMemo)(function () {
|
|
455
|
+
var _config$headerBorderC;
|
|
456
|
+
return {
|
|
457
|
+
borderBottom: "1px solid ".concat((_config$headerBorderC = config.headerBorderColor) !== null && _config$headerBorderC !== void 0 ? _config$headerBorderC : '#e9e9e9'),
|
|
458
|
+
fontSize: '0.85em',
|
|
459
|
+
opacity: 0.7,
|
|
460
|
+
padding: '4px 8px'
|
|
461
|
+
};
|
|
462
|
+
}, [config.headerBorderColor]);
|
|
463
|
+
var schedulerInnerStyle = (0, _react.useMemo)(function () {
|
|
464
|
+
return {
|
|
465
|
+
width: schedulerWidth
|
|
466
|
+
};
|
|
467
|
+
}, [schedulerWidth]);
|
|
468
|
+
var displayRenderData = (0, _react.useMemo)(function () {
|
|
469
|
+
return renderData.filter(function (o) {
|
|
448
470
|
return o.render;
|
|
449
471
|
});
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
472
|
+
}, [renderData]);
|
|
473
|
+
var eventDndSource = dndContext.getDndSource();
|
|
474
|
+
var resourceEventsList = (0, _react.useMemo)(function () {
|
|
475
|
+
return displayRenderData.map(function (item) {
|
|
476
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResourceEvents["default"], {
|
|
453
477
|
resourceEvents: item,
|
|
478
|
+
schedulerData: schedulerData,
|
|
479
|
+
schedulerDataVersion: schedulerDataVersion,
|
|
454
480
|
dndSource: eventDndSource,
|
|
455
|
-
dndContext:
|
|
456
|
-
|
|
481
|
+
dndContext: dndContext,
|
|
482
|
+
onSetAddMoreState: props.onSetAddMoreState,
|
|
483
|
+
updateEventStart: props.updateEventStart,
|
|
484
|
+
updateEventEnd: props.updateEventEnd,
|
|
485
|
+
moveEvent: props.moveEvent,
|
|
486
|
+
movingEvent: props.movingEvent,
|
|
487
|
+
conflictOccurred: props.conflictOccurred,
|
|
488
|
+
subtitleGetter: props.subtitleGetter,
|
|
489
|
+
eventItemClick: props.eventItemClick,
|
|
490
|
+
viewEventClick: props.viewEventClick,
|
|
491
|
+
viewEventText: props.viewEventText,
|
|
492
|
+
viewEvent2Click: props.viewEvent2Click,
|
|
493
|
+
viewEvent2Text: props.viewEvent2Text,
|
|
494
|
+
newEvent: props.newEvent,
|
|
495
|
+
eventItemTemplateResolver: props.eventItemTemplateResolver
|
|
496
|
+
}, item.slotId);
|
|
457
497
|
});
|
|
498
|
+
}, [displayRenderData, schedulerData, schedulerDataVersion, eventDndSource, dndContext, props.onSetAddMoreState, props.updateEventStart, props.updateEventEnd, props.moveEvent, props.movingEvent, props.conflictOccurred, props.subtitleGetter, props.eventItemClick, props.viewEventClick, props.viewEventText, props.viewEvent2Click, props.viewEvent2Text, props.newEvent, props.eventItemTemplateResolver]);
|
|
499
|
+
var tbodyContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {});
|
|
500
|
+
if (showAgenda) {
|
|
501
|
+
tbodyContent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_AgendaView["default"], {
|
|
502
|
+
schedulerData: schedulerData,
|
|
503
|
+
subtitleGetter: props.subtitleGetter,
|
|
504
|
+
eventItemClick: props.eventItemClick,
|
|
505
|
+
viewEventClick: props.viewEventClick,
|
|
506
|
+
viewEventText: props.viewEventText,
|
|
507
|
+
viewEvent2Click: props.viewEvent2Click,
|
|
508
|
+
viewEvent2Text: props.viewEvent2Text,
|
|
509
|
+
slotClickedFunc: props.slotClickedFunc,
|
|
510
|
+
slotItemTemplateResolver: props.slotItemTemplateResolver,
|
|
511
|
+
eventItemTemplateResolver: props.eventItemTemplateResolver,
|
|
512
|
+
eventItemPopoverTemplateResolver: props.eventItemPopoverTemplateResolver
|
|
513
|
+
});
|
|
514
|
+
} else {
|
|
515
|
+
var _config$headerBorderC2, _config$headerBorderC3, _config$weekNumberLab;
|
|
516
|
+
var resourceTableWidth = schedulerData.getResourceTableWidth();
|
|
517
|
+
var schedulerContainerWidth = width - (config.resourceViewEnabled ? resourceTableWidth : 0);
|
|
518
|
+
var _schedulerWidth = schedulerData.getContentTableWidth() - 1;
|
|
458
519
|
var contentHeight = config.schedulerContentHeight;
|
|
459
520
|
var resourcePaddingBottom = resourceScrollbarHeight === 0 ? contentScrollbarHeight : 0;
|
|
460
521
|
var contentPaddingBottom = contentScrollbarHeight === 0 ? resourceScrollbarHeight : 0;
|
|
@@ -482,7 +543,6 @@ function Scheduler(props) {
|
|
|
482
543
|
maxHeight: config.schedulerMaxHeight - totalHeaderHeight
|
|
483
544
|
});
|
|
484
545
|
} else if (config.responsiveByParent && schedulerData.documentHeight > 0) {
|
|
485
|
-
// Responsive height minus SchedulerHeader
|
|
486
546
|
var availableHeight = schedulerData.getSchedulerHeight();
|
|
487
547
|
schedulerContentStyle = _objectSpread(_objectSpread({}, schedulerContentStyle), {}, {
|
|
488
548
|
height: availableHeight
|
|
@@ -492,40 +552,54 @@ function Scheduler(props) {
|
|
|
492
552
|
});
|
|
493
553
|
}
|
|
494
554
|
var resourceName = schedulerData.isEventPerspective ? config.taskName : config.resourceName;
|
|
555
|
+
var resourceColumnStyle = {
|
|
556
|
+
display: config.resourceViewEnabled ? undefined : 'none',
|
|
557
|
+
width: resourceTableWidth,
|
|
558
|
+
verticalAlign: 'top'
|
|
559
|
+
};
|
|
560
|
+
var resourceHeaderStyle = _objectSpread({
|
|
561
|
+
borderBottom: "1px solid ".concat((_config$headerBorderC2 = config.headerBorderColor) !== null && _config$headerBorderC2 !== void 0 ? _config$headerBorderC2 : '#e9e9e9'),
|
|
562
|
+
height: config.tableHeaderHeight + (showWeekNumber ? weekNumberRowHeight : 0)
|
|
563
|
+
}, configTableHeaderStyle);
|
|
564
|
+
var resourceHeaderScrollStyle = {
|
|
565
|
+
overflowX: 'scroll',
|
|
566
|
+
overflowY: 'hidden',
|
|
567
|
+
margin: "0px 0px -".concat(contentScrollbarHeight, "px")
|
|
568
|
+
};
|
|
569
|
+
var schedulerViewStyle = {
|
|
570
|
+
width: schedulerContainerWidth,
|
|
571
|
+
verticalAlign: 'top'
|
|
572
|
+
};
|
|
573
|
+
var schedulerHeadWrapperStyle = {
|
|
574
|
+
overflow: 'hidden',
|
|
575
|
+
borderBottom: "1px solid ".concat((_config$headerBorderC3 = config.headerBorderColor) !== null && _config$headerBorderC3 !== void 0 ? _config$headerBorderC3 : '#e9e9e9'),
|
|
576
|
+
height: config.tableHeaderHeight + (showWeekNumber ? weekNumberRowHeight : 0)
|
|
577
|
+
};
|
|
578
|
+
var schedulerHeadScrollStyle = {
|
|
579
|
+
overflowX: 'scroll',
|
|
580
|
+
overflowY: 'hidden',
|
|
581
|
+
margin: "0px 0px -".concat(contentScrollbarHeight, "px")
|
|
582
|
+
};
|
|
583
|
+
var schedulerHeadInnerStyle = {
|
|
584
|
+
paddingRight: "".concat(contentScrollbarWidth, "px"),
|
|
585
|
+
width: _schedulerWidth + contentScrollbarWidth
|
|
586
|
+
};
|
|
495
587
|
tbodyContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
|
|
496
588
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
497
|
-
style:
|
|
498
|
-
display: config.resourceViewEnabled ? undefined : 'none',
|
|
499
|
-
width: resourceTableWidth,
|
|
500
|
-
verticalAlign: 'top'
|
|
501
|
-
},
|
|
589
|
+
style: resourceColumnStyle,
|
|
502
590
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
503
591
|
className: "resource-view",
|
|
504
592
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
505
|
-
style:
|
|
506
|
-
borderBottom: "1px solid ".concat((_config$headerBorderC = config.headerBorderColor) !== null && _config$headerBorderC !== void 0 ? _config$headerBorderC : '#e9e9e9'),
|
|
507
|
-
height: config.tableHeaderHeight + (showWeekNumber ? weekNumberRowHeight : 0)
|
|
508
|
-
}, configTableHeaderStyle),
|
|
593
|
+
style: resourceHeaderStyle,
|
|
509
594
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
510
|
-
style:
|
|
511
|
-
overflowX: 'scroll',
|
|
512
|
-
overflowY: 'hidden',
|
|
513
|
-
margin: "0px 0px -".concat(contentScrollbarHeight, "px")
|
|
514
|
-
},
|
|
595
|
+
style: resourceHeaderScrollStyle,
|
|
515
596
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("table", {
|
|
516
597
|
className: "resource-table",
|
|
517
598
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("thead", {
|
|
518
599
|
children: [showWeekNumber && /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
519
|
-
style:
|
|
520
|
-
height: weekNumberRowHeight
|
|
521
|
-
},
|
|
600
|
+
style: weekNumberRowStyle,
|
|
522
601
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
523
|
-
style:
|
|
524
|
-
borderBottom: "1px solid ".concat((_config$headerBorderC2 = config.headerBorderColor) !== null && _config$headerBorderC2 !== void 0 ? _config$headerBorderC2 : '#e9e9e9'),
|
|
525
|
-
fontSize: '0.85em',
|
|
526
|
-
opacity: 0.7,
|
|
527
|
-
padding: '4px 8px'
|
|
528
|
-
},
|
|
602
|
+
style: weekNumberThStyle,
|
|
529
603
|
children: (_config$weekNumberLab = config.weekNumberLabel) !== null && _config$weekNumberLab !== void 0 ? _config$weekNumberLab : 'Week No.'
|
|
530
604
|
})
|
|
531
605
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
@@ -548,30 +622,25 @@ function Scheduler(props) {
|
|
|
548
622
|
onMouseOut: onSchedulerResourceMouseOut,
|
|
549
623
|
onBlur: onSchedulerResourceMouseOut,
|
|
550
624
|
onScroll: onSchedulerResourceScroll,
|
|
551
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResourceView["default"],
|
|
552
|
-
|
|
553
|
-
|
|
625
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResourceView["default"], {
|
|
626
|
+
schedulerData: schedulerData,
|
|
627
|
+
schedulerDataVersion: schedulerDataVersion,
|
|
628
|
+
contentScrollbarHeight: resourcePaddingBottom,
|
|
629
|
+
slotClickedFunc: props.slotClickedFunc,
|
|
630
|
+
slotItemTemplateResolver: props.slotItemTemplateResolver,
|
|
631
|
+
toggleExpandFunc: props.toggleExpandFunc,
|
|
632
|
+
CustomResourceCell: props.CustomResourceCell
|
|
633
|
+
})
|
|
554
634
|
})]
|
|
555
635
|
})
|
|
556
636
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
557
637
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
558
638
|
className: "scheduler-view",
|
|
559
|
-
style:
|
|
560
|
-
width: schedulerContainerWidth,
|
|
561
|
-
verticalAlign: 'top'
|
|
562
|
-
},
|
|
639
|
+
style: schedulerViewStyle,
|
|
563
640
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
564
|
-
style:
|
|
565
|
-
overflow: 'hidden',
|
|
566
|
-
borderBottom: "1px solid ".concat((_config$headerBorderC3 = config.headerBorderColor) !== null && _config$headerBorderC3 !== void 0 ? _config$headerBorderC3 : '#e9e9e9'),
|
|
567
|
-
height: config.tableHeaderHeight + (showWeekNumber ? weekNumberRowHeight : 0)
|
|
568
|
-
},
|
|
641
|
+
style: schedulerHeadWrapperStyle,
|
|
569
642
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
570
|
-
style:
|
|
571
|
-
overflowX: 'scroll',
|
|
572
|
-
overflowY: 'hidden',
|
|
573
|
-
margin: "0px 0px -".concat(contentScrollbarHeight, "px")
|
|
574
|
-
},
|
|
643
|
+
style: schedulerHeadScrollStyle,
|
|
575
644
|
ref: schedulerHeadRef,
|
|
576
645
|
onMouseOver: onSchedulerHeadMouseOver,
|
|
577
646
|
onFocus: onSchedulerHeadMouseOver,
|
|
@@ -580,13 +649,14 @@ function Scheduler(props) {
|
|
|
580
649
|
onScroll: onSchedulerHeadScroll,
|
|
581
650
|
"aria-label": "Scheduler Header",
|
|
582
651
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
583
|
-
style:
|
|
584
|
-
paddingRight: "".concat(contentScrollbarWidth, "px"),
|
|
585
|
-
width: schedulerWidth + contentScrollbarWidth
|
|
586
|
-
},
|
|
652
|
+
style: schedulerHeadInnerStyle,
|
|
587
653
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("table", {
|
|
588
654
|
className: "scheduler-bg-table",
|
|
589
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderView["default"],
|
|
655
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderView["default"], {
|
|
656
|
+
schedulerData: schedulerData,
|
|
657
|
+
schedulerDataVersion: schedulerDataVersion,
|
|
658
|
+
nonAgendaCellHeaderTemplateResolver: props.nonAgendaCellHeaderTemplateResolver
|
|
659
|
+
})
|
|
590
660
|
})
|
|
591
661
|
})
|
|
592
662
|
})
|
|
@@ -599,9 +669,7 @@ function Scheduler(props) {
|
|
|
599
669
|
onBlur: onSchedulerContentMouseOut,
|
|
600
670
|
onScroll: onSchedulerContentScroll,
|
|
601
671
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
602
|
-
style:
|
|
603
|
-
width: schedulerWidth
|
|
604
|
-
},
|
|
672
|
+
style: schedulerInnerStyle,
|
|
605
673
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
606
674
|
className: "scheduler-content",
|
|
607
675
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("table", {
|
|
@@ -614,11 +682,12 @@ function Scheduler(props) {
|
|
|
614
682
|
className: "scheduler-bg",
|
|
615
683
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("table", {
|
|
616
684
|
className: "scheduler-bg-table",
|
|
617
|
-
style:
|
|
618
|
-
width: schedulerWidth
|
|
619
|
-
},
|
|
685
|
+
style: schedulerInnerStyle,
|
|
620
686
|
ref: schedulerContentBgTableRef,
|
|
621
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BodyView["default"],
|
|
687
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BodyView["default"], {
|
|
688
|
+
schedulerData: schedulerData,
|
|
689
|
+
schedulerDataVersion: schedulerDataVersion
|
|
690
|
+
})
|
|
622
691
|
})
|
|
623
692
|
})]
|
|
624
693
|
})
|
|
@@ -627,26 +696,34 @@ function Scheduler(props) {
|
|
|
627
696
|
})]
|
|
628
697
|
});
|
|
629
698
|
}
|
|
630
|
-
var
|
|
631
|
-
|
|
632
|
-
style: {
|
|
699
|
+
var schedulerHeaderStyle = (0, _react.useMemo)(function () {
|
|
700
|
+
return {
|
|
633
701
|
display: config.headerEnabled ? undefined : 'none',
|
|
634
702
|
marginBottom: config.headerEnabled ? '24px' : undefined
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
703
|
+
};
|
|
704
|
+
}, [config.headerEnabled]);
|
|
705
|
+
var schedulerHeader = (0, _react.useMemo)(function () {
|
|
706
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SchedulerHeader["default"], {
|
|
707
|
+
ref: schedulerHeaderRef,
|
|
708
|
+
style: schedulerHeaderStyle,
|
|
709
|
+
onViewChange: handleViewChange,
|
|
710
|
+
schedulerData: schedulerData,
|
|
711
|
+
onSelectDate: onSelect,
|
|
712
|
+
goNext: goNext,
|
|
713
|
+
goBack: goBack,
|
|
714
|
+
rightCustomHeader: rightCustomHeader,
|
|
715
|
+
leftCustomHeader: leftCustomHeader
|
|
716
|
+
});
|
|
717
|
+
}, [schedulerHeaderStyle, handleViewChange, schedulerData, onSelect, goNext, goBack, rightCustomHeader, leftCustomHeader]);
|
|
718
|
+
var rootTableStyle = (0, _react.useMemo)(function () {
|
|
719
|
+
return {
|
|
720
|
+
width: "".concat(width, "px")
|
|
721
|
+
};
|
|
722
|
+
}, [width]);
|
|
644
723
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
645
724
|
id: "rbs-root",
|
|
646
725
|
className: "rbs",
|
|
647
|
-
style:
|
|
648
|
-
width: "".concat(width, "px")
|
|
649
|
-
},
|
|
726
|
+
style: rootTableStyle,
|
|
650
727
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
651
728
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
652
729
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-big-schedule",
|
|
3
|
-
"version": "5.4.9
|
|
3
|
+
"version": "5.4.9",
|
|
4
4
|
"description": "React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React. Seamlessly integrate this modern browser-compatible component into your applications to effectively manage time, appointments, and resources. With drag-and-drop functionality, interactive UI, and granular views, react-big-schedule empowers users to effortlessly schedule and allocate resources with precision. Enhance productivity and streamline your workflow with this React-based solution, designed to optimize time management and simplify calendar-based operations. Perfect for applications requiring advanced scheduling capabilities, react-big-schedule offers a seamless and intuitive experience for managing appointments, resource allocation, and time slots. Unlock the potential of your React projects with react-big-schedule and revolutionize the way you handle scheduling and resource planning. It is the updated version of react-big-scheduler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-big-schedule",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
91
91
|
"eslint-plugin-prettier": "^5.5.5",
|
|
92
92
|
"eslint-plugin-react": "^7.37.5",
|
|
93
|
-
"eslint-plugin-react-hooks": "^7.0
|
|
93
|
+
"eslint-plugin-react-hooks": "^7.1.0",
|
|
94
94
|
"eslint-webpack-plugin": "^6.0.0",
|
|
95
95
|
"fs-extra": "^11.3.4",
|
|
96
|
-
"html-webpack-plugin": "^5.6.
|
|
96
|
+
"html-webpack-plugin": "^5.6.7",
|
|
97
97
|
"prettier": "^3.8.1",
|
|
98
98
|
"style-loader": "^4.0.0",
|
|
99
99
|
"webpack": "^5.106.2",
|