makula-schedule 2.2.2 → 2.2.3

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.
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _dayjs = _interopRequireDefault(require("dayjs"));
8
- var _isoWeek = _interopRequireDefault(require("dayjs/plugin/isoWeek"));
9
8
  var _quarterOfYear = _interopRequireDefault(require("dayjs/plugin/quarterOfYear"));
10
9
  var _utc = _interopRequireDefault(require("dayjs/plugin/utc"));
11
10
  var _weekday = _interopRequireDefault(require("dayjs/plugin/weekday"));
11
+ var _isoWeek = _interopRequireDefault(require("dayjs/plugin/isoWeek"));
12
12
  var _rrule = require("rrule");
13
13
  var _default = require("../config/default");
14
14
  var _scheduler = _interopRequireDefault(require("../config/scheduler"));
@@ -1158,11 +1158,38 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
1158
1158
  var span = _this6._getSpan(item.start, item.end, _this6.headers);
1159
1159
  var eventStart = new Date(item.start);
1160
1160
  var eventEnd = new Date(item.end);
1161
- var pos = -1;
1161
+
1162
+ // Collect all overlapping headers first
1163
+ var overlappingHeaders = [];
1162
1164
  resourceEvents.headerItems.forEach(function (header, index) {
1163
1165
  var headerStart = new Date(header.start);
1164
1166
  var headerEnd = new Date(header.end);
1165
1167
  if (headerEnd > eventStart && headerStart < eventEnd) {
1168
+ overlappingHeaders.push({
1169
+ header: header,
1170
+ index: index
1171
+ });
1172
+ }
1173
+ });
1174
+ if (overlappingHeaders.length > 0) {
1175
+ // Find a pos that is free across ALL overlapping headers
1176
+ var pos = 0;
1177
+ var posFound = false;
1178
+ while (!posFound) {
1179
+ posFound = true;
1180
+ for (var i = 0; i < overlappingHeaders.length; i += 1) {
1181
+ if (overlappingHeaders[i].header.events[pos] !== undefined) {
1182
+ posFound = false;
1183
+ pos += 1;
1184
+ break;
1185
+ }
1186
+ }
1187
+ }
1188
+
1189
+ // Place the event at the found pos across all overlapping headers
1190
+ overlappingHeaders.forEach(function (_ref6) {
1191
+ var header = _ref6.header,
1192
+ index = _ref6.index;
1166
1193
  header.count += 1;
1167
1194
  if (header.count > resourceEvents.rowMaxCount) {
1168
1195
  resourceEvents.rowMaxCount = header.count;
@@ -1170,11 +1197,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
1170
1197
  var newRowHeight = rowsCount * _this6.config.eventItemLineHeight + (_this6.config.creatable && _this6.config.checkConflict === false ? 20 : 2);
1171
1198
  if (newRowHeight > resourceEvents.rowHeight) resourceEvents.rowHeight = newRowHeight;
1172
1199
  }
1173
- if (pos === -1) {
1174
- var tmp = 0;
1175
- while (header.events[tmp] !== undefined) tmp += 1;
1176
- pos = tmp;
1177
- }
1200
+ var headerStart = new Date(header.start);
1178
1201
  var render = headerStart <= eventStart || index === 0;
1179
1202
  if (render === false) {
1180
1203
  var previousHeader = resourceEvents.headerItems[index - 1];
@@ -1183,8 +1206,8 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
1183
1206
  if (previousHeaderEnd <= eventStart || previousHeaderStart >= eventEnd) render = true;
1184
1207
  }
1185
1208
  header.events[pos] = _this6._createHeaderEvent(render, span, item);
1186
- }
1187
- });
1209
+ });
1210
+ }
1188
1211
  }
1189
1212
  });
1190
1213
  if (cellMaxEventsCount <= cellMaxEventsCountValue || this.behaviors.getSummaryFunc !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makula-schedule",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
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",