@fullcalendar/interaction 6.1.0 → 6.1.1
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.esm.js → index.cjs} +126 -120
- package/index.global.js +2 -2
- package/index.global.min.js +2 -2
- package/index.js +120 -126
- package/package.json +8 -7
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { config, Emitter, elementClosest, applyStyle, whenTransitionDone, removeElement, ScrollController, ElementScrollController, computeInnerRect, WindowScrollController, ElementDragging, preventSelection, preventContextMenu, allowSelection, allowContextMenu, computeRect, getClippingParents, pointInsideRect, constrainPoint, intersectRects, getRectCenter, diffPoints, mapHash, rangeContainsRange, isDateSpansEqual, Interaction, interactionSettingsToStore, isDateSelectionValid, enableCursor, disableCursor, triggerDateSelect, compareNumbers, getElSeg, getRelevantEvents, EventImpl, createEmptyEventStore, applyMutationToEventStore, isInteractionValid, buildEventApis, interactionSettingsStore, startOfDay, diffDates, createDuration, getEventTargetViaRoot, identity, eventTupleToStore, parseDragMeta, elementMatches, refineEventDef, parseEventDef, getDefaultEventEnd, createEventInstance, BASE_OPTION_DEFAULTS } from '@fullcalendar/core/internal';
|
|
1
|
+
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index_cjs = require('@fullcalendar/core/index.cjs');
|
|
6
|
+
var internal_cjs = require('@fullcalendar/core/internal.cjs');
|
|
7
|
+
|
|
8
|
+
internal_cjs.config.touchMouseIgnoreWait = 500;
|
|
5
9
|
let ignoreMouseDepth = 0;
|
|
6
10
|
let listenerCnt = 0;
|
|
7
11
|
let isWindowTouchMoveCancelled = false;
|
|
@@ -115,7 +119,7 @@ class PointerDragging {
|
|
|
115
119
|
}
|
|
116
120
|
};
|
|
117
121
|
this.containerEl = containerEl;
|
|
118
|
-
this.emitter = new Emitter();
|
|
122
|
+
this.emitter = new internal_cjs.Emitter();
|
|
119
123
|
containerEl.addEventListener('mousedown', this.handleMouseDown);
|
|
120
124
|
containerEl.addEventListener('touchstart', this.handleTouchStart, { passive: true });
|
|
121
125
|
listenerCreated();
|
|
@@ -129,7 +133,7 @@ class PointerDragging {
|
|
|
129
133
|
let subjectEl = this.querySubjectEl(ev);
|
|
130
134
|
let downEl = ev.target;
|
|
131
135
|
if (subjectEl &&
|
|
132
|
-
(!this.handleSelector || elementClosest(downEl, this.handleSelector))) {
|
|
136
|
+
(!this.handleSelector || internal_cjs.elementClosest(downEl, this.handleSelector))) {
|
|
133
137
|
this.subjectEl = subjectEl;
|
|
134
138
|
this.isDragging = true; // do this first so cancelTouchScroll will work
|
|
135
139
|
this.wasTouchScroll = false;
|
|
@@ -146,7 +150,7 @@ class PointerDragging {
|
|
|
146
150
|
}
|
|
147
151
|
querySubjectEl(ev) {
|
|
148
152
|
if (this.selector) {
|
|
149
|
-
return elementClosest(ev.target, this.selector);
|
|
153
|
+
return internal_cjs.elementClosest(ev.target, this.selector);
|
|
150
154
|
}
|
|
151
155
|
return this.containerEl;
|
|
152
156
|
}
|
|
@@ -250,7 +254,7 @@ function startIgnoringMouse() {
|
|
|
250
254
|
ignoreMouseDepth += 1;
|
|
251
255
|
setTimeout(() => {
|
|
252
256
|
ignoreMouseDepth -= 1;
|
|
253
|
-
}, config.touchMouseIgnoreWait);
|
|
257
|
+
}, internal_cjs.config.touchMouseIgnoreWait);
|
|
254
258
|
}
|
|
255
259
|
// We want to attach touchmove as early as possible for Safari
|
|
256
260
|
// ----------------------------------------------------------------------------------------------------
|
|
@@ -344,25 +348,25 @@ class ElementMirror {
|
|
|
344
348
|
mirrorEl.style.transition =
|
|
345
349
|
'top ' + revertDuration + 'ms,' +
|
|
346
350
|
'left ' + revertDuration + 'ms';
|
|
347
|
-
applyStyle(mirrorEl, {
|
|
351
|
+
internal_cjs.applyStyle(mirrorEl, {
|
|
348
352
|
left: finalSourceElRect.left,
|
|
349
353
|
top: finalSourceElRect.top,
|
|
350
354
|
});
|
|
351
|
-
whenTransitionDone(mirrorEl, () => {
|
|
355
|
+
internal_cjs.whenTransitionDone(mirrorEl, () => {
|
|
352
356
|
mirrorEl.style.transition = '';
|
|
353
357
|
callback();
|
|
354
358
|
});
|
|
355
359
|
}
|
|
356
360
|
cleanup() {
|
|
357
361
|
if (this.mirrorEl) {
|
|
358
|
-
removeElement(this.mirrorEl);
|
|
362
|
+
internal_cjs.removeElement(this.mirrorEl);
|
|
359
363
|
this.mirrorEl = null;
|
|
360
364
|
}
|
|
361
365
|
this.sourceEl = null;
|
|
362
366
|
}
|
|
363
367
|
updateElPosition() {
|
|
364
368
|
if (this.sourceEl && this.isVisible) {
|
|
365
|
-
applyStyle(this.getMirrorEl(), {
|
|
369
|
+
internal_cjs.applyStyle(this.getMirrorEl(), {
|
|
366
370
|
left: this.sourceElRect.left + this.deltaX,
|
|
367
371
|
top: this.sourceElRect.top + this.deltaY,
|
|
368
372
|
});
|
|
@@ -377,7 +381,7 @@ class ElementMirror {
|
|
|
377
381
|
// would use preventSelection(), but that prevents selectstart, causing problems.
|
|
378
382
|
mirrorEl.classList.add('fc-unselectable');
|
|
379
383
|
mirrorEl.classList.add('fc-event-dragging');
|
|
380
|
-
applyStyle(mirrorEl, {
|
|
384
|
+
internal_cjs.applyStyle(mirrorEl, {
|
|
381
385
|
position: 'fixed',
|
|
382
386
|
zIndex: this.zIndex,
|
|
383
387
|
visibility: '',
|
|
@@ -402,7 +406,7 @@ The cache can be in one of two modes:
|
|
|
402
406
|
- doesListening:false - ignores when the container is scrolled by someone else
|
|
403
407
|
- doesListening:true - watch for scrolling and update the cache
|
|
404
408
|
*/
|
|
405
|
-
class ScrollGeomCache extends ScrollController {
|
|
409
|
+
class ScrollGeomCache extends internal_cjs.ScrollController {
|
|
406
410
|
constructor(scrollController, doesListening) {
|
|
407
411
|
super();
|
|
408
412
|
this.handleScroll = () => {
|
|
@@ -470,19 +474,19 @@ class ScrollGeomCache extends ScrollController {
|
|
|
470
474
|
|
|
471
475
|
class ElementScrollGeomCache extends ScrollGeomCache {
|
|
472
476
|
constructor(el, doesListening) {
|
|
473
|
-
super(new ElementScrollController(el), doesListening);
|
|
477
|
+
super(new internal_cjs.ElementScrollController(el), doesListening);
|
|
474
478
|
}
|
|
475
479
|
getEventTarget() {
|
|
476
480
|
return this.scrollController.el;
|
|
477
481
|
}
|
|
478
482
|
computeClientRect() {
|
|
479
|
-
return computeInnerRect(this.scrollController.el);
|
|
483
|
+
return internal_cjs.computeInnerRect(this.scrollController.el);
|
|
480
484
|
}
|
|
481
485
|
}
|
|
482
486
|
|
|
483
487
|
class WindowScrollGeomCache extends ScrollGeomCache {
|
|
484
488
|
constructor(doesListening) {
|
|
485
|
-
super(new WindowScrollController(), doesListening);
|
|
489
|
+
super(new internal_cjs.WindowScrollController(), doesListening);
|
|
486
490
|
}
|
|
487
491
|
getEventTarget() {
|
|
488
492
|
return window;
|
|
@@ -678,7 +682,7 @@ Monitors dragging on an element. Has a number of high-level features:
|
|
|
678
682
|
- minimum wait time ("delay") before dragging
|
|
679
683
|
- a mirror element that follows the pointer
|
|
680
684
|
*/
|
|
681
|
-
class FeaturefulElementDragging extends ElementDragging {
|
|
685
|
+
class FeaturefulElementDragging extends internal_cjs.ElementDragging {
|
|
682
686
|
constructor(containerEl, selector) {
|
|
683
687
|
super(containerEl);
|
|
684
688
|
this.containerEl = containerEl;
|
|
@@ -698,8 +702,8 @@ class FeaturefulElementDragging extends ElementDragging {
|
|
|
698
702
|
this.isInteracting = true;
|
|
699
703
|
this.isDelayEnded = false;
|
|
700
704
|
this.isDistanceSurpassed = false;
|
|
701
|
-
preventSelection(document.body);
|
|
702
|
-
preventContextMenu(document.body);
|
|
705
|
+
internal_cjs.preventSelection(document.body);
|
|
706
|
+
internal_cjs.preventContextMenu(document.body);
|
|
703
707
|
// prevent links from being visited if there's an eventual drag.
|
|
704
708
|
// also prevents selection in older browsers (maybe?).
|
|
705
709
|
// not necessary for touch, besides, browser would complain about passiveness.
|
|
@@ -744,8 +748,8 @@ class FeaturefulElementDragging extends ElementDragging {
|
|
|
744
748
|
this.onPointerUp = (ev) => {
|
|
745
749
|
if (this.isInteracting) {
|
|
746
750
|
this.isInteracting = false;
|
|
747
|
-
allowSelection(document.body);
|
|
748
|
-
allowContextMenu(document.body);
|
|
751
|
+
internal_cjs.allowSelection(document.body);
|
|
752
|
+
internal_cjs.allowContextMenu(document.body);
|
|
749
753
|
this.emitter.trigger('pointerup', ev); // can potentially set mirrorNeedsRevert
|
|
750
754
|
if (this.isDragging) {
|
|
751
755
|
this.autoScroller.stop();
|
|
@@ -839,9 +843,9 @@ and an determine if a given point is inside the combined clipping rectangle.
|
|
|
839
843
|
*/
|
|
840
844
|
class OffsetTracker {
|
|
841
845
|
constructor(el) {
|
|
842
|
-
this.origRect = computeRect(el);
|
|
846
|
+
this.origRect = internal_cjs.computeRect(el);
|
|
843
847
|
// will work fine for divs that have overflow:hidden
|
|
844
|
-
this.scrollCaches = getClippingParents(el).map((scrollEl) => new ElementScrollGeomCache(scrollEl, true));
|
|
848
|
+
this.scrollCaches = internal_cjs.getClippingParents(el).map((scrollEl) => new ElementScrollGeomCache(scrollEl, true));
|
|
845
849
|
}
|
|
846
850
|
destroy() {
|
|
847
851
|
for (let scrollCache of this.scrollCaches) {
|
|
@@ -866,7 +870,7 @@ class OffsetTracker {
|
|
|
866
870
|
let point = { left: pageX, top: pageY };
|
|
867
871
|
for (let scrollCache of this.scrollCaches) {
|
|
868
872
|
if (!isIgnoredClipping(scrollCache.getEventTarget()) &&
|
|
869
|
-
!pointInsideRect(point, scrollCache.clientRect)) {
|
|
873
|
+
!internal_cjs.pointInsideRect(point, scrollCache.clientRect)) {
|
|
870
874
|
return false;
|
|
871
875
|
}
|
|
872
876
|
}
|
|
@@ -944,7 +948,7 @@ class HitDragging {
|
|
|
944
948
|
dragging.emitter.on('pointerup', this.handlePointerUp);
|
|
945
949
|
dragging.emitter.on('dragend', this.handleDragEnd);
|
|
946
950
|
this.dragging = dragging;
|
|
947
|
-
this.emitter = new Emitter();
|
|
951
|
+
this.emitter = new internal_cjs.Emitter();
|
|
948
952
|
}
|
|
949
953
|
// sets initialHit
|
|
950
954
|
// sets coordAdjust
|
|
@@ -954,18 +958,18 @@ class HitDragging {
|
|
|
954
958
|
let subjectEl = ev.subjectEl;
|
|
955
959
|
let subjectRect;
|
|
956
960
|
if (subjectEl instanceof HTMLElement) { // i.e. not a Document/ShadowRoot
|
|
957
|
-
subjectRect = computeRect(subjectEl);
|
|
958
|
-
adjustedPoint = constrainPoint(adjustedPoint, subjectRect);
|
|
961
|
+
subjectRect = internal_cjs.computeRect(subjectEl);
|
|
962
|
+
adjustedPoint = internal_cjs.constrainPoint(adjustedPoint, subjectRect);
|
|
959
963
|
}
|
|
960
964
|
let initialHit = this.initialHit = this.queryHitForOffset(adjustedPoint.left, adjustedPoint.top);
|
|
961
965
|
if (initialHit) {
|
|
962
966
|
if (this.useSubjectCenter && subjectRect) {
|
|
963
|
-
let slicedSubjectRect = intersectRects(subjectRect, initialHit.rect);
|
|
967
|
+
let slicedSubjectRect = internal_cjs.intersectRects(subjectRect, initialHit.rect);
|
|
964
968
|
if (slicedSubjectRect) {
|
|
965
|
-
adjustedPoint = getRectCenter(slicedSubjectRect);
|
|
969
|
+
adjustedPoint = internal_cjs.getRectCenter(slicedSubjectRect);
|
|
966
970
|
}
|
|
967
971
|
}
|
|
968
|
-
this.coordAdjust = diffPoints(adjustedPoint, origPoint);
|
|
972
|
+
this.coordAdjust = internal_cjs.diffPoints(adjustedPoint, origPoint);
|
|
969
973
|
}
|
|
970
974
|
else {
|
|
971
975
|
this.coordAdjust = { left: 0, top: 0 };
|
|
@@ -979,7 +983,7 @@ class HitDragging {
|
|
|
979
983
|
}
|
|
980
984
|
}
|
|
981
985
|
prepareHits() {
|
|
982
|
-
this.offsetTrackers = mapHash(this.droppableStore, (interactionSettings) => {
|
|
986
|
+
this.offsetTrackers = internal_cjs.mapHash(this.droppableStore, (interactionSettings) => {
|
|
983
987
|
interactionSettings.component.prepareHits();
|
|
984
988
|
return new OffsetTracker(interactionSettings.el);
|
|
985
989
|
});
|
|
@@ -1013,7 +1017,7 @@ class HitDragging {
|
|
|
1013
1017
|
let hit = component.queryHit(positionLeft, positionTop, width, height);
|
|
1014
1018
|
if (hit && (
|
|
1015
1019
|
// make sure the hit is within activeRange, meaning it's not a dead cell
|
|
1016
|
-
rangeContainsRange(hit.dateProfile.activeRange, hit.dateSpan.range)) &&
|
|
1020
|
+
internal_cjs.rangeContainsRange(hit.dateProfile.activeRange, hit.dateSpan.range)) &&
|
|
1017
1021
|
(!bestHit || hit.layer > bestHit.layer)) {
|
|
1018
1022
|
hit.componentId = id;
|
|
1019
1023
|
hit.context = component.context;
|
|
@@ -1037,7 +1041,7 @@ function isHitsEqual(hit0, hit1) {
|
|
|
1037
1041
|
if (Boolean(hit0) !== Boolean(hit1)) {
|
|
1038
1042
|
return false;
|
|
1039
1043
|
}
|
|
1040
|
-
return isDateSpansEqual(hit0.dateSpan, hit1.dateSpan);
|
|
1044
|
+
return internal_cjs.isDateSpansEqual(hit0.dateSpan, hit1.dateSpan);
|
|
1041
1045
|
}
|
|
1042
1046
|
|
|
1043
1047
|
function buildDatePointApiWithContext(dateSpan, context) {
|
|
@@ -1060,7 +1064,7 @@ function buildDatePointApi(span, dateEnv) {
|
|
|
1060
1064
|
Monitors when the user clicks on a specific date/time of a component.
|
|
1061
1065
|
A pointerdown+pointerup on the same "hit" constitutes a click.
|
|
1062
1066
|
*/
|
|
1063
|
-
class DateClicking extends Interaction {
|
|
1067
|
+
class DateClicking extends internal_cjs.Interaction {
|
|
1064
1068
|
constructor(settings) {
|
|
1065
1069
|
super(settings);
|
|
1066
1070
|
this.handlePointerDown = (pev) => {
|
|
@@ -1085,7 +1089,7 @@ class DateClicking extends Interaction {
|
|
|
1085
1089
|
// we DO want to watch pointer moves because otherwise finalHit won't get populated
|
|
1086
1090
|
this.dragging = new FeaturefulElementDragging(settings.el);
|
|
1087
1091
|
this.dragging.autoScroller.isEnabled = false;
|
|
1088
|
-
let hitDragging = this.hitDragging = new HitDragging(this.dragging, interactionSettingsToStore(settings));
|
|
1092
|
+
let hitDragging = this.hitDragging = new HitDragging(this.dragging, internal_cjs.interactionSettingsToStore(settings));
|
|
1089
1093
|
hitDragging.emitter.on('pointerdown', this.handlePointerDown);
|
|
1090
1094
|
hitDragging.emitter.on('dragend', this.handleDragEnd);
|
|
1091
1095
|
}
|
|
@@ -1098,7 +1102,7 @@ class DateClicking extends Interaction {
|
|
|
1098
1102
|
Tracks when the user selects a portion of time of a component,
|
|
1099
1103
|
constituted by a drag over date cells, with a possible delay at the beginning of the drag.
|
|
1100
1104
|
*/
|
|
1101
|
-
class DateSelecting extends Interaction {
|
|
1105
|
+
class DateSelecting extends internal_cjs.Interaction {
|
|
1102
1106
|
constructor(settings) {
|
|
1103
1107
|
super(settings);
|
|
1104
1108
|
this.dragSelection = null;
|
|
@@ -1127,7 +1131,7 @@ class DateSelecting extends Interaction {
|
|
|
1127
1131
|
if (!disallowed) {
|
|
1128
1132
|
dragSelection = joinHitsIntoSelection(initialHit, hit, context.pluginHooks.dateSelectionTransformers);
|
|
1129
1133
|
}
|
|
1130
|
-
if (!dragSelection || !isDateSelectionValid(dragSelection, hit.dateProfile, context)) {
|
|
1134
|
+
if (!dragSelection || !internal_cjs.isDateSelectionValid(dragSelection, hit.dateProfile, context)) {
|
|
1131
1135
|
isInvalid = true;
|
|
1132
1136
|
dragSelection = null;
|
|
1133
1137
|
}
|
|
@@ -1139,10 +1143,10 @@ class DateSelecting extends Interaction {
|
|
|
1139
1143
|
context.dispatch({ type: 'UNSELECT_DATES' });
|
|
1140
1144
|
}
|
|
1141
1145
|
if (!isInvalid) {
|
|
1142
|
-
enableCursor();
|
|
1146
|
+
internal_cjs.enableCursor();
|
|
1143
1147
|
}
|
|
1144
1148
|
else {
|
|
1145
|
-
disableCursor();
|
|
1149
|
+
internal_cjs.disableCursor();
|
|
1146
1150
|
}
|
|
1147
1151
|
if (!isFinal) {
|
|
1148
1152
|
this.dragSelection = dragSelection; // only clear if moved away from all hits while dragging
|
|
@@ -1151,7 +1155,7 @@ class DateSelecting extends Interaction {
|
|
|
1151
1155
|
this.handlePointerUp = (pev) => {
|
|
1152
1156
|
if (this.dragSelection) {
|
|
1153
1157
|
// selection is already rendered, so just need to report selection
|
|
1154
|
-
triggerDateSelect(this.dragSelection, pev, this.component.context);
|
|
1158
|
+
internal_cjs.triggerDateSelect(this.dragSelection, pev, this.component.context);
|
|
1155
1159
|
this.dragSelection = null;
|
|
1156
1160
|
}
|
|
1157
1161
|
};
|
|
@@ -1161,7 +1165,7 @@ class DateSelecting extends Interaction {
|
|
|
1161
1165
|
dragging.touchScrollAllowed = false;
|
|
1162
1166
|
dragging.minDistance = options.selectMinDistance || 0;
|
|
1163
1167
|
dragging.autoScroller.isEnabled = options.dragScroll;
|
|
1164
|
-
let hitDragging = this.hitDragging = new HitDragging(this.dragging, interactionSettingsToStore(settings));
|
|
1168
|
+
let hitDragging = this.hitDragging = new HitDragging(this.dragging, internal_cjs.interactionSettingsToStore(settings));
|
|
1165
1169
|
hitDragging.emitter.on('pointerdown', this.handlePointerDown);
|
|
1166
1170
|
hitDragging.emitter.on('dragstart', this.handleDragStart);
|
|
1167
1171
|
hitDragging.emitter.on('hitupdate', this.handleHitUpdate);
|
|
@@ -1188,7 +1192,7 @@ function joinHitsIntoSelection(hit0, hit1, dateSelectionTransformers) {
|
|
|
1188
1192
|
dateSpan1.range.start,
|
|
1189
1193
|
dateSpan1.range.end,
|
|
1190
1194
|
];
|
|
1191
|
-
ms.sort(compareNumbers);
|
|
1195
|
+
ms.sort(internal_cjs.compareNumbers);
|
|
1192
1196
|
let props = {};
|
|
1193
1197
|
for (let transformer of dateSelectionTransformers) {
|
|
1194
1198
|
let res = transformer(hit0, hit1);
|
|
@@ -1204,7 +1208,7 @@ function joinHitsIntoSelection(hit0, hit1, dateSelectionTransformers) {
|
|
|
1204
1208
|
return props;
|
|
1205
1209
|
}
|
|
1206
1210
|
|
|
1207
|
-
class EventDragging extends Interaction {
|
|
1211
|
+
class EventDragging extends internal_cjs.Interaction {
|
|
1208
1212
|
constructor(settings) {
|
|
1209
1213
|
super(settings);
|
|
1210
1214
|
// internal state
|
|
@@ -1223,10 +1227,10 @@ class EventDragging extends Interaction {
|
|
|
1223
1227
|
let { options } = component.context;
|
|
1224
1228
|
let initialContext = component.context;
|
|
1225
1229
|
this.subjectEl = ev.subjectEl;
|
|
1226
|
-
let subjectSeg = this.subjectSeg = getElSeg(ev.subjectEl);
|
|
1230
|
+
let subjectSeg = this.subjectSeg = internal_cjs.getElSeg(ev.subjectEl);
|
|
1227
1231
|
let eventRange = this.eventRange = subjectSeg.eventRange;
|
|
1228
1232
|
let eventInstanceId = eventRange.instance.instanceId;
|
|
1229
|
-
this.relevantEvents = getRelevantEvents(initialContext.getCurrentData().eventStore, eventInstanceId);
|
|
1233
|
+
this.relevantEvents = internal_cjs.getRelevantEvents(initialContext.getCurrentData().eventStore, eventInstanceId);
|
|
1230
1234
|
dragging.minDistance = ev.isTouch ? 0 : options.eventDragMinDistance;
|
|
1231
1235
|
dragging.delay =
|
|
1232
1236
|
// only do a touch delay if touch and this event hasn't been selected yet
|
|
@@ -1237,11 +1241,11 @@ class EventDragging extends Interaction {
|
|
|
1237
1241
|
mirror.parentNode = options.fixedMirrorParent;
|
|
1238
1242
|
}
|
|
1239
1243
|
else {
|
|
1240
|
-
mirror.parentNode = elementClosest(origTarget, '.fc');
|
|
1244
|
+
mirror.parentNode = internal_cjs.elementClosest(origTarget, '.fc');
|
|
1241
1245
|
}
|
|
1242
1246
|
mirror.revertDuration = options.dragRevertDuration;
|
|
1243
1247
|
let isValid = component.isValidSegDownEl(origTarget) &&
|
|
1244
|
-
!elementClosest(origTarget, '.fc-event-resizer'); // NOT on a resizer
|
|
1248
|
+
!internal_cjs.elementClosest(origTarget, '.fc-event-resizer'); // NOT on a resizer
|
|
1245
1249
|
dragging.setIgnoreMove(!isValid);
|
|
1246
1250
|
// disable dragging for elements that are resizable (ie, selectable)
|
|
1247
1251
|
// but are not draggable
|
|
@@ -1266,7 +1270,7 @@ class EventDragging extends Interaction {
|
|
|
1266
1270
|
initialContext.calendarApi.unselect(ev); // unselect *date* selection
|
|
1267
1271
|
initialContext.emitter.trigger('eventDragStart', {
|
|
1268
1272
|
el: this.subjectEl,
|
|
1269
|
-
event: new EventImpl(initialContext, eventRange.def, eventRange.instance),
|
|
1273
|
+
event: new internal_cjs.EventImpl(initialContext, eventRange.def, eventRange.instance),
|
|
1270
1274
|
jsEvent: ev.origEvent,
|
|
1271
1275
|
view: initialContext.viewApi,
|
|
1272
1276
|
});
|
|
@@ -1286,7 +1290,7 @@ class EventDragging extends Interaction {
|
|
|
1286
1290
|
let isInvalid = false;
|
|
1287
1291
|
let interaction = {
|
|
1288
1292
|
affectedEvents: relevantEvents,
|
|
1289
|
-
mutatedEvents: createEmptyEventStore(),
|
|
1293
|
+
mutatedEvents: internal_cjs.createEmptyEventStore(),
|
|
1290
1294
|
isEvent: true,
|
|
1291
1295
|
};
|
|
1292
1296
|
if (hit) {
|
|
@@ -1296,13 +1300,13 @@ class EventDragging extends Interaction {
|
|
|
1296
1300
|
(receivingOptions.editable && receivingOptions.droppable)) {
|
|
1297
1301
|
mutation = computeEventMutation(initialHit, hit, receivingContext.getCurrentData().pluginHooks.eventDragMutationMassagers);
|
|
1298
1302
|
if (mutation) {
|
|
1299
|
-
mutatedRelevantEvents = applyMutationToEventStore(relevantEvents, receivingContext.getCurrentData().eventUiBases, mutation, receivingContext);
|
|
1303
|
+
mutatedRelevantEvents = internal_cjs.applyMutationToEventStore(relevantEvents, receivingContext.getCurrentData().eventUiBases, mutation, receivingContext);
|
|
1300
1304
|
interaction.mutatedEvents = mutatedRelevantEvents;
|
|
1301
|
-
if (!isInteractionValid(interaction, hit.dateProfile, receivingContext)) {
|
|
1305
|
+
if (!internal_cjs.isInteractionValid(interaction, hit.dateProfile, receivingContext)) {
|
|
1302
1306
|
isInvalid = true;
|
|
1303
1307
|
mutation = null;
|
|
1304
1308
|
mutatedRelevantEvents = null;
|
|
1305
|
-
interaction.mutatedEvents = createEmptyEventStore();
|
|
1309
|
+
interaction.mutatedEvents = internal_cjs.createEmptyEventStore();
|
|
1306
1310
|
}
|
|
1307
1311
|
}
|
|
1308
1312
|
}
|
|
@@ -1312,10 +1316,10 @@ class EventDragging extends Interaction {
|
|
|
1312
1316
|
}
|
|
1313
1317
|
this.displayDrag(receivingContext, interaction);
|
|
1314
1318
|
if (!isInvalid) {
|
|
1315
|
-
enableCursor();
|
|
1319
|
+
internal_cjs.enableCursor();
|
|
1316
1320
|
}
|
|
1317
1321
|
else {
|
|
1318
|
-
disableCursor();
|
|
1322
|
+
internal_cjs.disableCursor();
|
|
1319
1323
|
}
|
|
1320
1324
|
if (!isFinal) {
|
|
1321
1325
|
if (initialContext === receivingContext && // TODO: write test for this
|
|
@@ -1344,7 +1348,7 @@ class EventDragging extends Interaction {
|
|
|
1344
1348
|
let { receivingContext, validMutation } = this;
|
|
1345
1349
|
let eventDef = this.eventRange.def;
|
|
1346
1350
|
let eventInstance = this.eventRange.instance;
|
|
1347
|
-
let eventApi = new EventImpl(initialContext, eventDef, eventInstance);
|
|
1351
|
+
let eventApi = new internal_cjs.EventImpl(initialContext, eventDef, eventInstance);
|
|
1348
1352
|
let relevantEvents = this.relevantEvents;
|
|
1349
1353
|
let mutatedRelevantEvents = this.mutatedRelevantEvents;
|
|
1350
1354
|
let { finalHit } = this.hitDragging;
|
|
@@ -1358,7 +1362,7 @@ class EventDragging extends Interaction {
|
|
|
1358
1362
|
if (validMutation) {
|
|
1359
1363
|
// dropped within same calendar
|
|
1360
1364
|
if (receivingContext === initialContext) {
|
|
1361
|
-
let updatedEventApi = new EventImpl(initialContext, mutatedRelevantEvents.defs[eventDef.defId], eventInstance ? mutatedRelevantEvents.instances[eventInstance.instanceId] : null);
|
|
1365
|
+
let updatedEventApi = new internal_cjs.EventImpl(initialContext, mutatedRelevantEvents.defs[eventDef.defId], eventInstance ? mutatedRelevantEvents.instances[eventInstance.instanceId] : null);
|
|
1362
1366
|
initialContext.dispatch({
|
|
1363
1367
|
type: 'MERGE_EVENTS',
|
|
1364
1368
|
eventStore: mutatedRelevantEvents,
|
|
@@ -1366,7 +1370,7 @@ class EventDragging extends Interaction {
|
|
|
1366
1370
|
let eventChangeArg = {
|
|
1367
1371
|
oldEvent: eventApi,
|
|
1368
1372
|
event: updatedEventApi,
|
|
1369
|
-
relatedEvents: buildEventApis(mutatedRelevantEvents, initialContext, eventInstance),
|
|
1373
|
+
relatedEvents: internal_cjs.buildEventApis(mutatedRelevantEvents, initialContext, eventInstance),
|
|
1370
1374
|
revert() {
|
|
1371
1375
|
initialContext.dispatch({
|
|
1372
1376
|
type: 'MERGE_EVENTS',
|
|
@@ -1385,7 +1389,7 @@ class EventDragging extends Interaction {
|
|
|
1385
1389
|
else if (receivingContext) {
|
|
1386
1390
|
let eventRemoveArg = {
|
|
1387
1391
|
event: eventApi,
|
|
1388
|
-
relatedEvents: buildEventApis(relevantEvents, initialContext, eventInstance),
|
|
1392
|
+
relatedEvents: internal_cjs.buildEventApis(relevantEvents, initialContext, eventInstance),
|
|
1389
1393
|
revert() {
|
|
1390
1394
|
initialContext.dispatch({
|
|
1391
1395
|
type: 'MERGE_EVENTS',
|
|
@@ -1401,14 +1405,14 @@ class EventDragging extends Interaction {
|
|
|
1401
1405
|
initialContext.emitter.trigger('eventRemove', eventRemoveArg);
|
|
1402
1406
|
let addedEventDef = mutatedRelevantEvents.defs[eventDef.defId];
|
|
1403
1407
|
let addedEventInstance = mutatedRelevantEvents.instances[eventInstance.instanceId];
|
|
1404
|
-
let addedEventApi = new EventImpl(receivingContext, addedEventDef, addedEventInstance);
|
|
1408
|
+
let addedEventApi = new internal_cjs.EventImpl(receivingContext, addedEventDef, addedEventInstance);
|
|
1405
1409
|
receivingContext.dispatch({
|
|
1406
1410
|
type: 'MERGE_EVENTS',
|
|
1407
1411
|
eventStore: mutatedRelevantEvents,
|
|
1408
1412
|
});
|
|
1409
1413
|
let eventAddArg = {
|
|
1410
1414
|
event: addedEventApi,
|
|
1411
|
-
relatedEvents: buildEventApis(mutatedRelevantEvents, receivingContext, addedEventInstance),
|
|
1415
|
+
relatedEvents: internal_cjs.buildEventApis(mutatedRelevantEvents, receivingContext, addedEventInstance),
|
|
1412
1416
|
revert() {
|
|
1413
1417
|
receivingContext.dispatch({
|
|
1414
1418
|
type: 'REMOVE_EVENTS',
|
|
@@ -1439,7 +1443,7 @@ class EventDragging extends Interaction {
|
|
|
1439
1443
|
dragging.pointer.selector = EventDragging.SELECTOR;
|
|
1440
1444
|
dragging.touchScrollAllowed = false;
|
|
1441
1445
|
dragging.autoScroller.isEnabled = options.dragScroll;
|
|
1442
|
-
let hitDragging = this.hitDragging = new HitDragging(this.dragging, interactionSettingsStore);
|
|
1446
|
+
let hitDragging = this.hitDragging = new HitDragging(this.dragging, internal_cjs.interactionSettingsStore);
|
|
1443
1447
|
hitDragging.useSubjectCenter = settings.useEventCenter;
|
|
1444
1448
|
hitDragging.emitter.on('pointerdown', this.handlePointerDown);
|
|
1445
1449
|
hitDragging.emitter.on('dragstart', this.handleDragStart);
|
|
@@ -1463,7 +1467,7 @@ class EventDragging extends Interaction {
|
|
|
1463
1467
|
type: 'SET_EVENT_DRAG',
|
|
1464
1468
|
state: {
|
|
1465
1469
|
affectedEvents: state.affectedEvents,
|
|
1466
|
-
mutatedEvents: createEmptyEventStore(),
|
|
1470
|
+
mutatedEvents: internal_cjs.createEmptyEventStore(),
|
|
1467
1471
|
isEvent: true,
|
|
1468
1472
|
},
|
|
1469
1473
|
});
|
|
@@ -1513,10 +1517,10 @@ function computeEventMutation(hit0, hit1, massagers) {
|
|
|
1513
1517
|
if (dateSpan1.allDay) {
|
|
1514
1518
|
// means date1 is already start-of-day,
|
|
1515
1519
|
// but date0 needs to be converted
|
|
1516
|
-
date0 = startOfDay(date0);
|
|
1520
|
+
date0 = internal_cjs.startOfDay(date0);
|
|
1517
1521
|
}
|
|
1518
1522
|
}
|
|
1519
|
-
let delta = diffDates(date0, date1, hit0.context.dateEnv, hit0.componentId === hit1.componentId ?
|
|
1523
|
+
let delta = internal_cjs.diffDates(date0, date1, hit0.context.dateEnv, hit0.componentId === hit1.componentId ?
|
|
1520
1524
|
hit0.largeUnit :
|
|
1521
1525
|
null);
|
|
1522
1526
|
if (delta.milliseconds) { // has hours/minutes/seconds
|
|
@@ -1540,7 +1544,7 @@ function getComponentTouchDelay(component) {
|
|
|
1540
1544
|
return delay;
|
|
1541
1545
|
}
|
|
1542
1546
|
|
|
1543
|
-
class EventResizing extends Interaction {
|
|
1547
|
+
class EventResizing extends internal_cjs.Interaction {
|
|
1544
1548
|
constructor(settings) {
|
|
1545
1549
|
super(settings);
|
|
1546
1550
|
// internal state
|
|
@@ -1553,7 +1557,7 @@ class EventResizing extends Interaction {
|
|
|
1553
1557
|
this.handlePointerDown = (ev) => {
|
|
1554
1558
|
let { component } = this;
|
|
1555
1559
|
let segEl = this.querySegEl(ev);
|
|
1556
|
-
let seg = getElSeg(segEl);
|
|
1560
|
+
let seg = internal_cjs.getElSeg(segEl);
|
|
1557
1561
|
let eventRange = this.eventRange = seg.eventRange;
|
|
1558
1562
|
this.dragging.minDistance = component.context.options.eventDragMinDistance;
|
|
1559
1563
|
// if touch, need to be working with a selected event
|
|
@@ -1563,14 +1567,14 @@ class EventResizing extends Interaction {
|
|
|
1563
1567
|
this.handleDragStart = (ev) => {
|
|
1564
1568
|
let { context } = this.component;
|
|
1565
1569
|
let eventRange = this.eventRange;
|
|
1566
|
-
this.relevantEvents = getRelevantEvents(context.getCurrentData().eventStore, this.eventRange.instance.instanceId);
|
|
1570
|
+
this.relevantEvents = internal_cjs.getRelevantEvents(context.getCurrentData().eventStore, this.eventRange.instance.instanceId);
|
|
1567
1571
|
let segEl = this.querySegEl(ev);
|
|
1568
1572
|
this.draggingSegEl = segEl;
|
|
1569
|
-
this.draggingSeg = getElSeg(segEl);
|
|
1573
|
+
this.draggingSeg = internal_cjs.getElSeg(segEl);
|
|
1570
1574
|
context.calendarApi.unselect();
|
|
1571
1575
|
context.emitter.trigger('eventResizeStart', {
|
|
1572
1576
|
el: segEl,
|
|
1573
|
-
event: new EventImpl(context, eventRange.def, eventRange.instance),
|
|
1577
|
+
event: new internal_cjs.EventImpl(context, eventRange.def, eventRange.instance),
|
|
1574
1578
|
jsEvent: ev.origEvent,
|
|
1575
1579
|
view: context.viewApi,
|
|
1576
1580
|
});
|
|
@@ -1585,7 +1589,7 @@ class EventResizing extends Interaction {
|
|
|
1585
1589
|
let isInvalid = false;
|
|
1586
1590
|
let interaction = {
|
|
1587
1591
|
affectedEvents: relevantEvents,
|
|
1588
|
-
mutatedEvents: createEmptyEventStore(),
|
|
1592
|
+
mutatedEvents: internal_cjs.createEmptyEventStore(),
|
|
1589
1593
|
isEvent: true,
|
|
1590
1594
|
};
|
|
1591
1595
|
if (hit) {
|
|
@@ -1597,9 +1601,9 @@ class EventResizing extends Interaction {
|
|
|
1597
1601
|
}
|
|
1598
1602
|
}
|
|
1599
1603
|
if (mutation) {
|
|
1600
|
-
mutatedRelevantEvents = applyMutationToEventStore(relevantEvents, context.getCurrentData().eventUiBases, mutation, context);
|
|
1604
|
+
mutatedRelevantEvents = internal_cjs.applyMutationToEventStore(relevantEvents, context.getCurrentData().eventUiBases, mutation, context);
|
|
1601
1605
|
interaction.mutatedEvents = mutatedRelevantEvents;
|
|
1602
|
-
if (!isInteractionValid(interaction, hit.dateProfile, context)) {
|
|
1606
|
+
if (!internal_cjs.isInteractionValid(interaction, hit.dateProfile, context)) {
|
|
1603
1607
|
isInvalid = true;
|
|
1604
1608
|
mutation = null;
|
|
1605
1609
|
mutatedRelevantEvents = null;
|
|
@@ -1616,10 +1620,10 @@ class EventResizing extends Interaction {
|
|
|
1616
1620
|
context.dispatch({ type: 'UNSET_EVENT_RESIZE' });
|
|
1617
1621
|
}
|
|
1618
1622
|
if (!isInvalid) {
|
|
1619
|
-
enableCursor();
|
|
1623
|
+
internal_cjs.enableCursor();
|
|
1620
1624
|
}
|
|
1621
1625
|
else {
|
|
1622
|
-
disableCursor();
|
|
1626
|
+
internal_cjs.disableCursor();
|
|
1623
1627
|
}
|
|
1624
1628
|
if (!isFinal) {
|
|
1625
1629
|
if (mutation && isHitsEqual(initialHit, hit)) {
|
|
@@ -1633,7 +1637,7 @@ class EventResizing extends Interaction {
|
|
|
1633
1637
|
let { context } = this.component;
|
|
1634
1638
|
let eventDef = this.eventRange.def;
|
|
1635
1639
|
let eventInstance = this.eventRange.instance;
|
|
1636
|
-
let eventApi = new EventImpl(context, eventDef, eventInstance);
|
|
1640
|
+
let eventApi = new internal_cjs.EventImpl(context, eventDef, eventInstance);
|
|
1637
1641
|
let relevantEvents = this.relevantEvents;
|
|
1638
1642
|
let mutatedRelevantEvents = this.mutatedRelevantEvents;
|
|
1639
1643
|
context.emitter.trigger('eventResizeStop', {
|
|
@@ -1643,7 +1647,7 @@ class EventResizing extends Interaction {
|
|
|
1643
1647
|
view: context.viewApi,
|
|
1644
1648
|
});
|
|
1645
1649
|
if (this.validMutation) {
|
|
1646
|
-
let updatedEventApi = new EventImpl(context, mutatedRelevantEvents.defs[eventDef.defId], eventInstance ? mutatedRelevantEvents.instances[eventInstance.instanceId] : null);
|
|
1650
|
+
let updatedEventApi = new internal_cjs.EventImpl(context, mutatedRelevantEvents.defs[eventDef.defId], eventInstance ? mutatedRelevantEvents.instances[eventInstance.instanceId] : null);
|
|
1647
1651
|
context.dispatch({
|
|
1648
1652
|
type: 'MERGE_EVENTS',
|
|
1649
1653
|
eventStore: mutatedRelevantEvents,
|
|
@@ -1651,7 +1655,7 @@ class EventResizing extends Interaction {
|
|
|
1651
1655
|
let eventChangeArg = {
|
|
1652
1656
|
oldEvent: eventApi,
|
|
1653
1657
|
event: updatedEventApi,
|
|
1654
|
-
relatedEvents: buildEventApis(mutatedRelevantEvents, context, eventInstance),
|
|
1658
|
+
relatedEvents: internal_cjs.buildEventApis(mutatedRelevantEvents, context, eventInstance),
|
|
1655
1659
|
revert() {
|
|
1656
1660
|
context.dispatch({
|
|
1657
1661
|
type: 'MERGE_EVENTS',
|
|
@@ -1659,7 +1663,7 @@ class EventResizing extends Interaction {
|
|
|
1659
1663
|
});
|
|
1660
1664
|
},
|
|
1661
1665
|
};
|
|
1662
|
-
context.emitter.trigger('eventResize', Object.assign(Object.assign({}, eventChangeArg), { el: this.draggingSegEl, startDelta: this.validMutation.startDelta || createDuration(0), endDelta: this.validMutation.endDelta || createDuration(0), jsEvent: ev.origEvent, view: context.viewApi }));
|
|
1666
|
+
context.emitter.trigger('eventResize', Object.assign(Object.assign({}, eventChangeArg), { el: this.draggingSegEl, startDelta: this.validMutation.startDelta || internal_cjs.createDuration(0), endDelta: this.validMutation.endDelta || internal_cjs.createDuration(0), jsEvent: ev.origEvent, view: context.viewApi }));
|
|
1663
1667
|
context.emitter.trigger('eventChange', eventChangeArg);
|
|
1664
1668
|
}
|
|
1665
1669
|
else {
|
|
@@ -1676,7 +1680,7 @@ class EventResizing extends Interaction {
|
|
|
1676
1680
|
dragging.pointer.selector = '.fc-event-resizer';
|
|
1677
1681
|
dragging.touchScrollAllowed = false;
|
|
1678
1682
|
dragging.autoScroller.isEnabled = component.context.options.dragScroll;
|
|
1679
|
-
let hitDragging = this.hitDragging = new HitDragging(this.dragging, interactionSettingsToStore(settings));
|
|
1683
|
+
let hitDragging = this.hitDragging = new HitDragging(this.dragging, internal_cjs.interactionSettingsToStore(settings));
|
|
1680
1684
|
hitDragging.emitter.on('pointerdown', this.handlePointerDown);
|
|
1681
1685
|
hitDragging.emitter.on('dragstart', this.handleDragStart);
|
|
1682
1686
|
hitDragging.emitter.on('hitupdate', this.handleHitUpdate);
|
|
@@ -1686,14 +1690,14 @@ class EventResizing extends Interaction {
|
|
|
1686
1690
|
this.dragging.destroy();
|
|
1687
1691
|
}
|
|
1688
1692
|
querySegEl(ev) {
|
|
1689
|
-
return elementClosest(ev.subjectEl, '.fc-event');
|
|
1693
|
+
return internal_cjs.elementClosest(ev.subjectEl, '.fc-event');
|
|
1690
1694
|
}
|
|
1691
1695
|
}
|
|
1692
1696
|
function computeMutation(hit0, hit1, isFromStart, instanceRange) {
|
|
1693
1697
|
let dateEnv = hit0.context.dateEnv;
|
|
1694
1698
|
let date0 = hit0.dateSpan.range.start;
|
|
1695
1699
|
let date1 = hit1.dateSpan.range.start;
|
|
1696
|
-
let delta = diffDates(date0, date1, dateEnv, hit0.largeUnit);
|
|
1700
|
+
let delta = internal_cjs.diffDates(date0, date1, dateEnv, hit0.largeUnit);
|
|
1697
1701
|
if (isFromStart) {
|
|
1698
1702
|
if (dateEnv.add(instanceRange.start, delta) < instanceRange.end) {
|
|
1699
1703
|
return { startDelta: delta };
|
|
@@ -1718,9 +1722,9 @@ class UnselectAuto {
|
|
|
1718
1722
|
};
|
|
1719
1723
|
this.onDocumentPointerDown = (pev) => {
|
|
1720
1724
|
let unselectCancel = this.context.options.unselectCancel;
|
|
1721
|
-
let downEl = getEventTargetViaRoot(pev.origEvent);
|
|
1722
|
-
this.matchesCancel = !!elementClosest(downEl, unselectCancel);
|
|
1723
|
-
this.matchesEvent = !!elementClosest(downEl, EventDragging.SELECTOR); // interaction started on an event?
|
|
1725
|
+
let downEl = internal_cjs.getEventTargetViaRoot(pev.origEvent);
|
|
1726
|
+
this.matchesCancel = !!internal_cjs.elementClosest(downEl, unselectCancel);
|
|
1727
|
+
this.matchesEvent = !!internal_cjs.elementClosest(downEl, EventDragging.SELECTOR); // interaction started on an event?
|
|
1724
1728
|
};
|
|
1725
1729
|
this.onDocumentPointerUp = (pev) => {
|
|
1726
1730
|
let { context } = this;
|
|
@@ -1761,19 +1765,19 @@ class UnselectAuto {
|
|
|
1761
1765
|
}
|
|
1762
1766
|
|
|
1763
1767
|
const OPTION_REFINERS = {
|
|
1764
|
-
fixedMirrorParent: identity,
|
|
1768
|
+
fixedMirrorParent: internal_cjs.identity,
|
|
1765
1769
|
};
|
|
1766
1770
|
const LISTENER_REFINERS = {
|
|
1767
|
-
dateClick: identity,
|
|
1768
|
-
eventDragStart: identity,
|
|
1769
|
-
eventDragStop: identity,
|
|
1770
|
-
eventDrop: identity,
|
|
1771
|
-
eventResizeStart: identity,
|
|
1772
|
-
eventResizeStop: identity,
|
|
1773
|
-
eventResize: identity,
|
|
1774
|
-
drop: identity,
|
|
1775
|
-
eventReceive: identity,
|
|
1776
|
-
eventLeave: identity,
|
|
1771
|
+
dateClick: internal_cjs.identity,
|
|
1772
|
+
eventDragStart: internal_cjs.identity,
|
|
1773
|
+
eventDragStop: internal_cjs.identity,
|
|
1774
|
+
eventDrop: internal_cjs.identity,
|
|
1775
|
+
eventResizeStart: internal_cjs.identity,
|
|
1776
|
+
eventResizeStop: internal_cjs.identity,
|
|
1777
|
+
eventResize: internal_cjs.identity,
|
|
1778
|
+
drop: internal_cjs.identity,
|
|
1779
|
+
eventReceive: internal_cjs.identity,
|
|
1780
|
+
eventLeave: internal_cjs.identity,
|
|
1777
1781
|
};
|
|
1778
1782
|
|
|
1779
1783
|
/*
|
|
@@ -1796,18 +1800,18 @@ class ExternalElementDragging {
|
|
|
1796
1800
|
let droppableEvent = null;
|
|
1797
1801
|
let isInvalid = false;
|
|
1798
1802
|
let interaction = {
|
|
1799
|
-
affectedEvents: createEmptyEventStore(),
|
|
1800
|
-
mutatedEvents: createEmptyEventStore(),
|
|
1803
|
+
affectedEvents: internal_cjs.createEmptyEventStore(),
|
|
1804
|
+
mutatedEvents: internal_cjs.createEmptyEventStore(),
|
|
1801
1805
|
isEvent: this.dragMeta.create,
|
|
1802
1806
|
};
|
|
1803
1807
|
if (hit) {
|
|
1804
1808
|
receivingContext = hit.context;
|
|
1805
1809
|
if (this.canDropElOnCalendar(ev.subjectEl, receivingContext)) {
|
|
1806
1810
|
droppableEvent = computeEventForDateSpan(hit.dateSpan, this.dragMeta, receivingContext);
|
|
1807
|
-
interaction.mutatedEvents = eventTupleToStore(droppableEvent);
|
|
1808
|
-
isInvalid = !isInteractionValid(interaction, hit.dateProfile, receivingContext);
|
|
1811
|
+
interaction.mutatedEvents = internal_cjs.eventTupleToStore(droppableEvent);
|
|
1812
|
+
isInvalid = !internal_cjs.isInteractionValid(interaction, hit.dateProfile, receivingContext);
|
|
1809
1813
|
if (isInvalid) {
|
|
1810
|
-
interaction.mutatedEvents = createEmptyEventStore();
|
|
1814
|
+
interaction.mutatedEvents = internal_cjs.createEmptyEventStore();
|
|
1811
1815
|
droppableEvent = null;
|
|
1812
1816
|
}
|
|
1813
1817
|
}
|
|
@@ -1817,10 +1821,10 @@ class ExternalElementDragging {
|
|
|
1817
1821
|
// TODO: wish we could somehow wait for dispatch to guarantee render
|
|
1818
1822
|
dragging.setMirrorIsVisible(isFinal || !droppableEvent || !document.querySelector('.fc-event-mirror'));
|
|
1819
1823
|
if (!isInvalid) {
|
|
1820
|
-
enableCursor();
|
|
1824
|
+
internal_cjs.enableCursor();
|
|
1821
1825
|
}
|
|
1822
1826
|
else {
|
|
1823
|
-
disableCursor();
|
|
1827
|
+
internal_cjs.disableCursor();
|
|
1824
1828
|
}
|
|
1825
1829
|
if (!isFinal) {
|
|
1826
1830
|
dragging.setMirrorNeedsRevert(!droppableEvent);
|
|
@@ -1837,7 +1841,7 @@ class ExternalElementDragging {
|
|
|
1837
1841
|
let dragMeta = this.dragMeta;
|
|
1838
1842
|
receivingContext.emitter.trigger('drop', Object.assign(Object.assign({}, buildDatePointApiWithContext(finalHit.dateSpan, receivingContext)), { draggedEl: pev.subjectEl, jsEvent: pev.origEvent, view: finalView }));
|
|
1839
1843
|
if (dragMeta.create) {
|
|
1840
|
-
let addingEvents = eventTupleToStore(droppableEvent);
|
|
1844
|
+
let addingEvents = internal_cjs.eventTupleToStore(droppableEvent);
|
|
1841
1845
|
receivingContext.dispatch({
|
|
1842
1846
|
type: 'MERGE_EVENTS',
|
|
1843
1847
|
eventStore: addingEvents,
|
|
@@ -1850,7 +1854,7 @@ class ExternalElementDragging {
|
|
|
1850
1854
|
}
|
|
1851
1855
|
// signal that an external event landed
|
|
1852
1856
|
receivingContext.emitter.trigger('eventReceive', {
|
|
1853
|
-
event: new EventImpl(receivingContext, droppableEvent.def, droppableEvent.instance),
|
|
1857
|
+
event: new internal_cjs.EventImpl(receivingContext, droppableEvent.def, droppableEvent.instance),
|
|
1854
1858
|
relatedEvents: [],
|
|
1855
1859
|
revert() {
|
|
1856
1860
|
receivingContext.dispatch({
|
|
@@ -1866,7 +1870,7 @@ class ExternalElementDragging {
|
|
|
1866
1870
|
this.receivingContext = null;
|
|
1867
1871
|
this.droppableEvent = null;
|
|
1868
1872
|
};
|
|
1869
|
-
let hitDragging = this.hitDragging = new HitDragging(dragging, interactionSettingsStore);
|
|
1873
|
+
let hitDragging = this.hitDragging = new HitDragging(dragging, internal_cjs.interactionSettingsStore);
|
|
1870
1874
|
hitDragging.requireInitial = false; // will start outside of a component
|
|
1871
1875
|
hitDragging.emitter.on('dragstart', this.handleDragStart);
|
|
1872
1876
|
hitDragging.emitter.on('hitupdate', this.handleHitUpdate);
|
|
@@ -1875,10 +1879,10 @@ class ExternalElementDragging {
|
|
|
1875
1879
|
}
|
|
1876
1880
|
buildDragMeta(subjectEl) {
|
|
1877
1881
|
if (typeof this.suppliedDragMeta === 'object') {
|
|
1878
|
-
return parseDragMeta(this.suppliedDragMeta);
|
|
1882
|
+
return internal_cjs.parseDragMeta(this.suppliedDragMeta);
|
|
1879
1883
|
}
|
|
1880
1884
|
if (typeof this.suppliedDragMeta === 'function') {
|
|
1881
|
-
return parseDragMeta(this.suppliedDragMeta(subjectEl));
|
|
1885
|
+
return internal_cjs.parseDragMeta(this.suppliedDragMeta(subjectEl));
|
|
1882
1886
|
}
|
|
1883
1887
|
return getDragMetaFromEl(subjectEl);
|
|
1884
1888
|
}
|
|
@@ -1902,7 +1906,7 @@ class ExternalElementDragging {
|
|
|
1902
1906
|
return dropAccept.call(receivingContext.calendarApi, el);
|
|
1903
1907
|
}
|
|
1904
1908
|
if (typeof dropAccept === 'string' && dropAccept) {
|
|
1905
|
-
return Boolean(elementMatches(el, dropAccept));
|
|
1909
|
+
return Boolean(internal_cjs.elementMatches(el, dropAccept));
|
|
1906
1910
|
}
|
|
1907
1911
|
return true;
|
|
1908
1912
|
}
|
|
@@ -1914,8 +1918,8 @@ function computeEventForDateSpan(dateSpan, dragMeta, context) {
|
|
|
1914
1918
|
for (let transform of context.pluginHooks.externalDefTransforms) {
|
|
1915
1919
|
Object.assign(defProps, transform(dateSpan, dragMeta));
|
|
1916
1920
|
}
|
|
1917
|
-
let { refined, extra } = refineEventDef(defProps, context);
|
|
1918
|
-
let def = parseEventDef(refined, extra, dragMeta.sourceId, dateSpan.allDay, context.options.forceEventDuration || Boolean(dragMeta.duration), // hasEnd
|
|
1921
|
+
let { refined, extra } = internal_cjs.refineEventDef(defProps, context);
|
|
1922
|
+
let def = internal_cjs.parseEventDef(refined, extra, dragMeta.sourceId, dateSpan.allDay, context.options.forceEventDuration || Boolean(dragMeta.duration), // hasEnd
|
|
1919
1923
|
context);
|
|
1920
1924
|
let start = dateSpan.range.start;
|
|
1921
1925
|
// only rely on time info if drop zone is all-day,
|
|
@@ -1925,8 +1929,8 @@ function computeEventForDateSpan(dateSpan, dragMeta, context) {
|
|
|
1925
1929
|
}
|
|
1926
1930
|
let end = dragMeta.duration ?
|
|
1927
1931
|
context.dateEnv.add(start, dragMeta.duration) :
|
|
1928
|
-
getDefaultEventEnd(dateSpan.allDay, start, context);
|
|
1929
|
-
let instance = createEventInstance(def.defId, { start, end });
|
|
1932
|
+
internal_cjs.getDefaultEventEnd(dateSpan.allDay, start, context);
|
|
1933
|
+
let instance = internal_cjs.createEventInstance(def.defId, { start, end });
|
|
1930
1934
|
return { def, instance };
|
|
1931
1935
|
}
|
|
1932
1936
|
// Utils for extracting data from element
|
|
@@ -1936,11 +1940,11 @@ function getDragMetaFromEl(el) {
|
|
|
1936
1940
|
let obj = str ?
|
|
1937
1941
|
JSON.parse(str) :
|
|
1938
1942
|
{ create: false }; // if no embedded data, assume no event creation
|
|
1939
|
-
return parseDragMeta(obj);
|
|
1943
|
+
return internal_cjs.parseDragMeta(obj);
|
|
1940
1944
|
}
|
|
1941
|
-
config.dataAttrPrefix = '';
|
|
1945
|
+
internal_cjs.config.dataAttrPrefix = '';
|
|
1942
1946
|
function getEmbeddedElData(el, name) {
|
|
1943
|
-
let prefix = config.dataAttrPrefix;
|
|
1947
|
+
let prefix = internal_cjs.config.dataAttrPrefix;
|
|
1944
1948
|
let prefixedName = (prefix ? prefix + '-' : '') + name;
|
|
1945
1949
|
return el.getAttribute('data-' + prefixedName) || '';
|
|
1946
1950
|
}
|
|
@@ -1958,10 +1962,10 @@ class ExternalDraggable {
|
|
|
1958
1962
|
dragging.minDistance =
|
|
1959
1963
|
minDistance != null ?
|
|
1960
1964
|
minDistance :
|
|
1961
|
-
(ev.isTouch ? 0 : BASE_OPTION_DEFAULTS.eventDragMinDistance);
|
|
1965
|
+
(ev.isTouch ? 0 : internal_cjs.BASE_OPTION_DEFAULTS.eventDragMinDistance);
|
|
1962
1966
|
dragging.delay =
|
|
1963
1967
|
ev.isTouch ? // TODO: eventually read eventLongPressDelay instead vvv
|
|
1964
|
-
(longPressDelay != null ? longPressDelay : BASE_OPTION_DEFAULTS.longPressDelay) :
|
|
1968
|
+
(longPressDelay != null ? longPressDelay : internal_cjs.BASE_OPTION_DEFAULTS.longPressDelay) :
|
|
1965
1969
|
0;
|
|
1966
1970
|
};
|
|
1967
1971
|
this.handleDragStart = (ev) => {
|
|
@@ -1995,7 +1999,7 @@ The third-party system is responsible for drawing the visuals effects of the dra
|
|
|
1995
1999
|
This class simply monitors for pointer movements and fires events.
|
|
1996
2000
|
It also has the ability to hide the moving element (the "mirror") during the drag.
|
|
1997
2001
|
*/
|
|
1998
|
-
class InferredElementDragging extends ElementDragging {
|
|
2002
|
+
class InferredElementDragging extends internal_cjs.ElementDragging {
|
|
1999
2003
|
constructor(containerEl) {
|
|
2000
2004
|
super(containerEl);
|
|
2001
2005
|
this.shouldIgnoreMove = false;
|
|
@@ -2087,7 +2091,7 @@ class ThirdPartyDraggable {
|
|
|
2087
2091
|
}
|
|
2088
2092
|
}
|
|
2089
2093
|
|
|
2090
|
-
var index = createPlugin({
|
|
2094
|
+
var index = index_cjs.createPlugin({
|
|
2091
2095
|
name: '@fullcalendar/interaction',
|
|
2092
2096
|
componentInteractions: [DateClicking, DateSelecting, EventDragging, EventResizing],
|
|
2093
2097
|
calendarInteractions: [UnselectAuto],
|
|
@@ -2096,4 +2100,6 @@ var index = createPlugin({
|
|
|
2096
2100
|
listenerRefiners: LISTENER_REFINERS,
|
|
2097
2101
|
});
|
|
2098
2102
|
|
|
2099
|
-
|
|
2103
|
+
exports.Draggable = ExternalDraggable;
|
|
2104
|
+
exports.ThirdPartyDraggable = ThirdPartyDraggable;
|
|
2105
|
+
exports["default"] = index;
|