fullcalendar 6.1.11 → 6.1.13

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/index.global.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
- FullCalendar Standard Bundle v6.1.11
2
+ FullCalendar Standard Bundle v6.1.13
3
3
  Docs & License: https://fullcalendar.io/docs/initialize-globals
4
- (c) 2023 Adam Shaw
4
+ (c) 2024 Adam Shaw
5
5
  */
6
6
  var FullCalendar = (function (exports) {
7
7
  'use strict';
@@ -5504,10 +5504,10 @@ var FullCalendar = (function (exports) {
5504
5504
  function computeRect(el) {
5505
5505
  let rect = el.getBoundingClientRect();
5506
5506
  return {
5507
- left: rect.left + window.pageXOffset,
5508
- top: rect.top + window.pageYOffset,
5509
- right: rect.right + window.pageXOffset,
5510
- bottom: rect.bottom + window.pageYOffset,
5507
+ left: rect.left + window.scrollX,
5508
+ top: rect.top + window.scrollY,
5509
+ right: rect.right + window.scrollX,
5510
+ bottom: rect.bottom + window.scrollY,
5511
5511
  };
5512
5512
  }
5513
5513
  function computeClippedClientRect(el) {
@@ -5698,16 +5698,16 @@ var FullCalendar = (function (exports) {
5698
5698
  }
5699
5699
  class WindowScrollController extends ScrollController {
5700
5700
  getScrollTop() {
5701
- return window.pageYOffset;
5701
+ return window.scrollY;
5702
5702
  }
5703
5703
  getScrollLeft() {
5704
- return window.pageXOffset;
5704
+ return window.scrollX;
5705
5705
  }
5706
5706
  setScrollTop(n) {
5707
- window.scroll(window.pageXOffset, n);
5707
+ window.scroll(window.scrollX, n);
5708
5708
  }
5709
5709
  setScrollLeft(n) {
5710
- window.scroll(n, window.pageYOffset);
5710
+ window.scroll(n, window.scrollY);
5711
5711
  }
5712
5712
  getScrollWidth() {
5713
5713
  return document.documentElement.scrollWidth;
@@ -9835,7 +9835,7 @@ var FullCalendar = (function (exports) {
9835
9835
  return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;
9836
9836
  }
9837
9837
 
9838
- const version = '6.1.11';
9838
+ const version = '6.1.13';
9839
9839
 
9840
9840
  config.touchMouseIgnoreWait = 500;
9841
9841
  let ignoreMouseDepth = 0;
@@ -9937,8 +9937,8 @@ var FullCalendar = (function (exports) {
9937
9937
  };
9938
9938
  this.handleScroll = (ev) => {
9939
9939
  if (!this.shouldIgnoreMove) {
9940
- let pageX = (window.pageXOffset - this.prevScrollX) + this.prevPageX;
9941
- let pageY = (window.pageYOffset - this.prevScrollY) + this.prevPageY;
9940
+ let pageX = (window.scrollX - this.prevScrollX) + this.prevPageX;
9941
+ let pageY = (window.scrollY - this.prevScrollY) + this.prevPageY;
9942
9942
  this.emitter.trigger('pointermove', {
9943
9943
  origEvent: ev,
9944
9944
  isTouch: this.isTouchDragging,
@@ -10007,8 +10007,8 @@ var FullCalendar = (function (exports) {
10007
10007
  if (this.shouldWatchScroll) {
10008
10008
  this.prevPageX = ev.pageX;
10009
10009
  this.prevPageY = ev.pageY;
10010
- this.prevScrollX = window.pageXOffset;
10011
- this.prevScrollY = window.pageYOffset;
10010
+ this.prevScrollX = window.scrollX;
10011
+ this.prevScrollY = window.scrollY;
10012
10012
  }
10013
10013
  }
10014
10014
  destroyScrollWatch() {
@@ -10127,15 +10127,15 @@ var FullCalendar = (function (exports) {
10127
10127
  start(sourceEl, pageX, pageY) {
10128
10128
  this.sourceEl = sourceEl;
10129
10129
  this.sourceElRect = this.sourceEl.getBoundingClientRect();
10130
- this.origScreenX = pageX - window.pageXOffset;
10131
- this.origScreenY = pageY - window.pageYOffset;
10130
+ this.origScreenX = pageX - window.scrollX;
10131
+ this.origScreenY = pageY - window.scrollY;
10132
10132
  this.deltaX = 0;
10133
10133
  this.deltaY = 0;
10134
10134
  this.updateElPosition();
10135
10135
  }
10136
10136
  handleMove(pageX, pageY) {
10137
- this.deltaX = (pageX - window.pageXOffset) - this.origScreenX;
10138
- this.deltaY = (pageY - window.pageYOffset) - this.origScreenY;
10137
+ this.deltaX = (pageX - window.scrollX) - this.origScreenX;
10138
+ this.deltaY = (pageY - window.scrollY) - this.origScreenY;
10139
10139
  this.updateElPosition();
10140
10140
  }
10141
10141
  // can be called before start
@@ -10213,6 +10213,7 @@ var FullCalendar = (function (exports) {
10213
10213
  // would use preventSelection(), but that prevents selectstart, causing problems.
10214
10214
  mirrorEl.style.userSelect = 'none';
10215
10215
  mirrorEl.style.webkitUserSelect = 'none';
10216
+ mirrorEl.style.pointerEvents = 'none';
10216
10217
  mirrorEl.classList.add('fc-event-dragging');
10217
10218
  applyStyle(mirrorEl, {
10218
10219
  position: 'fixed',
@@ -10368,7 +10369,7 @@ var FullCalendar = (function (exports) {
10368
10369
  this.everMovedRight = false;
10369
10370
  this.animate = () => {
10370
10371
  if (this.isAnimating) { // wasn't cancelled between animation calls
10371
- let edge = this.computeBestEdge(this.pointerScreenX + window.pageXOffset, this.pointerScreenY + window.pageYOffset);
10372
+ let edge = this.computeBestEdge(this.pointerScreenX + window.scrollX, this.pointerScreenY + window.scrollY);
10372
10373
  if (edge) {
10373
10374
  let now = getTime();
10374
10375
  this.handleSide(edge, (now - this.msSinceRequest) / 1000);
@@ -10394,8 +10395,8 @@ var FullCalendar = (function (exports) {
10394
10395
  }
10395
10396
  handleMove(pageX, pageY) {
10396
10397
  if (this.isEnabled) {
10397
- let pointerScreenX = pageX - window.pageXOffset;
10398
- let pointerScreenY = pageY - window.pageYOffset;
10398
+ let pointerScreenX = pageX - window.scrollX;
10399
+ let pointerScreenY = pageY - window.scrollY;
10399
10400
  let yDelta = this.pointerScreenY === null ? 0 : pointerScreenY - this.pointerScreenY;
10400
10401
  let xDelta = this.pointerScreenX === null ? 0 : pointerScreenX - this.pointerScreenX;
10401
10402
  if (yDelta < 0) {
@@ -10475,6 +10476,10 @@ var FullCalendar = (function (exports) {
10475
10476
  (!bestSide || bestSide.distance > bottomDist)) {
10476
10477
  bestSide = { scrollCache, name: 'bottom', distance: bottomDist };
10477
10478
  }
10479
+ /*
10480
+ TODO: fix broken RTL scrolling. canScrollLeft always returning false
10481
+ https://github.com/fullcalendar/fullcalendar/issues/4837
10482
+ */
10478
10483
  if (leftDist <= edgeThreshold && this.everMovedLeft && scrollCache.canScrollLeft() &&
10479
10484
  (!bestSide || bestSide.distance > leftDist)) {
10480
10485
  bestSide = { scrollCache, name: 'left', distance: leftDist };
@@ -10502,6 +10507,10 @@ var FullCalendar = (function (exports) {
10502
10507
  els.push(query);
10503
10508
  }
10504
10509
  else {
10510
+ /*
10511
+ TODO: in the future, always have auto-scroll happen on element where current Hit came from
10512
+ Ticket: https://github.com/fullcalendar/fullcalendar/issues/4593
10513
+ */
10505
10514
  els.push(...Array.prototype.slice.call(scrollStartEl.getRootNode().querySelectorAll(query)));
10506
10515
  }
10507
10516
  }
@@ -10676,6 +10685,7 @@ var FullCalendar = (function (exports) {
10676
10685
  */
10677
10686
  class OffsetTracker {
10678
10687
  constructor(el) {
10688
+ this.el = el;
10679
10689
  this.origRect = computeRect(el);
10680
10690
  // will work fine for divs that have overflow:hidden
10681
10691
  this.scrollCaches = getClippingParents(el).map((scrollEl) => new ElementScrollGeomCache(scrollEl, true));
@@ -10735,6 +10745,7 @@ var FullCalendar = (function (exports) {
10735
10745
  // options that can be set by caller
10736
10746
  this.useSubjectCenter = false;
10737
10747
  this.requireInitial = true; // if doesn't start out on a hit, won't emit any events
10748
+ this.disablePointCheck = false;
10738
10749
  this.initialHit = null;
10739
10750
  this.movingHit = null;
10740
10751
  this.finalHit = null; // won't ever be populated if shouldIgnoreMove
@@ -10851,6 +10862,13 @@ var FullCalendar = (function (exports) {
10851
10862
  if (hit && (
10852
10863
  // make sure the hit is within activeRange, meaning it's not a dead cell
10853
10864
  rangeContainsRange(hit.dateProfile.activeRange, hit.dateSpan.range)) &&
10865
+ // Ensure the component we are querying for the hit is accessibly my the pointer
10866
+ // Prevents obscured calendars (ex: under a modal dialog) from accepting hit
10867
+ // https://github.com/fullcalendar/fullcalendar/issues/5026
10868
+ (this.disablePointCheck ||
10869
+ offsetTracker.el.contains(document.elementFromPoint(
10870
+ // add-back origins to get coordinate relative to top-left of window viewport
10871
+ positionLeft + originLeft - window.scrollX, positionTop + originTop - window.scrollY))) &&
10854
10872
  (!bestHit || hit.layer > bestHit.layer)) {
10855
10873
  hit.componentId = id;
10856
10874
  hit.context = component.context;
@@ -11131,7 +11149,7 @@ var FullCalendar = (function (exports) {
11131
11149
  let receivingOptions = receivingContext.options;
11132
11150
  if (initialContext === receivingContext ||
11133
11151
  (receivingOptions.editable && receivingOptions.droppable)) {
11134
- mutation = computeEventMutation(initialHit, hit, receivingContext.getCurrentData().pluginHooks.eventDragMutationMassagers);
11152
+ mutation = computeEventMutation(initialHit, hit, this.eventRange.instance.range.start, receivingContext.getCurrentData().pluginHooks.eventDragMutationMassagers);
11135
11153
  if (mutation) {
11136
11154
  mutatedRelevantEvents = applyMutationToEventStore(relevantEvents, receivingContext.getCurrentData().eventUiBases, mutation, receivingContext);
11137
11155
  interaction.mutatedEvents = mutatedRelevantEvents;
@@ -11338,7 +11356,7 @@ var FullCalendar = (function (exports) {
11338
11356
  // TODO: test this in IE11
11339
11357
  // QUESTION: why do we need it on the resizable???
11340
11358
  EventDragging.SELECTOR = '.fc-event-draggable, .fc-event-resizable';
11341
- function computeEventMutation(hit0, hit1, massagers) {
11359
+ function computeEventMutation(hit0, hit1, eventInstanceStart, massagers) {
11342
11360
  let dateSpan0 = hit0.dateSpan;
11343
11361
  let dateSpan1 = hit1.dateSpan;
11344
11362
  let date0 = dateSpan0.range.start;
@@ -11350,7 +11368,12 @@ var FullCalendar = (function (exports) {
11350
11368
  if (dateSpan1.allDay) {
11351
11369
  // means date1 is already start-of-day,
11352
11370
  // but date0 needs to be converted
11353
- date0 = startOfDay(date0);
11371
+ date0 = startOfDay(eventInstanceStart);
11372
+ }
11373
+ else {
11374
+ // Moving from allDate->timed
11375
+ // Doesn't matter where on the event the drag began, mutate the event's start-date to date1
11376
+ date0 = eventInstanceStart;
11354
11377
  }
11355
11378
  }
11356
11379
  let delta = diffDates(date0, date1, hit0.context.dateEnv, hit0.componentId === hit1.componentId ?
@@ -11917,7 +11940,10 @@ var FullCalendar = (function (exports) {
11917
11940
  if (typeof settings.mirrorSelector === 'string') {
11918
11941
  dragging.mirrorSelector = settings.mirrorSelector;
11919
11942
  }
11920
- new ExternalElementDragging(dragging, settings.eventData); // eslint-disable-line no-new
11943
+ let externalDragging = new ExternalElementDragging(dragging, settings.eventData);
11944
+ // The hit-detection system requires that the dnd-mirror-element be pointer-events:none,
11945
+ // but this can't be guaranteed for third-party draggables, so disable
11946
+ externalDragging.hitDragging.disablePointCheck = true;
11921
11947
  }
11922
11948
  destroy() {
11923
11949
  this.dragging.destroy();