@fullcalendar/interaction 7.0.0-beta.4 → 7.0.0-beta.6
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/LICENSE.md +1 -1
- package/README.md +7 -1
- package/{index.cjs → cjs/index.cjs} +157 -148
- package/{index.d.ts → esm/index.d.ts} +38 -32
- package/{index.js → esm/index.js} +47 -42
- package/{index.global.js → global.js} +52 -44
- package/global.min.js +6 -0
- package/package.json +17 -14
- package/index.global.min.js +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatePointApi, ViewApi, EventApi,
|
|
2
|
-
import { Emitter, PointerDragEvent, Rect, ScrollController, ElementDragging, Identity, DragMetaInput } from '@fullcalendar/core/internal';
|
|
1
|
+
import { DatePointApi, ViewApi, EventApi, EventChangeData, Duration, EventDropData, PluginDef } from '@fullcalendar/core';
|
|
2
|
+
import { Emitter, PointerDragEvent, Rect, ScrollController, ElementDragging, RawOptionsFromRefiners, RefinedOptionsFromRefiners, Identity, DragMetaInput } from '@fullcalendar/core/internal';
|
|
3
3
|
|
|
4
4
|
declare class PointerDragging {
|
|
5
5
|
containerEl: EventTarget;
|
|
@@ -147,30 +147,30 @@ declare class FeaturefulElementDragging extends ElementDragging {
|
|
|
147
147
|
setAutoScrollEnabled(bool: boolean): void;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
interface
|
|
150
|
+
interface DateClickData extends DatePointApi {
|
|
151
151
|
dayEl: HTMLElement;
|
|
152
152
|
jsEvent: MouseEvent;
|
|
153
153
|
view: ViewApi;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
type
|
|
157
|
-
type
|
|
158
|
-
interface
|
|
156
|
+
type EventDragStopData = EventDragData;
|
|
157
|
+
type EventDragStartData = EventDragData;
|
|
158
|
+
interface EventDragData {
|
|
159
159
|
el: HTMLElement;
|
|
160
160
|
event: EventApi;
|
|
161
161
|
jsEvent: MouseEvent;
|
|
162
162
|
view: ViewApi;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
type
|
|
166
|
-
type
|
|
167
|
-
interface
|
|
165
|
+
type EventResizeStartData = EventResizeStartStopData;
|
|
166
|
+
type EventResizeStopData = EventResizeStartStopData;
|
|
167
|
+
interface EventResizeStartStopData {
|
|
168
168
|
el: HTMLElement;
|
|
169
169
|
event: EventApi;
|
|
170
170
|
jsEvent: MouseEvent;
|
|
171
171
|
view: ViewApi;
|
|
172
172
|
}
|
|
173
|
-
interface
|
|
173
|
+
interface EventResizeDoneData extends EventChangeData {
|
|
174
174
|
el: HTMLElement;
|
|
175
175
|
startDelta: Duration;
|
|
176
176
|
endDelta: Duration;
|
|
@@ -178,14 +178,14 @@ interface EventResizeDoneArg extends EventChangeArg {
|
|
|
178
178
|
view: ViewApi;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
interface
|
|
181
|
+
interface DropData extends DatePointApi {
|
|
182
182
|
draggedEl: HTMLElement;
|
|
183
183
|
jsEvent: MouseEvent;
|
|
184
184
|
view: ViewApi;
|
|
185
185
|
}
|
|
186
|
-
type
|
|
187
|
-
type
|
|
188
|
-
interface
|
|
186
|
+
type EventReceiveData = EventReceiveLeaveData;
|
|
187
|
+
type EventLeaveData = EventReceiveLeaveData;
|
|
188
|
+
interface EventReceiveLeaveData {
|
|
189
189
|
draggedEl: HTMLElement;
|
|
190
190
|
event: EventApi;
|
|
191
191
|
relatedEvents: EventApi[];
|
|
@@ -193,28 +193,34 @@ interface EventReceiveLeaveArg {
|
|
|
193
193
|
view: ViewApi;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
declare const OPTION_REFINERS: {
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
declare const OPTION_REFINERS: {};
|
|
197
|
+
type InteractionOptionRefiners = typeof OPTION_REFINERS;
|
|
198
|
+
type InteractionOptions = RawOptionsFromRefiners<InteractionOptionRefiners>;
|
|
199
|
+
type InteractionOptionsRefined = RefinedOptionsFromRefiners<InteractionOptionRefiners>;
|
|
199
200
|
declare const LISTENER_REFINERS: {
|
|
200
|
-
dateClick: Identity<(
|
|
201
|
-
eventDragStart: Identity<(
|
|
202
|
-
eventDragStop: Identity<(
|
|
203
|
-
eventDrop: Identity<(
|
|
204
|
-
eventResizeStart: Identity<(
|
|
205
|
-
eventResizeStop: Identity<(
|
|
206
|
-
eventResize: Identity<(
|
|
207
|
-
drop: Identity<(
|
|
208
|
-
eventReceive: Identity<(
|
|
209
|
-
eventLeave: Identity<(
|
|
201
|
+
dateClick: Identity<(data: DateClickData) => void>;
|
|
202
|
+
eventDragStart: Identity<(data: EventDragStartData) => void>;
|
|
203
|
+
eventDragStop: Identity<(data: EventDragStopData) => void>;
|
|
204
|
+
eventDrop: Identity<(data: EventDropData) => void>;
|
|
205
|
+
eventResizeStart: Identity<(data: EventResizeStartData) => void>;
|
|
206
|
+
eventResizeStop: Identity<(data: EventResizeStopData) => void>;
|
|
207
|
+
eventResize: Identity<(data: EventResizeDoneData) => void>;
|
|
208
|
+
drop: Identity<(data: DropData) => void>;
|
|
209
|
+
eventReceive: Identity<(data: EventReceiveData) => void>;
|
|
210
|
+
eventLeave: Identity<(data: EventLeaveData) => void>;
|
|
210
211
|
};
|
|
212
|
+
type InteractionListenerRefiners = typeof LISTENER_REFINERS;
|
|
213
|
+
type InteractionListeners = RawOptionsFromRefiners<InteractionListenerRefiners>;
|
|
214
|
+
type InteractionListenersRefined = RefinedOptionsFromRefiners<InteractionListenerRefiners>;
|
|
211
215
|
|
|
212
|
-
type ExtraOptionRefiners = typeof OPTION_REFINERS;
|
|
213
|
-
type ExtraListenerRefiners = typeof LISTENER_REFINERS;
|
|
214
216
|
declare module '@fullcalendar/core/internal' {
|
|
215
|
-
interface
|
|
217
|
+
interface BaseOptions extends InteractionOptions {
|
|
218
|
+
}
|
|
219
|
+
interface BaseOptionsRefined extends InteractionOptionsRefined {
|
|
220
|
+
}
|
|
221
|
+
interface CalendarListeners extends InteractionListeners {
|
|
216
222
|
}
|
|
217
|
-
interface
|
|
223
|
+
interface CalendarListenersRefined extends InteractionListenersRefined {
|
|
218
224
|
}
|
|
219
225
|
}
|
|
220
226
|
//# sourceMappingURL=ambient.d.ts.map
|
|
@@ -265,4 +271,4 @@ declare class ThirdPartyDraggable {
|
|
|
265
271
|
declare const _default: PluginDef;
|
|
266
272
|
//# sourceMappingURL=index.d.ts.map
|
|
267
273
|
|
|
268
|
-
export {
|
|
274
|
+
export { DateClickData, ExternalDraggable as Draggable, DropData, EventDragStartData, EventDragStopData, EventLeaveData, EventReceiveData, EventResizeDoneData, EventResizeStartData, EventResizeStopData, InteractionListeners, InteractionOptions, ThirdPartyDraggable, _default as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createPlugin } from '@fullcalendar/core
|
|
2
|
-
import { config, Emitter, applyStyle, whenTransitionDone, 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, getElEventRange, getRelevantEvents, EventImpl, createEmptyEventStore, applyMutationToEventStore, isInteractionValid, buildEventApis, interactionSettingsStore, startOfDay, diffDates, createDuration, getEventTargetViaRoot, identity, eventTupleToStore, parseDragMeta, refineEventDef, parseEventDef, getDefaultEventEnd, createEventInstance, BASE_OPTION_DEFAULTS } from '@fullcalendar/core/internal
|
|
1
|
+
import { createPlugin } from '@fullcalendar/core';
|
|
2
|
+
import { config, Emitter, applyStyle, whenTransitionDone, ScrollController, ElementScrollController, computeInnerRect, WindowScrollController, ElementDragging, preventSelection, preventContextMenu, allowSelection, allowContextMenu, computeRect, computeElIsRtl, getClippingParents, pointInsideRect, constrainPoint, intersectRects, getRectCenter, diffPoints, mapHash, rangeContainsRange, isDateSpansEqual, Interaction, interactionSettingsToStore, isDateSelectionValid, enableCursor, disableCursor, triggerDateSelect, compareNumbers, getElEventRange, getRelevantEvents, getAppendableRoot, EventImpl, createEmptyEventStore, applyMutationToEventStore, isInteractionValid, buildEventApis, interactionSettingsStore, startOfDay, diffDates, createDuration, getEventTargetViaRoot, identity, eventTupleToStore, parseDragMeta, refineEventDef, parseEventDef, getDefaultEventEnd, createEventInstance, BASE_OPTION_DEFAULTS } from '@fullcalendar/core/internal';
|
|
3
|
+
import classNames from '@fullcalendar/core/internal-classnames';
|
|
3
4
|
|
|
4
5
|
config.touchMouseIgnoreWait = 500;
|
|
5
6
|
let ignoreMouseDepth = 0;
|
|
@@ -314,7 +315,9 @@ class ElementMirror {
|
|
|
314
315
|
if (bool) {
|
|
315
316
|
if (!this.isVisible) {
|
|
316
317
|
if (this.mirrorEl) {
|
|
317
|
-
|
|
318
|
+
// important because competes with util.module.css classNames, which are all important
|
|
319
|
+
// TODO: attach a util className here instead?
|
|
320
|
+
this.mirrorEl.style.setProperty('display', '', 'important');
|
|
318
321
|
}
|
|
319
322
|
this.isVisible = bool; // needs to happen before updateElPosition
|
|
320
323
|
this.updateElPosition(); // because was not updating the position while invisible
|
|
@@ -322,7 +325,9 @@ class ElementMirror {
|
|
|
322
325
|
}
|
|
323
326
|
else if (this.isVisible) {
|
|
324
327
|
if (this.mirrorEl) {
|
|
325
|
-
|
|
328
|
+
// important because competes with util.module.css classNames, which are all important
|
|
329
|
+
// TODO: attach a util className here instead?
|
|
330
|
+
this.mirrorEl.style.setProperty('display', 'none', 'important');
|
|
326
331
|
}
|
|
327
332
|
this.isVisible = bool;
|
|
328
333
|
}
|
|
@@ -382,10 +387,10 @@ class ElementMirror {
|
|
|
382
387
|
mirrorEl = this.mirrorEl = this.sourceEl.cloneNode(true); // cloneChildren=true
|
|
383
388
|
// we don't want long taps or any mouse interaction causing selection/menus.
|
|
384
389
|
// would use preventSelection(), but that prevents selectstart, causing problems.
|
|
390
|
+
// TODO: make className for this?
|
|
385
391
|
mirrorEl.style.userSelect = 'none';
|
|
386
392
|
mirrorEl.style.webkitUserSelect = 'none';
|
|
387
393
|
mirrorEl.style.pointerEvents = 'none';
|
|
388
|
-
mirrorEl.classList.add('fc-event-dragging');
|
|
389
394
|
applyStyle(mirrorEl, {
|
|
390
395
|
position: 'fixed',
|
|
391
396
|
zIndex: this.zIndex,
|
|
@@ -525,7 +530,7 @@ class AutoScroller {
|
|
|
525
530
|
constructor() {
|
|
526
531
|
// options that can be set by caller
|
|
527
532
|
this.isEnabled = true;
|
|
528
|
-
this.scrollQuery = [window,
|
|
533
|
+
this.scrollQuery = [window, `.${classNames.internalScroller}`];
|
|
529
534
|
this.edgeThreshold = 50; // pixels
|
|
530
535
|
this.maxVelocity = 300; // pixels per second
|
|
531
536
|
// internal state
|
|
@@ -863,6 +868,7 @@ class OffsetTracker {
|
|
|
863
868
|
constructor(el) {
|
|
864
869
|
this.el = el;
|
|
865
870
|
this.origRect = computeRect(el);
|
|
871
|
+
this.isRtl = computeElIsRtl(el);
|
|
866
872
|
// will work fine for divs that have overflow:hidden
|
|
867
873
|
this.scrollCaches = getClippingParents(el).map((scrollEl) => new ElementScrollGeomCache(scrollEl, true));
|
|
868
874
|
}
|
|
@@ -1033,7 +1039,7 @@ class HitDragging {
|
|
|
1033
1039
|
// must be within the element's bounds
|
|
1034
1040
|
positionLeft >= 0 && positionLeft < width &&
|
|
1035
1041
|
positionTop >= 0 && positionTop < height) {
|
|
1036
|
-
let hit = component.queryHit(positionLeft, positionTop, width, height);
|
|
1042
|
+
let hit = component.queryHit(offsetTracker.isRtl, positionLeft, positionTop, width, height);
|
|
1037
1043
|
if (hit && (
|
|
1038
1044
|
// make sure the hit is within activeRange, meaning it's not a dead cell
|
|
1039
1045
|
rangeContainsRange(hit.dateProfile.activeRange, hit.dateSpan.range)) &&
|
|
@@ -1096,6 +1102,9 @@ class DateClicking extends Interaction {
|
|
|
1096
1102
|
this.handlePointerDown = (pev) => {
|
|
1097
1103
|
let { dragging } = this;
|
|
1098
1104
|
let downEl = pev.origEvent.target;
|
|
1105
|
+
/*
|
|
1106
|
+
If no dateClick, allow text on dates to be text-selectable
|
|
1107
|
+
*/
|
|
1099
1108
|
const canDateClick = this.component.context.emitter.hasHandlers('dateClick') &&
|
|
1100
1109
|
this.component.isValidDateDownEl(downEl);
|
|
1101
1110
|
if (!canDateClick) {
|
|
@@ -1110,8 +1119,8 @@ class DateClicking extends Interaction {
|
|
|
1110
1119
|
let { initialHit, finalHit } = this.hitDragging;
|
|
1111
1120
|
if (initialHit && finalHit && isHitsEqual(initialHit, finalHit)) {
|
|
1112
1121
|
let { context } = component;
|
|
1113
|
-
let
|
|
1114
|
-
context.emitter.trigger('dateClick',
|
|
1122
|
+
let data = Object.assign(Object.assign({}, buildDatePointApiWithContext(initialHit.dateSpan, context)), { dayEl: initialHit.getDayEl(), jsEvent: ev.origEvent, view: context.viewApi || context.calendarApi.view });
|
|
1123
|
+
context.emitter.trigger('dateClick', data);
|
|
1115
1124
|
}
|
|
1116
1125
|
}
|
|
1117
1126
|
};
|
|
@@ -1267,15 +1276,10 @@ class EventDragging extends Interaction {
|
|
|
1267
1276
|
(ev.isTouch && eventInstanceId !== component.props.eventSelection) ?
|
|
1268
1277
|
getComponentTouchDelay(component) :
|
|
1269
1278
|
null;
|
|
1270
|
-
|
|
1271
|
-
mirror.parentNode = options.fixedMirrorParent;
|
|
1272
|
-
}
|
|
1273
|
-
else {
|
|
1274
|
-
mirror.parentNode = origTarget.closest('.fc');
|
|
1275
|
-
}
|
|
1279
|
+
mirror.parentNode = getAppendableRoot(origTarget);
|
|
1276
1280
|
mirror.revertDuration = options.dragRevertDuration;
|
|
1277
1281
|
let isValid = component.isValidSegDownEl(origTarget) &&
|
|
1278
|
-
!origTarget.closest(
|
|
1282
|
+
!origTarget.closest(`.${classNames.internalEventResizer}`); // NOT on a resizer
|
|
1279
1283
|
if (!isValid) {
|
|
1280
1284
|
dragging.cancel();
|
|
1281
1285
|
}
|
|
@@ -1283,7 +1287,8 @@ class EventDragging extends Interaction {
|
|
|
1283
1287
|
// disable dragging for elements that are resizable (ie, selectable)
|
|
1284
1288
|
// but are not draggable
|
|
1285
1289
|
// TODO: merge this with .cancel() ?
|
|
1286
|
-
this.isDragging = ev.subjectEl
|
|
1290
|
+
this.isDragging = ev.subjectEl
|
|
1291
|
+
.classList.contains(classNames.internalEventDraggable);
|
|
1287
1292
|
}
|
|
1288
1293
|
};
|
|
1289
1294
|
this.handleDragStart = (ev) => {
|
|
@@ -1363,7 +1368,7 @@ class EventDragging extends Interaction {
|
|
|
1363
1368
|
this.dragging.setMirrorNeedsRevert(!mutation);
|
|
1364
1369
|
// render the mirror if no already-rendered mirror
|
|
1365
1370
|
// TODO: wish we could somehow wait for dispatch to guarantee render
|
|
1366
|
-
this.dragging.setMirrorIsVisible(!hit || !this.subjectEl.getRootNode().querySelector(
|
|
1371
|
+
this.dragging.setMirrorIsVisible(!hit || !this.subjectEl.getRootNode().querySelector(`.${classNames.internalEventMirror}`));
|
|
1367
1372
|
// assign states based on new hit
|
|
1368
1373
|
this.receivingContext = receivingContext;
|
|
1369
1374
|
this.validMutation = mutation;
|
|
@@ -1401,7 +1406,7 @@ class EventDragging extends Interaction {
|
|
|
1401
1406
|
type: 'MERGE_EVENTS',
|
|
1402
1407
|
eventStore: mutatedRelevantEvents,
|
|
1403
1408
|
});
|
|
1404
|
-
let
|
|
1409
|
+
let eventChangeData = {
|
|
1405
1410
|
oldEvent: eventApi,
|
|
1406
1411
|
event: updatedEventApi,
|
|
1407
1412
|
relatedEvents: buildEventApis(mutatedRelevantEvents, initialContext, eventInstance),
|
|
@@ -1416,12 +1421,12 @@ class EventDragging extends Interaction {
|
|
|
1416
1421
|
for (let transformer of initialContext.getCurrentData().pluginHooks.eventDropTransformers) {
|
|
1417
1422
|
Object.assign(transformed, transformer(validMutation, initialContext));
|
|
1418
1423
|
}
|
|
1419
|
-
initialContext.emitter.trigger('eventDrop', Object.assign(Object.assign(Object.assign({},
|
|
1420
|
-
initialContext.emitter.trigger('eventChange',
|
|
1424
|
+
initialContext.emitter.trigger('eventDrop', Object.assign(Object.assign(Object.assign({}, eventChangeData), transformed), { el: ev.subjectEl, delta: validMutation.datesDelta, jsEvent: ev.origEvent, view: initialView }));
|
|
1425
|
+
initialContext.emitter.trigger('eventChange', eventChangeData);
|
|
1421
1426
|
// dropped in different calendar
|
|
1422
1427
|
}
|
|
1423
1428
|
else if (receivingContext) {
|
|
1424
|
-
let
|
|
1429
|
+
let eventRemoveData = {
|
|
1425
1430
|
event: eventApi,
|
|
1426
1431
|
relatedEvents: buildEventApis(relevantEvents, initialContext, eventInstance),
|
|
1427
1432
|
revert() {
|
|
@@ -1431,12 +1436,12 @@ class EventDragging extends Interaction {
|
|
|
1431
1436
|
});
|
|
1432
1437
|
},
|
|
1433
1438
|
};
|
|
1434
|
-
initialContext.emitter.trigger('eventLeave', Object.assign(Object.assign({},
|
|
1439
|
+
initialContext.emitter.trigger('eventLeave', Object.assign(Object.assign({}, eventRemoveData), { draggedEl: ev.subjectEl, view: initialView }));
|
|
1435
1440
|
initialContext.dispatch({
|
|
1436
1441
|
type: 'REMOVE_EVENTS',
|
|
1437
1442
|
eventStore: relevantEvents,
|
|
1438
1443
|
});
|
|
1439
|
-
initialContext.emitter.trigger('eventRemove',
|
|
1444
|
+
initialContext.emitter.trigger('eventRemove', eventRemoveData);
|
|
1440
1445
|
let addedEventDef = mutatedRelevantEvents.defs[eventDef.defId];
|
|
1441
1446
|
let addedEventInstance = mutatedRelevantEvents.instances[eventInstance.instanceId];
|
|
1442
1447
|
let addedEventApi = new EventImpl(receivingContext, addedEventDef, addedEventInstance);
|
|
@@ -1444,7 +1449,7 @@ class EventDragging extends Interaction {
|
|
|
1444
1449
|
type: 'MERGE_EVENTS',
|
|
1445
1450
|
eventStore: mutatedRelevantEvents,
|
|
1446
1451
|
});
|
|
1447
|
-
let
|
|
1452
|
+
let eventAddData = {
|
|
1448
1453
|
event: addedEventApi,
|
|
1449
1454
|
relatedEvents: buildEventApis(mutatedRelevantEvents, receivingContext, addedEventInstance),
|
|
1450
1455
|
revert() {
|
|
@@ -1454,7 +1459,7 @@ class EventDragging extends Interaction {
|
|
|
1454
1459
|
});
|
|
1455
1460
|
},
|
|
1456
1461
|
};
|
|
1457
|
-
receivingContext.emitter.trigger('eventAdd',
|
|
1462
|
+
receivingContext.emitter.trigger('eventAdd', eventAddData);
|
|
1458
1463
|
if (ev.isTouch) {
|
|
1459
1464
|
receivingContext.dispatch({
|
|
1460
1465
|
type: 'SELECT_EVENT',
|
|
@@ -1462,7 +1467,7 @@ class EventDragging extends Interaction {
|
|
|
1462
1467
|
});
|
|
1463
1468
|
}
|
|
1464
1469
|
receivingContext.emitter.trigger('drop', Object.assign(Object.assign({}, buildDatePointApiWithContext(finalHit.dateSpan, receivingContext)), { draggedEl: ev.subjectEl, jsEvent: ev.origEvent, view: finalHit.context.viewApi }));
|
|
1465
|
-
receivingContext.emitter.trigger('eventReceive', Object.assign(Object.assign({},
|
|
1470
|
+
receivingContext.emitter.trigger('eventReceive', Object.assign(Object.assign({}, eventAddData), { draggedEl: ev.subjectEl, view: finalHit.context.viewApi }));
|
|
1466
1471
|
}
|
|
1467
1472
|
}
|
|
1468
1473
|
else {
|
|
@@ -1537,7 +1542,7 @@ class EventDragging extends Interaction {
|
|
|
1537
1542
|
}
|
|
1538
1543
|
// TODO: test this in IE11
|
|
1539
1544
|
// QUESTION: why do we need it on the resizable???
|
|
1540
|
-
EventDragging.SELECTOR =
|
|
1545
|
+
EventDragging.SELECTOR = `.${classNames.internalEventDraggable}, .${classNames.internalEventResizable}`;
|
|
1541
1546
|
function computeEventMutation(hit0, hit1, eventInstanceStart, massagers) {
|
|
1542
1547
|
let dateSpan0 = hit0.dateSpan;
|
|
1543
1548
|
let dateSpan1 = hit1.dateSpan;
|
|
@@ -1636,7 +1641,7 @@ class EventResizing extends Interaction {
|
|
|
1636
1641
|
&& this.isHitComboAllowed
|
|
1637
1642
|
&& !this.isHitComboAllowed(initialHit, hit);
|
|
1638
1643
|
if (!disallowed) {
|
|
1639
|
-
mutation = computeMutation(initialHit, hit, ev.subjectEl.classList.contains(
|
|
1644
|
+
mutation = computeMutation(initialHit, hit, ev.subjectEl.classList.contains(classNames.internalEventResizerStart), eventInstance.range);
|
|
1640
1645
|
}
|
|
1641
1646
|
}
|
|
1642
1647
|
if (mutation) {
|
|
@@ -1691,7 +1696,7 @@ class EventResizing extends Interaction {
|
|
|
1691
1696
|
type: 'MERGE_EVENTS',
|
|
1692
1697
|
eventStore: mutatedRelevantEvents,
|
|
1693
1698
|
});
|
|
1694
|
-
let
|
|
1699
|
+
let eventChangeData = {
|
|
1695
1700
|
oldEvent: eventApi,
|
|
1696
1701
|
event: updatedEventApi,
|
|
1697
1702
|
relatedEvents: buildEventApis(mutatedRelevantEvents, context, eventInstance),
|
|
@@ -1702,8 +1707,8 @@ class EventResizing extends Interaction {
|
|
|
1702
1707
|
});
|
|
1703
1708
|
},
|
|
1704
1709
|
};
|
|
1705
|
-
context.emitter.trigger('eventResize', Object.assign(Object.assign({},
|
|
1706
|
-
context.emitter.trigger('eventChange',
|
|
1710
|
+
context.emitter.trigger('eventResize', Object.assign(Object.assign({}, eventChangeData), { el: this.draggingSegEl, startDelta: this.validMutation.startDelta || createDuration(0), endDelta: this.validMutation.endDelta || createDuration(0), jsEvent: ev.origEvent, view: context.viewApi }));
|
|
1711
|
+
context.emitter.trigger('eventChange', eventChangeData);
|
|
1707
1712
|
}
|
|
1708
1713
|
else {
|
|
1709
1714
|
context.emitter.trigger('_noEventResize');
|
|
@@ -1716,7 +1721,7 @@ class EventResizing extends Interaction {
|
|
|
1716
1721
|
};
|
|
1717
1722
|
let { component } = settings;
|
|
1718
1723
|
let dragging = this.dragging = new FeaturefulElementDragging(settings.el);
|
|
1719
|
-
dragging.pointer.selector =
|
|
1724
|
+
dragging.pointer.selector = `.${classNames.internalEventResizer}`;
|
|
1720
1725
|
dragging.touchScrollAllowed = false;
|
|
1721
1726
|
dragging.autoScroller.isEnabled = component.context.options.dragScroll;
|
|
1722
1727
|
let hitDragging = this.hitDragging = new HitDragging(this.dragging, interactionSettingsToStore(settings));
|
|
@@ -1729,7 +1734,7 @@ class EventResizing extends Interaction {
|
|
|
1729
1734
|
this.dragging.destroy();
|
|
1730
1735
|
}
|
|
1731
1736
|
querySegEl(ev) {
|
|
1732
|
-
return ev.subjectEl.closest(
|
|
1737
|
+
return ev.subjectEl.closest(`.${classNames.internalEvent}`);
|
|
1733
1738
|
}
|
|
1734
1739
|
}
|
|
1735
1740
|
function computeMutation(hit0, hit1, isFromStart, instanceRange) {
|
|
@@ -1754,8 +1759,8 @@ class UnselectAuto {
|
|
|
1754
1759
|
this.isRecentPointerDateSelect = false; // wish we could use a selector to detect date selection, but uses hit system
|
|
1755
1760
|
this.matchesCancel = false;
|
|
1756
1761
|
this.matchesEvent = false;
|
|
1757
|
-
this.onSelect = (
|
|
1758
|
-
if (
|
|
1762
|
+
this.onSelect = (selectData) => {
|
|
1763
|
+
if (selectData.jsEvent) {
|
|
1759
1764
|
this.isRecentPointerDateSelect = true;
|
|
1760
1765
|
}
|
|
1761
1766
|
};
|
|
@@ -1803,9 +1808,7 @@ class UnselectAuto {
|
|
|
1803
1808
|
}
|
|
1804
1809
|
}
|
|
1805
1810
|
|
|
1806
|
-
const OPTION_REFINERS = {
|
|
1807
|
-
fixedMirrorParent: identity,
|
|
1808
|
-
};
|
|
1811
|
+
const OPTION_REFINERS = {};
|
|
1809
1812
|
const LISTENER_REFINERS = {
|
|
1810
1813
|
dateClick: identity,
|
|
1811
1814
|
eventDragStart: identity,
|
|
@@ -1858,7 +1861,9 @@ class ExternalElementDragging {
|
|
|
1858
1861
|
this.displayDrag(receivingContext, interaction);
|
|
1859
1862
|
// show mirror if no already-rendered mirror element OR if we are shutting down the mirror (?)
|
|
1860
1863
|
// TODO: wish we could somehow wait for dispatch to guarantee render
|
|
1861
|
-
dragging.setMirrorIsVisible(isFinal ||
|
|
1864
|
+
dragging.setMirrorIsVisible(isFinal ||
|
|
1865
|
+
!droppableEvent ||
|
|
1866
|
+
!document.querySelector(`.${classNames.internalEventMirror}`));
|
|
1862
1867
|
if (!isInvalid) {
|
|
1863
1868
|
enableCursor();
|
|
1864
1869
|
}
|
|
@@ -2010,8 +2015,8 @@ class ExternalDraggable {
|
|
|
2010
2015
|
this.handleDragStart = (ev) => {
|
|
2011
2016
|
if (ev.isTouch &&
|
|
2012
2017
|
this.dragging.delay &&
|
|
2013
|
-
ev.subjectEl.classList.contains(
|
|
2014
|
-
this.dragging.mirror.getMirrorEl().classList.add(
|
|
2018
|
+
ev.subjectEl.classList.contains(classNames.internalEvent)) {
|
|
2019
|
+
this.dragging.mirror.getMirrorEl().classList.add(classNames.internalEventSelected);
|
|
2015
2020
|
}
|
|
2016
2021
|
};
|
|
2017
2022
|
this.settings = settings;
|