makula-schedule 2.3.3 → 2.3.5

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.
@@ -74,20 +74,28 @@ var DnDSource = exports["default"] = /*#__PURE__*/_createClass(function DnDSourc
74
74
  }
75
75
  });
76
76
  }
77
- if (hasConflict) {
77
+ if (hasConflict && !config.allowConflicts) {
78
78
  var conflictOccurred = props.conflictOccurred || dropResult.conflictOccurred;
79
79
  if (conflictOccurred !== undefined) {
80
80
  conflictOccurred(schedulerData, action, item, type, slotId, slotName, newStart, newEnd);
81
81
  } else {
82
82
  console.log('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
83
83
  }
84
- if (!config.allowConflicts) return;
84
+ return;
85
85
  }
86
86
  if (isEvent) {
87
87
  if (moveEvent !== undefined) {
88
88
  moveEvent(schedulerData, item, slotId, slotName, newStart, newEnd);
89
89
  }
90
90
  } else if (newEvent !== undefined) newEvent(schedulerData, slotId, slotName, newStart, newEnd, type, item);
91
+ if (hasConflict && config.allowConflicts) {
92
+ var _conflictOccurred = props.conflictOccurred || dropResult.conflictOccurred;
93
+ if (_conflictOccurred !== undefined) {
94
+ _conflictOccurred(schedulerData, action, item, type, slotId, slotName, newStart, newEnd);
95
+ } else {
96
+ console.log('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
97
+ }
98
+ }
91
99
  },
92
100
  canDrag: function canDrag(props) {
93
101
  var schedulerData = props.schedulerData,
@@ -282,7 +282,7 @@ var EventItem = /*#__PURE__*/function (_Component) {
282
282
  }
283
283
  });
284
284
  }
285
- if (!hasConflict) {
285
+ if (!(hasConflict && !config.allowConflicts)) {
286
286
  _context.n = 6;
287
287
  break;
288
288
  }
@@ -291,10 +291,6 @@ var EventItem = /*#__PURE__*/function (_Component) {
291
291
  } else {
292
292
  console.log('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
293
293
  }
294
- if (config.allowConflicts) {
295
- _context.n = 6;
296
- break;
297
- }
298
294
  _this.setState({
299
295
  left: left,
300
296
  top: top,
@@ -304,6 +300,13 @@ var EventItem = /*#__PURE__*/function (_Component) {
304
300
  return _context.a(2);
305
301
  case 6:
306
302
  if (updateEventStart !== undefined) updateEventStart(schedulerData, eventItem, newStart);
303
+ if (hasConflict && config.allowConflicts) {
304
+ if (conflictOccurred !== undefined) {
305
+ conflictOccurred(schedulerData, 'StartResize', eventItem, _default2.DnDTypes.EVENT, slotId, slotName, newStart, eventItem.end);
306
+ } else {
307
+ console.log('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
308
+ }
309
+ }
307
310
  case 7:
308
311
  return _context.a(2);
309
312
  }
@@ -457,7 +460,7 @@ var EventItem = /*#__PURE__*/function (_Component) {
457
460
  }
458
461
  });
459
462
  }
460
- if (!hasConflict) {
463
+ if (!(hasConflict && !config.allowConflicts)) {
461
464
  _context2.n = 6;
462
465
  break;
463
466
  }
@@ -466,10 +469,6 @@ var EventItem = /*#__PURE__*/function (_Component) {
466
469
  } else {
467
470
  console.error('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
468
471
  }
469
- if (config.allowConflicts) {
470
- _context2.n = 6;
471
- break;
472
- }
473
472
  _this.setState({
474
473
  left: left,
475
474
  top: top,
@@ -481,6 +480,13 @@ var EventItem = /*#__PURE__*/function (_Component) {
481
480
  if (updateEventEnd !== undefined) {
482
481
  updateEventEnd(schedulerData, eventItem, newEnd);
483
482
  }
483
+ if (hasConflict && config.allowConflicts) {
484
+ if (conflictOccurred !== undefined) {
485
+ conflictOccurred(schedulerData, 'EndResize', eventItem, _default2.DnDTypes.EVENT, slotId, slot ? slot.name : null, eventItem.start, newEnd);
486
+ } else {
487
+ console.error('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
488
+ }
489
+ }
484
490
  case 7:
485
491
  return _context2.a(2);
486
492
  }
@@ -193,7 +193,7 @@ var ResourceEvents = /*#__PURE__*/function (_Component) {
193
193
  }
194
194
  });
195
195
  }
196
- if (hasConflict) {
196
+ if (hasConflict && !config.allowConflicts) {
197
197
  var conflictOccurred = _this.props.conflictOccurred;
198
198
  if (conflictOccurred !== undefined) {
199
199
  conflictOccurred(schedulerData, 'New', {
@@ -207,9 +207,24 @@ var ResourceEvents = /*#__PURE__*/function (_Component) {
207
207
  } else {
208
208
  console.log('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
209
209
  }
210
- if (!config.allowConflicts) return;
210
+ return;
211
211
  }
212
212
  if (newEvent !== undefined) newEvent(schedulerData, slotId, slotName, startTime, endTime);
213
+ if (hasConflict && config.allowConflicts) {
214
+ var _conflictOccurred = _this.props.conflictOccurred;
215
+ if (_conflictOccurred !== undefined) {
216
+ _conflictOccurred(schedulerData, 'New', {
217
+ id: undefined,
218
+ start: startTime,
219
+ end: endTime,
220
+ slotId: slotId,
221
+ slotName: slotName,
222
+ title: undefined
223
+ }, _default2.DnDTypes.EVENT, slotId, slotName, startTime, endTime);
224
+ } else {
225
+ console.log('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
226
+ }
227
+ }
213
228
  });
214
229
  _defineProperty(_this, "cancelDrag", function (ev) {
215
230
  ev.stopPropagation();
@@ -472,7 +472,7 @@ function Scheduler(props) {
472
472
  var resourcePaddingBottom = resourceScrollbarHeight === 0 ? contentScrollbarHeight : 0;
473
473
  var contentPaddingBottom = contentScrollbarHeight === 0 ? resourceScrollbarHeight : 0;
474
474
  var schedulerContentStyle = {
475
- overflowX: viewType === _default.ViewType.Week ? 'hidden' : 'auto',
475
+ overflowX: 'auto',
476
476
  overflowY: 'auto',
477
477
  margin: '0px',
478
478
  position: 'relative',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makula-schedule",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
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",