makula-schedule 2.1.1 → 2.1.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.
@@ -169,12 +169,17 @@ var EventItem = /*#__PURE__*/function (_Component) {
169
169
  var newWidth;
170
170
  if (config.snapToGrid) {
171
171
  var deltaX = clientX - startX;
172
- var snappedCells = Math.round(deltaX / cellWidth);
173
- var newLeftIndex = leftIndex + snappedCells;
174
- var clampedLeftIndex = Math.max(0, Math.min(newLeftIndex, rightIndex - 1));
172
+ var snappedDelta = Math.round(deltaX / cellWidth) * cellWidth;
175
173
  var originalRightEdge = left + width;
176
- newLeft = clampedLeftIndex * cellWidth + (clampedLeftIndex > 0 ? 2 : 3);
174
+ newLeft = left + snappedDelta;
177
175
  newWidth = originalRightEdge - newLeft;
176
+ if (newWidth < minWidth) {
177
+ newWidth = minWidth;
178
+ newLeft = originalRightEdge - minWidth;
179
+ } else if (newWidth > maxWidth) {
180
+ newWidth = maxWidth;
181
+ newLeft = originalRightEdge - maxWidth;
182
+ }
178
183
  } else {
179
184
  newLeft = left + clientX - startX;
180
185
  newWidth = width + startX - clientX;
@@ -334,7 +339,6 @@ var EventItem = /*#__PURE__*/function (_Component) {
334
339
  var _this$props6 = _this.props,
335
340
  width = _this$props6.width,
336
341
  leftIndex = _this$props6.leftIndex,
337
- rightIndex = _this$props6.rightIndex,
338
342
  schedulerData = _this$props6.schedulerData;
339
343
  var headers = schedulerData.headers,
340
344
  config = schedulerData.config;
@@ -346,10 +350,9 @@ var EventItem = /*#__PURE__*/function (_Component) {
346
350
  var newWidth;
347
351
  if (config.snapToGrid) {
348
352
  var deltaX = clientX - endX;
349
- var snappedCells = Math.round(deltaX / cellWidth);
350
- var currentSpan = rightIndex - leftIndex;
351
- var newSpan = Math.max(1, Math.min(currentSpan + snappedCells, headers.length - leftIndex));
352
- newWidth = newSpan * cellWidth - offset;
353
+ var snappedDelta = Math.round(deltaX / cellWidth) * cellWidth;
354
+ newWidth = width + snappedDelta;
355
+ if (newWidth < minWidth) newWidth = minWidth;else if (newWidth > maxWidth) newWidth = maxWidth;
353
356
  } else {
354
357
  newWidth = width + clientX - endX;
355
358
  if (newWidth < minWidth) newWidth = minWidth;else if (newWidth > maxWidth) newWidth = maxWidth;
@@ -469,6 +469,7 @@ function Scheduler(props) {
469
469
  overflowY: 'auto',
470
470
  margin: '0px',
471
471
  position: 'relative',
472
+ overscrollBehaviorX: 'none',
472
473
  height: contentHeight,
473
474
  paddingBottom: contentPaddingBottom
474
475
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makula-schedule",
3
- "version": "2.1.1",
3
+ "version": "2.1.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",