@fullcalendar/core 7.0.0-beta.0 → 7.0.0-beta.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.cjs +7 -7
- package/index.global.js +228 -146
- package/index.global.min.js +2 -2
- package/index.js +8 -8
- package/internal-common.cjs +147 -65
- package/internal-common.d.ts +50 -27
- package/internal-common.js +144 -61
- package/internal.cjs +4 -5
- package/internal.d.ts +1 -1
- package/internal.js +1 -1
- package/locales/af.global.js +1 -1
- package/locales/af.global.min.js +1 -1
- package/locales/ar-dz.global.js +1 -1
- package/locales/ar-dz.global.min.js +1 -1
- package/locales/ar-kw.global.js +1 -1
- package/locales/ar-kw.global.min.js +1 -1
- package/locales/ar-ly.global.js +1 -1
- package/locales/ar-ly.global.min.js +1 -1
- package/locales/ar-ma.global.js +1 -1
- package/locales/ar-ma.global.min.js +1 -1
- package/locales/ar-sa.global.js +1 -1
- package/locales/ar-sa.global.min.js +1 -1
- package/locales/ar-tn.global.js +1 -1
- package/locales/ar-tn.global.min.js +1 -1
- package/locales/ar.global.js +1 -1
- package/locales/ar.global.min.js +1 -1
- package/locales/az.global.js +1 -1
- package/locales/az.global.min.js +1 -1
- package/locales/bg.global.js +1 -1
- package/locales/bg.global.min.js +1 -1
- package/locales/bn.global.js +1 -1
- package/locales/bn.global.min.js +1 -1
- package/locales/bs.global.js +1 -1
- package/locales/bs.global.min.js +1 -1
- package/locales/ca.global.js +1 -1
- package/locales/ca.global.min.js +1 -1
- package/locales/cs.global.js +1 -1
- package/locales/cs.global.min.js +1 -1
- package/locales/cy.global.js +1 -1
- package/locales/cy.global.min.js +1 -1
- package/locales/da.global.js +1 -1
- package/locales/da.global.min.js +1 -1
- package/locales/de-at.global.js +1 -1
- package/locales/de-at.global.min.js +1 -1
- package/locales/de.global.js +1 -1
- package/locales/de.global.min.js +1 -1
- package/locales/el.global.js +1 -1
- package/locales/el.global.min.js +1 -1
- package/locales/en-au.global.js +1 -1
- package/locales/en-au.global.min.js +1 -1
- package/locales/en-gb.global.js +1 -1
- package/locales/en-gb.global.min.js +1 -1
- package/locales/en-nz.global.js +1 -1
- package/locales/en-nz.global.min.js +1 -1
- package/locales/eo.global.js +1 -1
- package/locales/eo.global.min.js +1 -1
- package/locales/es-us.global.js +1 -1
- package/locales/es-us.global.min.js +1 -1
- package/locales/es.global.js +1 -1
- package/locales/es.global.min.js +1 -1
- package/locales/et.global.js +1 -1
- package/locales/et.global.min.js +1 -1
- package/locales/eu.global.js +1 -1
- package/locales/eu.global.min.js +1 -1
- package/locales/fa.global.js +1 -1
- package/locales/fa.global.min.js +1 -1
- package/locales/fi.global.js +1 -1
- package/locales/fi.global.min.js +1 -1
- package/locales/fr-ca.global.js +1 -1
- package/locales/fr-ca.global.min.js +1 -1
- package/locales/fr-ch.global.js +1 -1
- package/locales/fr-ch.global.min.js +1 -1
- package/locales/fr.global.js +1 -1
- package/locales/fr.global.min.js +1 -1
- package/locales/gl.global.js +1 -1
- package/locales/gl.global.min.js +1 -1
- package/locales/he.global.js +1 -1
- package/locales/he.global.min.js +1 -1
- package/locales/hi.global.js +1 -1
- package/locales/hi.global.min.js +1 -1
- package/locales/hr.global.js +1 -1
- package/locales/hr.global.min.js +1 -1
- package/locales/hu.global.js +1 -1
- package/locales/hu.global.min.js +1 -1
- package/locales/hy-am.global.js +1 -1
- package/locales/hy-am.global.min.js +1 -1
- package/locales/id.global.js +1 -1
- package/locales/id.global.min.js +1 -1
- package/locales/is.global.js +1 -1
- package/locales/is.global.min.js +1 -1
- package/locales/it.global.js +1 -1
- package/locales/it.global.min.js +1 -1
- package/locales/ja.global.js +1 -1
- package/locales/ja.global.min.js +1 -1
- package/locales/ka.global.js +1 -1
- package/locales/ka.global.min.js +1 -1
- package/locales/kk.global.js +1 -1
- package/locales/kk.global.min.js +1 -1
- package/locales/km.global.js +1 -1
- package/locales/km.global.min.js +1 -1
- package/locales/ko.global.js +1 -1
- package/locales/ko.global.min.js +1 -1
- package/locales/ku.global.js +1 -1
- package/locales/ku.global.min.js +1 -1
- package/locales/lb.global.js +1 -1
- package/locales/lb.global.min.js +1 -1
- package/locales/lt.global.js +1 -1
- package/locales/lt.global.min.js +1 -1
- package/locales/lv.global.js +1 -1
- package/locales/lv.global.min.js +1 -1
- package/locales/mk.global.js +1 -1
- package/locales/mk.global.min.js +1 -1
- package/locales/ms.global.js +1 -1
- package/locales/ms.global.min.js +1 -1
- package/locales/nb.global.js +1 -1
- package/locales/nb.global.min.js +1 -1
- package/locales/ne.global.js +1 -1
- package/locales/ne.global.min.js +1 -1
- package/locales/nl.global.js +1 -1
- package/locales/nl.global.min.js +1 -1
- package/locales/nn.global.js +1 -1
- package/locales/nn.global.min.js +1 -1
- package/locales/pl.global.js +1 -1
- package/locales/pl.global.min.js +1 -1
- package/locales/pt-br.global.js +1 -1
- package/locales/pt-br.global.min.js +1 -1
- package/locales/pt.global.js +1 -1
- package/locales/pt.global.min.js +1 -1
- package/locales/ro.global.js +1 -1
- package/locales/ro.global.min.js +1 -1
- package/locales/ru.global.js +1 -1
- package/locales/ru.global.min.js +1 -1
- package/locales/si-lk.global.js +1 -1
- package/locales/si-lk.global.min.js +1 -1
- package/locales/sk.global.js +1 -1
- package/locales/sk.global.min.js +1 -1
- package/locales/sl.global.js +1 -1
- package/locales/sl.global.min.js +1 -1
- package/locales/sm.global.js +1 -1
- package/locales/sm.global.min.js +1 -1
- package/locales/sq.global.js +1 -1
- package/locales/sq.global.min.js +1 -1
- package/locales/sr-cyrl.global.js +1 -1
- package/locales/sr-cyrl.global.min.js +1 -1
- package/locales/sr.global.js +1 -1
- package/locales/sr.global.min.js +1 -1
- package/locales/sv.global.js +1 -1
- package/locales/sv.global.min.js +1 -1
- package/locales/ta-in.global.js +1 -1
- package/locales/ta-in.global.min.js +1 -1
- package/locales/th.global.js +1 -1
- package/locales/th.global.min.js +1 -1
- package/locales/tr.global.js +1 -1
- package/locales/tr.global.min.js +1 -1
- package/locales/ug.global.js +1 -1
- package/locales/ug.global.min.js +1 -1
- package/locales/uk.global.js +1 -1
- package/locales/uk.global.min.js +1 -1
- package/locales/uz-cy.global.js +1 -1
- package/locales/uz-cy.global.min.js +1 -1
- package/locales/uz.global.js +1 -1
- package/locales/uz.global.min.js +1 -1
- package/locales/vi.global.js +1 -1
- package/locales/vi.global.min.js +1 -1
- package/locales/zh-cn.global.js +1 -1
- package/locales/zh-cn.global.min.js +1 -1
- package/locales/zh-tw.global.js +1 -1
- package/locales/zh-tw.global.min.js +1 -1
- package/locales-all.global.js +1 -1
- package/locales-all.global.min.js +1 -1
- package/package.json +1 -1
- package/preact.d.ts +6 -0
package/index.cjs
CHANGED
|
@@ -1708,8 +1708,8 @@ class EventClicking extends internalCommon.Interaction {
|
|
|
1708
1708
|
this.handleSegClick = (ev, segEl) => {
|
|
1709
1709
|
let { component } = this;
|
|
1710
1710
|
let { context } = component;
|
|
1711
|
-
let
|
|
1712
|
-
if (
|
|
1711
|
+
let eventRange = internalCommon.getElEventRange(segEl);
|
|
1712
|
+
if (eventRange && // might be the <div> surrounding the more link
|
|
1713
1713
|
component.isValidSegDownEl(ev.target)) {
|
|
1714
1714
|
// our way to simulate a link click for elements that can't be <a> tags
|
|
1715
1715
|
// grab before trigger fired in case trigger trashes DOM thru rerendering
|
|
@@ -1717,7 +1717,7 @@ class EventClicking extends internalCommon.Interaction {
|
|
|
1717
1717
|
let url = hasUrlContainer ? hasUrlContainer.querySelector('a[href]').href : '';
|
|
1718
1718
|
context.emitter.trigger('eventClick', {
|
|
1719
1719
|
el: segEl,
|
|
1720
|
-
event: new internalCommon.EventImpl(component.context,
|
|
1720
|
+
event: new internalCommon.EventImpl(component.context, eventRange.def, eventRange.instance),
|
|
1721
1721
|
jsEvent: ev,
|
|
1722
1722
|
view: context.viewApi,
|
|
1723
1723
|
});
|
|
@@ -1745,7 +1745,7 @@ class EventHovering extends internalCommon.Interaction {
|
|
|
1745
1745
|
}
|
|
1746
1746
|
};
|
|
1747
1747
|
this.handleSegEnter = (ev, segEl) => {
|
|
1748
|
-
if (internalCommon.
|
|
1748
|
+
if (internalCommon.getElEventRange(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper
|
|
1749
1749
|
this.currentSegEl = segEl;
|
|
1750
1750
|
this.triggerEvent('eventMouseEnter', ev, segEl);
|
|
1751
1751
|
}
|
|
@@ -1765,11 +1765,11 @@ class EventHovering extends internalCommon.Interaction {
|
|
|
1765
1765
|
triggerEvent(publicEvName, ev, segEl) {
|
|
1766
1766
|
let { component } = this;
|
|
1767
1767
|
let { context } = component;
|
|
1768
|
-
let
|
|
1768
|
+
let eventRange = internalCommon.getElEventRange(segEl);
|
|
1769
1769
|
if (!ev || component.isValidSegDownEl(ev.target)) {
|
|
1770
1770
|
context.emitter.trigger(publicEvName, {
|
|
1771
1771
|
el: segEl,
|
|
1772
|
-
event: new internalCommon.EventImpl(context,
|
|
1772
|
+
event: new internalCommon.EventImpl(context, eventRange.def, eventRange.instance),
|
|
1773
1773
|
jsEvent: ev,
|
|
1774
1774
|
view: context.viewApi,
|
|
1775
1775
|
});
|
|
@@ -2077,7 +2077,7 @@ function sliceEvents(props, allDay) {
|
|
|
2077
2077
|
return internalCommon.sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;
|
|
2078
2078
|
}
|
|
2079
2079
|
|
|
2080
|
-
const version = '7.0.0-beta.
|
|
2080
|
+
const version = '7.0.0-beta.1';
|
|
2081
2081
|
|
|
2082
2082
|
exports.JsonRequestError = internalCommon.JsonRequestError;
|
|
2083
2083
|
exports.Calendar = Calendar;
|
package/index.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar Core v7.0.0-beta.
|
|
2
|
+
FullCalendar Core v7.0.0-beta.1
|
|
3
3
|
Docs & License: https://fullcalendar.io
|
|
4
4
|
(c) 2024 Adam Shaw
|
|
5
5
|
*/
|
|
@@ -4192,12 +4192,12 @@ var FullCalendar = (function (exports) {
|
|
|
4192
4192
|
function hasBgRendering(def) {
|
|
4193
4193
|
return def.ui.display === 'background' || def.ui.display === 'inverse-background';
|
|
4194
4194
|
}
|
|
4195
|
-
function
|
|
4196
|
-
el.
|
|
4195
|
+
function setElEventRange(el, eventRange) {
|
|
4196
|
+
el.fcEventRange = eventRange;
|
|
4197
4197
|
}
|
|
4198
|
-
function
|
|
4199
|
-
return el.
|
|
4200
|
-
el.parentNode.
|
|
4198
|
+
function getElEventRange(el) {
|
|
4199
|
+
return el.fcEventRange ||
|
|
4200
|
+
el.parentNode.fcEventRange || // for the harness
|
|
4201
4201
|
null;
|
|
4202
4202
|
}
|
|
4203
4203
|
// event ui computation
|
|
@@ -4217,7 +4217,7 @@ var FullCalendar = (function (exports) {
|
|
|
4217
4217
|
}
|
|
4218
4218
|
function sortEventSegs(segs, eventOrderSpecs) {
|
|
4219
4219
|
let objs = segs.map(buildSegCompareObj);
|
|
4220
|
-
objs.sort((obj0, obj1) => compareByFieldSpecs(obj0, obj1, eventOrderSpecs));
|
|
4220
|
+
objs.sort((obj0, obj1) => compareByFieldSpecs(obj0, obj1, eventOrderSpecs)); // !!!
|
|
4221
4221
|
return objs.map((c) => c._seg);
|
|
4222
4222
|
}
|
|
4223
4223
|
// returns a object with all primitive props that can be compared
|
|
@@ -4230,29 +4230,23 @@ var FullCalendar = (function (exports) {
|
|
|
4230
4230
|
return Object.assign(Object.assign(Object.assign({}, eventDef.extendedProps), eventDef), { id: eventDef.publicId, start,
|
|
4231
4231
|
end, duration: end - start, allDay: Number(eventDef.allDay), _seg: seg });
|
|
4232
4232
|
}
|
|
4233
|
-
function
|
|
4233
|
+
function computeEventRangeDraggable(eventRange, context) {
|
|
4234
4234
|
let { pluginHooks } = context;
|
|
4235
4235
|
let transformers = pluginHooks.isDraggableTransformers;
|
|
4236
|
-
let { def, ui } =
|
|
4236
|
+
let { def, ui } = eventRange;
|
|
4237
4237
|
let val = ui.startEditable;
|
|
4238
4238
|
for (let transformer of transformers) {
|
|
4239
4239
|
val = transformer(val, def, ui, context);
|
|
4240
4240
|
}
|
|
4241
4241
|
return val;
|
|
4242
4242
|
}
|
|
4243
|
-
function
|
|
4244
|
-
return seg.isStart && seg.eventRange.ui.durationEditable && context.options.eventResizableFromStart;
|
|
4245
|
-
}
|
|
4246
|
-
function computeSegEndResizable(seg, context) {
|
|
4247
|
-
return seg.isEnd && seg.eventRange.ui.durationEditable;
|
|
4248
|
-
}
|
|
4249
|
-
function buildSegTimeText(seg, timeFormat, context, defaultDisplayEventTime, // defaults to true
|
|
4243
|
+
function buildEventRangeTimeText(eventRange, timeFormat, context, defaultDisplayEventTime, // defaults to true
|
|
4250
4244
|
defaultDisplayEventEnd, // defaults to true
|
|
4251
4245
|
startOverride, endOverride) {
|
|
4252
4246
|
let { dateEnv, options } = context;
|
|
4253
4247
|
let { displayEventTime, displayEventEnd } = options;
|
|
4254
|
-
let eventDef =
|
|
4255
|
-
let eventInstance =
|
|
4248
|
+
let eventDef = eventRange.def;
|
|
4249
|
+
let eventInstance = eventRange.instance;
|
|
4256
4250
|
if (displayEventTime == null) {
|
|
4257
4251
|
displayEventTime = defaultDisplayEventTime !== false;
|
|
4258
4252
|
}
|
|
@@ -4261,8 +4255,8 @@ var FullCalendar = (function (exports) {
|
|
|
4261
4255
|
}
|
|
4262
4256
|
let wholeEventStart = eventInstance.range.start;
|
|
4263
4257
|
let wholeEventEnd = eventInstance.range.end;
|
|
4264
|
-
let segStart = startOverride ||
|
|
4265
|
-
let segEnd = endOverride ||
|
|
4258
|
+
let segStart = startOverride || eventRange.range.start;
|
|
4259
|
+
let segEnd = endOverride || eventRange.range.end;
|
|
4266
4260
|
let isStartDay = startOfDay(wholeEventStart).valueOf() === startOfDay(segStart).valueOf();
|
|
4267
4261
|
let isEndDay = startOfDay(addMs(wholeEventEnd, -1)).valueOf() === startOfDay(addMs(segEnd, -1)).valueOf();
|
|
4268
4262
|
if (displayEventTime && !eventDef.allDay && (isStartDay || isEndDay)) {
|
|
@@ -4280,8 +4274,8 @@ var FullCalendar = (function (exports) {
|
|
|
4280
4274
|
}
|
|
4281
4275
|
return '';
|
|
4282
4276
|
}
|
|
4283
|
-
function
|
|
4284
|
-
let segRange =
|
|
4277
|
+
function getEventRangeMeta(eventRange, todayRange, nowDate) {
|
|
4278
|
+
let segRange = eventRange.range;
|
|
4285
4279
|
return {
|
|
4286
4280
|
isPast: segRange.end <= (nowDate || todayRange.start),
|
|
4287
4281
|
isFuture: segRange.start >= (nowDate || todayRange.end),
|
|
@@ -4331,8 +4325,8 @@ var FullCalendar = (function (exports) {
|
|
|
4331
4325
|
: `${eventRange.def.defId}:${eventRange.range.start.toISOString()}`;
|
|
4332
4326
|
// inverse-background events don't have specific instances. TODO: better solution
|
|
4333
4327
|
}
|
|
4334
|
-
function
|
|
4335
|
-
let { def, instance } =
|
|
4328
|
+
function getEventRangeAnchorAttrs(eventRange, context) {
|
|
4329
|
+
let { def, instance } = eventRange;
|
|
4336
4330
|
let { url } = def;
|
|
4337
4331
|
if (url) {
|
|
4338
4332
|
return { href: url };
|
|
@@ -5819,6 +5813,172 @@ var FullCalendar = (function (exports) {
|
|
|
5819
5813
|
}
|
|
5820
5814
|
}
|
|
5821
5815
|
|
|
5816
|
+
class DelayedRunner {
|
|
5817
|
+
constructor(drainedOption) {
|
|
5818
|
+
this.drainedOption = drainedOption;
|
|
5819
|
+
this.isRunning = false;
|
|
5820
|
+
this.isDirty = false;
|
|
5821
|
+
this.pauseDepths = {};
|
|
5822
|
+
this.timeoutId = 0;
|
|
5823
|
+
}
|
|
5824
|
+
request(delay) {
|
|
5825
|
+
this.isDirty = true;
|
|
5826
|
+
if (!this.isPaused()) {
|
|
5827
|
+
this.clearTimeout();
|
|
5828
|
+
if (delay == null) {
|
|
5829
|
+
this.tryDrain();
|
|
5830
|
+
}
|
|
5831
|
+
else {
|
|
5832
|
+
this.timeoutId = setTimeout(// NOT OPTIMAL! TODO: look at debounce
|
|
5833
|
+
this.tryDrain.bind(this), delay);
|
|
5834
|
+
}
|
|
5835
|
+
}
|
|
5836
|
+
}
|
|
5837
|
+
pause(scope = '') {
|
|
5838
|
+
let { pauseDepths } = this;
|
|
5839
|
+
pauseDepths[scope] = (pauseDepths[scope] || 0) + 1;
|
|
5840
|
+
this.clearTimeout();
|
|
5841
|
+
}
|
|
5842
|
+
resume(scope = '', force) {
|
|
5843
|
+
let { pauseDepths } = this;
|
|
5844
|
+
if (scope in pauseDepths) {
|
|
5845
|
+
if (force) {
|
|
5846
|
+
delete pauseDepths[scope];
|
|
5847
|
+
}
|
|
5848
|
+
else {
|
|
5849
|
+
pauseDepths[scope] -= 1;
|
|
5850
|
+
let depth = pauseDepths[scope];
|
|
5851
|
+
if (depth <= 0) {
|
|
5852
|
+
delete pauseDepths[scope];
|
|
5853
|
+
}
|
|
5854
|
+
}
|
|
5855
|
+
this.tryDrain();
|
|
5856
|
+
}
|
|
5857
|
+
}
|
|
5858
|
+
isPaused() {
|
|
5859
|
+
return Object.keys(this.pauseDepths).length;
|
|
5860
|
+
}
|
|
5861
|
+
tryDrain() {
|
|
5862
|
+
if (!this.isRunning && !this.isPaused()) {
|
|
5863
|
+
this.isRunning = true;
|
|
5864
|
+
while (this.isDirty) {
|
|
5865
|
+
this.isDirty = false;
|
|
5866
|
+
this.drained(); // might set isDirty to true again
|
|
5867
|
+
}
|
|
5868
|
+
this.isRunning = false;
|
|
5869
|
+
}
|
|
5870
|
+
}
|
|
5871
|
+
clear() {
|
|
5872
|
+
this.clearTimeout();
|
|
5873
|
+
this.isDirty = false;
|
|
5874
|
+
this.pauseDepths = {};
|
|
5875
|
+
}
|
|
5876
|
+
clearTimeout() {
|
|
5877
|
+
if (this.timeoutId) {
|
|
5878
|
+
clearTimeout(this.timeoutId);
|
|
5879
|
+
this.timeoutId = 0;
|
|
5880
|
+
}
|
|
5881
|
+
}
|
|
5882
|
+
drained() {
|
|
5883
|
+
if (this.drainedOption) {
|
|
5884
|
+
this.drainedOption();
|
|
5885
|
+
}
|
|
5886
|
+
}
|
|
5887
|
+
}
|
|
5888
|
+
|
|
5889
|
+
const WHEEL_EVENT_NAMES = 'wheel mousewheel DomMouseScroll MozMousePixelScroll'.split(' ');
|
|
5890
|
+
/*
|
|
5891
|
+
Fires:
|
|
5892
|
+
- scrollStart (always user)
|
|
5893
|
+
- scroll
|
|
5894
|
+
- scrollEnd (always user)
|
|
5895
|
+
|
|
5896
|
+
NOTE: detection is complicated (w/ touch and wheel) because ScrollerSyncer needs to know about it,
|
|
5897
|
+
but are we sure we can't just ignore programmatic scrollTo() calls with a flag? and determine the
|
|
5898
|
+
the scroll-master simply by who was the newest scroller? Does passive:true do things asynchronously?
|
|
5899
|
+
*/
|
|
5900
|
+
class ScrollListener {
|
|
5901
|
+
constructor(el) {
|
|
5902
|
+
this.el = el;
|
|
5903
|
+
this.emitter = new Emitter();
|
|
5904
|
+
this.isScrolling = false;
|
|
5905
|
+
this.isTouching = false; // user currently has finger down?
|
|
5906
|
+
this.isRecentlyWheeled = false;
|
|
5907
|
+
this.isRecentlyScrolled = false;
|
|
5908
|
+
this.wheelWaiter = new DelayedRunner(this._handleWheelWaited.bind(this));
|
|
5909
|
+
this.scrollWaiter = new DelayedRunner(this._handleScrollWaited.bind(this));
|
|
5910
|
+
// Handlers
|
|
5911
|
+
// ----------------------------------------------------------------------------------------------
|
|
5912
|
+
this.handleScroll = () => {
|
|
5913
|
+
this.startScroll();
|
|
5914
|
+
this.emitter.trigger('scroll', this.isRecentlyWheeled, this.isTouching);
|
|
5915
|
+
this.isRecentlyScrolled = true;
|
|
5916
|
+
this.scrollWaiter.request(500);
|
|
5917
|
+
};
|
|
5918
|
+
// will fire *before* the scroll event is fired (might not cause a scroll)
|
|
5919
|
+
this.handleWheel = () => {
|
|
5920
|
+
this.isRecentlyWheeled = true;
|
|
5921
|
+
this.wheelWaiter.request(500);
|
|
5922
|
+
};
|
|
5923
|
+
// will fire *before* the scroll event is fired (might not cause a scroll)
|
|
5924
|
+
this.handleTouchStart = () => {
|
|
5925
|
+
this.isTouching = true;
|
|
5926
|
+
};
|
|
5927
|
+
this.handleTouchEnd = () => {
|
|
5928
|
+
this.isTouching = false;
|
|
5929
|
+
// if the user ended their touch, and the scroll area wasn't moving,
|
|
5930
|
+
// we consider this to be the end of the scroll.
|
|
5931
|
+
if (!this.isRecentlyScrolled) {
|
|
5932
|
+
this.endScroll(); // won't fire if already ended
|
|
5933
|
+
}
|
|
5934
|
+
};
|
|
5935
|
+
el.addEventListener('scroll', this.handleScroll);
|
|
5936
|
+
el.addEventListener('touchstart', this.handleTouchStart, { passive: true });
|
|
5937
|
+
el.addEventListener('touchend', this.handleTouchEnd);
|
|
5938
|
+
for (let eventName of WHEEL_EVENT_NAMES) {
|
|
5939
|
+
el.addEventListener(eventName, this.handleWheel, { passive: true });
|
|
5940
|
+
}
|
|
5941
|
+
}
|
|
5942
|
+
destroy() {
|
|
5943
|
+
let { el } = this;
|
|
5944
|
+
el.removeEventListener('scroll', this.handleScroll);
|
|
5945
|
+
el.removeEventListener('touchstart', this.handleTouchStart, { passive: true });
|
|
5946
|
+
el.removeEventListener('touchend', this.handleTouchEnd);
|
|
5947
|
+
for (let eventName of WHEEL_EVENT_NAMES) {
|
|
5948
|
+
el.removeEventListener(eventName, this.handleWheel, { passive: true });
|
|
5949
|
+
}
|
|
5950
|
+
}
|
|
5951
|
+
// Start / Stop
|
|
5952
|
+
// ----------------------------------------------------------------------------------------------
|
|
5953
|
+
startScroll() {
|
|
5954
|
+
if (!this.isScrolling) {
|
|
5955
|
+
this.isScrolling = true;
|
|
5956
|
+
this.emitter.trigger('scrollStart', this.isRecentlyWheeled, this.isTouching);
|
|
5957
|
+
}
|
|
5958
|
+
}
|
|
5959
|
+
endScroll() {
|
|
5960
|
+
if (this.isScrolling) {
|
|
5961
|
+
this.emitter.trigger('scrollEnd');
|
|
5962
|
+
this.isScrolling = false;
|
|
5963
|
+
this.isRecentlyScrolled = true;
|
|
5964
|
+
this.isRecentlyWheeled = false;
|
|
5965
|
+
this.scrollWaiter.clear();
|
|
5966
|
+
this.wheelWaiter.clear();
|
|
5967
|
+
}
|
|
5968
|
+
}
|
|
5969
|
+
_handleScrollWaited() {
|
|
5970
|
+
this.isRecentlyScrolled = false;
|
|
5971
|
+
// only end the scroll if not currently touching.
|
|
5972
|
+
// if touching, the scrolling will end later, on touchend.
|
|
5973
|
+
if (!this.isTouching) {
|
|
5974
|
+
this.endScroll(); // won't fire if already ended
|
|
5975
|
+
}
|
|
5976
|
+
}
|
|
5977
|
+
_handleWheelWaited() {
|
|
5978
|
+
this.isRecentlyWheeled = false;
|
|
5979
|
+
}
|
|
5980
|
+
}
|
|
5981
|
+
|
|
5822
5982
|
class Scroller extends DateComponent {
|
|
5823
5983
|
constructor() {
|
|
5824
5984
|
super(...arguments);
|
|
@@ -5838,6 +5998,7 @@ var FullCalendar = (function (exports) {
|
|
|
5838
5998
|
}
|
|
5839
5999
|
componentDidMount() {
|
|
5840
6000
|
const el = this.elRef.current; // TODO: make dynamic with useEffect
|
|
6001
|
+
this.listener = new ScrollListener(el);
|
|
5841
6002
|
this.disconnectSize = watchSize(el, (contentWidth, contentHeight) => {
|
|
5842
6003
|
const { props, context } = this;
|
|
5843
6004
|
const bottomScrollbarWidth = el.offsetHeight - el.clientHeight;
|
|
@@ -5868,13 +6029,20 @@ var FullCalendar = (function (exports) {
|
|
|
5868
6029
|
});
|
|
5869
6030
|
}
|
|
5870
6031
|
componentWillUnmount() {
|
|
6032
|
+
const { props } = this;
|
|
5871
6033
|
this.disconnectSize();
|
|
6034
|
+
this.listener.destroy();
|
|
6035
|
+
setRef(props.widthRef, null);
|
|
6036
|
+
setRef(props.heightRef, null);
|
|
6037
|
+
setRef(props.bottomScrollbarWidthRef, null);
|
|
6038
|
+
setRef(props.rightScrollbarWidthRef, null);
|
|
6039
|
+
setRef(props.leftScrollbarWidthRef, null);
|
|
6040
|
+
}
|
|
6041
|
+
endScroll() {
|
|
6042
|
+
this.listener.endScroll();
|
|
5872
6043
|
}
|
|
5873
6044
|
// Public API
|
|
5874
6045
|
// -----------------------------------------------------------------------------------------------
|
|
5875
|
-
get el() {
|
|
5876
|
-
return this.elRef.current;
|
|
5877
|
-
}
|
|
5878
6046
|
get x() {
|
|
5879
6047
|
const { isRtl } = this.context;
|
|
5880
6048
|
const el = this.elRef.current;
|
|
@@ -5894,6 +6062,12 @@ var FullCalendar = (function (exports) {
|
|
|
5894
6062
|
setNormalizedScrollX(el, isRtl, x);
|
|
5895
6063
|
}
|
|
5896
6064
|
}
|
|
6065
|
+
addScrollEndListener(handler) {
|
|
6066
|
+
this.listener.emitter.on('scrollEnd', handler);
|
|
6067
|
+
}
|
|
6068
|
+
removeScrollEndListener(handler) {
|
|
6069
|
+
this.listener.emitter.off('scrollEnd', handler);
|
|
6070
|
+
}
|
|
5897
6071
|
}
|
|
5898
6072
|
// Public API
|
|
5899
6073
|
// -------------------------------------------------------------------------------------------------
|
|
@@ -6436,79 +6610,6 @@ var FullCalendar = (function (exports) {
|
|
|
6436
6610
|
});
|
|
6437
6611
|
}
|
|
6438
6612
|
|
|
6439
|
-
class DelayedRunner {
|
|
6440
|
-
constructor(drainedOption) {
|
|
6441
|
-
this.drainedOption = drainedOption;
|
|
6442
|
-
this.isRunning = false;
|
|
6443
|
-
this.isDirty = false;
|
|
6444
|
-
this.pauseDepths = {};
|
|
6445
|
-
this.timeoutId = 0;
|
|
6446
|
-
}
|
|
6447
|
-
request(delay) {
|
|
6448
|
-
this.isDirty = true;
|
|
6449
|
-
if (!this.isPaused()) {
|
|
6450
|
-
this.clearTimeout();
|
|
6451
|
-
if (delay == null) {
|
|
6452
|
-
this.tryDrain();
|
|
6453
|
-
}
|
|
6454
|
-
else {
|
|
6455
|
-
this.timeoutId = setTimeout(// NOT OPTIMAL! TODO: look at debounce
|
|
6456
|
-
this.tryDrain.bind(this), delay);
|
|
6457
|
-
}
|
|
6458
|
-
}
|
|
6459
|
-
}
|
|
6460
|
-
pause(scope = '') {
|
|
6461
|
-
let { pauseDepths } = this;
|
|
6462
|
-
pauseDepths[scope] = (pauseDepths[scope] || 0) + 1;
|
|
6463
|
-
this.clearTimeout();
|
|
6464
|
-
}
|
|
6465
|
-
resume(scope = '', force) {
|
|
6466
|
-
let { pauseDepths } = this;
|
|
6467
|
-
if (scope in pauseDepths) {
|
|
6468
|
-
if (force) {
|
|
6469
|
-
delete pauseDepths[scope];
|
|
6470
|
-
}
|
|
6471
|
-
else {
|
|
6472
|
-
pauseDepths[scope] -= 1;
|
|
6473
|
-
let depth = pauseDepths[scope];
|
|
6474
|
-
if (depth <= 0) {
|
|
6475
|
-
delete pauseDepths[scope];
|
|
6476
|
-
}
|
|
6477
|
-
}
|
|
6478
|
-
this.tryDrain();
|
|
6479
|
-
}
|
|
6480
|
-
}
|
|
6481
|
-
isPaused() {
|
|
6482
|
-
return Object.keys(this.pauseDepths).length;
|
|
6483
|
-
}
|
|
6484
|
-
tryDrain() {
|
|
6485
|
-
if (!this.isRunning && !this.isPaused()) {
|
|
6486
|
-
this.isRunning = true;
|
|
6487
|
-
while (this.isDirty) {
|
|
6488
|
-
this.isDirty = false;
|
|
6489
|
-
this.drained(); // might set isDirty to true again
|
|
6490
|
-
}
|
|
6491
|
-
this.isRunning = false;
|
|
6492
|
-
}
|
|
6493
|
-
}
|
|
6494
|
-
clear() {
|
|
6495
|
-
this.clearTimeout();
|
|
6496
|
-
this.isDirty = false;
|
|
6497
|
-
this.pauseDepths = {};
|
|
6498
|
-
}
|
|
6499
|
-
clearTimeout() {
|
|
6500
|
-
if (this.timeoutId) {
|
|
6501
|
-
clearTimeout(this.timeoutId);
|
|
6502
|
-
this.timeoutId = 0;
|
|
6503
|
-
}
|
|
6504
|
-
}
|
|
6505
|
-
drained() {
|
|
6506
|
-
if (this.drainedOption) {
|
|
6507
|
-
this.drainedOption();
|
|
6508
|
-
}
|
|
6509
|
-
}
|
|
6510
|
-
}
|
|
6511
|
-
|
|
6512
6613
|
function getIsHeightAuto(options) {
|
|
6513
6614
|
return options.height === 'auto' || options.viewHeight === 'auto';
|
|
6514
6615
|
}
|
|
@@ -6629,38 +6730,20 @@ var FullCalendar = (function (exports) {
|
|
|
6629
6730
|
return { start, end };
|
|
6630
6731
|
}
|
|
6631
6732
|
|
|
6632
|
-
class ScrollResponder {
|
|
6633
|
-
constructor(_handleScroll) {
|
|
6634
|
-
this._handleScroll = _handleScroll;
|
|
6635
|
-
this.handleScroll = (scroll) => {
|
|
6636
|
-
this.queuedScroll = scroll;
|
|
6637
|
-
this.drain();
|
|
6638
|
-
};
|
|
6639
|
-
}
|
|
6640
|
-
drain() {
|
|
6641
|
-
if (this.queuedScroll) {
|
|
6642
|
-
if (this._handleScroll(this.queuedScroll)) {
|
|
6643
|
-
this.queuedScroll = undefined;
|
|
6644
|
-
}
|
|
6645
|
-
}
|
|
6646
|
-
}
|
|
6647
|
-
}
|
|
6648
|
-
|
|
6649
6733
|
class EventContainer extends BaseComponent {
|
|
6650
6734
|
constructor() {
|
|
6651
6735
|
super(...arguments);
|
|
6652
6736
|
this.handleEl = (el) => {
|
|
6653
6737
|
this.el = el;
|
|
6654
6738
|
if (el) {
|
|
6655
|
-
|
|
6739
|
+
setElEventRange(el, this.props.eventRange);
|
|
6656
6740
|
}
|
|
6657
6741
|
};
|
|
6658
6742
|
}
|
|
6659
6743
|
render() {
|
|
6660
6744
|
const { props, context } = this;
|
|
6661
6745
|
const { options } = context;
|
|
6662
|
-
const {
|
|
6663
|
-
const { eventRange } = seg;
|
|
6746
|
+
const { eventRange } = props;
|
|
6664
6747
|
const { ui } = eventRange;
|
|
6665
6748
|
const renderProps = {
|
|
6666
6749
|
event: new EventImpl(context, eventRange.def, eventRange.instance),
|
|
@@ -6669,12 +6752,12 @@ var FullCalendar = (function (exports) {
|
|
|
6669
6752
|
textColor: ui.textColor,
|
|
6670
6753
|
backgroundColor: ui.backgroundColor,
|
|
6671
6754
|
borderColor: ui.borderColor,
|
|
6672
|
-
isDraggable: !props.disableDragging &&
|
|
6673
|
-
isStartResizable: !props.disableResizing &&
|
|
6674
|
-
isEndResizable: !props.disableResizing &&
|
|
6755
|
+
isDraggable: !props.disableDragging && computeEventRangeDraggable(eventRange, context),
|
|
6756
|
+
isStartResizable: !props.disableResizing && props.isStart && eventRange.ui.durationEditable && options.eventResizableFromStart,
|
|
6757
|
+
isEndResizable: !props.disableResizing && props.isEnd && eventRange.ui.durationEditable,
|
|
6675
6758
|
isMirror: Boolean(props.isDragging || props.isResizing || props.isDateSelecting),
|
|
6676
|
-
isStart: Boolean(
|
|
6677
|
-
isEnd: Boolean(
|
|
6759
|
+
isStart: Boolean(props.isStart),
|
|
6760
|
+
isEnd: Boolean(props.isEnd),
|
|
6678
6761
|
isPast: Boolean(props.isPast),
|
|
6679
6762
|
isFuture: Boolean(props.isFuture),
|
|
6680
6763
|
isToday: Boolean(props.isToday),
|
|
@@ -6684,13 +6767,13 @@ var FullCalendar = (function (exports) {
|
|
|
6684
6767
|
};
|
|
6685
6768
|
return (_(ContentContainer, Object.assign({}, props /* contains children */, { elRef: this.handleEl, elClasses: [
|
|
6686
6769
|
...getEventClassNames(renderProps),
|
|
6687
|
-
...
|
|
6770
|
+
...eventRange.ui.classNames,
|
|
6688
6771
|
...(props.elClasses || []),
|
|
6689
6772
|
], renderProps: renderProps, generatorName: "eventContent", customGenerator: options.eventContent, defaultGenerator: props.defaultGenerator, classNameGenerator: options.eventClassNames, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount })));
|
|
6690
6773
|
}
|
|
6691
6774
|
componentDidUpdate(prevProps) {
|
|
6692
|
-
if (this.el && this.props.
|
|
6693
|
-
|
|
6775
|
+
if (this.el && this.props.eventRange !== prevProps.eventRange) {
|
|
6776
|
+
setElEventRange(this.el, this.props.eventRange);
|
|
6694
6777
|
}
|
|
6695
6778
|
}
|
|
6696
6779
|
}
|
|
@@ -6700,14 +6783,14 @@ var FullCalendar = (function (exports) {
|
|
|
6700
6783
|
render() {
|
|
6701
6784
|
let { props, context } = this;
|
|
6702
6785
|
let { options } = context;
|
|
6703
|
-
let {
|
|
6704
|
-
let { ui } =
|
|
6786
|
+
let { eventRange } = props;
|
|
6787
|
+
let { ui } = eventRange;
|
|
6705
6788
|
let timeFormat = options.eventTimeFormat || props.defaultTimeFormat;
|
|
6706
|
-
let timeText =
|
|
6789
|
+
let timeText = buildEventRangeTimeText(eventRange, timeFormat, context, props.defaultDisplayEventTime, props.defaultDisplayEventEnd, props.startOverride, props.endOverride);
|
|
6707
6790
|
return (_(EventContainer, Object.assign({}, props /* includes elRef */, { elTag: "a", elStyle: {
|
|
6708
6791
|
borderColor: ui.borderColor,
|
|
6709
6792
|
backgroundColor: ui.backgroundColor,
|
|
6710
|
-
}, elAttrs:
|
|
6793
|
+
}, elAttrs: getEventRangeAnchorAttrs(eventRange, context), defaultGenerator: renderInnerContent$1, timeText: timeText }), (InnerContent, eventContentArg) => (_(k$1, null,
|
|
6711
6794
|
_(InnerContent, { elTag: "div", elClasses: ['fc-event-inner'], elStyle: { color: eventContentArg.textColor } }),
|
|
6712
6795
|
Boolean(eventContentArg.isStartResizable) && (_("div", { className: "fc-event-resizer fc-event-resizer-start" })),
|
|
6713
6796
|
Boolean(eventContentArg.isEndResizable) && (_("div", { className: "fc-event-resizer fc-event-resizer-end" }))))));
|
|
@@ -6733,8 +6816,8 @@ var FullCalendar = (function (exports) {
|
|
|
6733
6816
|
class BgEvent extends BaseComponent {
|
|
6734
6817
|
render() {
|
|
6735
6818
|
let { props } = this;
|
|
6736
|
-
let {
|
|
6737
|
-
return (_(EventContainer, { elTag: "div", elClasses: ['fc-bg-event'], elStyle: { backgroundColor:
|
|
6819
|
+
let { eventRange } = props;
|
|
6820
|
+
return (_(EventContainer, { elTag: "div", elClasses: ['fc-bg-event'], elStyle: { backgroundColor: eventRange.ui.backgroundColor }, defaultGenerator: renderInnerContent, eventRange: eventRange, isStart: props.isStart, isEnd: props.isEnd, timeText: "", isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, disableDragging: true, disableResizing: true }));
|
|
6738
6821
|
}
|
|
6739
6822
|
}
|
|
6740
6823
|
function renderInnerContent(props) {
|
|
@@ -7396,12 +7479,12 @@ var FullCalendar = (function (exports) {
|
|
|
7396
7479
|
DaySeriesModel: DaySeriesModel,
|
|
7397
7480
|
sliceEventStore: sliceEventStore,
|
|
7398
7481
|
hasBgRendering: hasBgRendering,
|
|
7399
|
-
|
|
7400
|
-
|
|
7482
|
+
getElEventRange: getElEventRange,
|
|
7483
|
+
buildEventRangeTimeText: buildEventRangeTimeText,
|
|
7401
7484
|
sortEventSegs: sortEventSegs,
|
|
7402
|
-
|
|
7485
|
+
getEventRangeMeta: getEventRangeMeta,
|
|
7403
7486
|
buildEventRangeKey: buildEventRangeKey,
|
|
7404
|
-
|
|
7487
|
+
getEventRangeAnchorAttrs: getEventRangeAnchorAttrs,
|
|
7405
7488
|
DayTableModel: DayTableModel,
|
|
7406
7489
|
Scroller: Scroller,
|
|
7407
7490
|
getNormalizedScrollX: getNormalizedScrollX,
|
|
@@ -7423,7 +7506,6 @@ var FullCalendar = (function (exports) {
|
|
|
7423
7506
|
RefMap: RefMap,
|
|
7424
7507
|
getIsRtlScrollbarOnLeft: getIsRtlScrollbarOnLeft,
|
|
7425
7508
|
NowTimer: NowTimer,
|
|
7426
|
-
ScrollResponder: ScrollResponder,
|
|
7427
7509
|
StandardEvent: StandardEvent,
|
|
7428
7510
|
NowIndicatorContainer: NowIndicatorContainer,
|
|
7429
7511
|
DayCellContainer: DayCellContainer,
|
|
@@ -9148,8 +9230,8 @@ var FullCalendar = (function (exports) {
|
|
|
9148
9230
|
this.handleSegClick = (ev, segEl) => {
|
|
9149
9231
|
let { component } = this;
|
|
9150
9232
|
let { context } = component;
|
|
9151
|
-
let
|
|
9152
|
-
if (
|
|
9233
|
+
let eventRange = getElEventRange(segEl);
|
|
9234
|
+
if (eventRange && // might be the <div> surrounding the more link
|
|
9153
9235
|
component.isValidSegDownEl(ev.target)) {
|
|
9154
9236
|
// our way to simulate a link click for elements that can't be <a> tags
|
|
9155
9237
|
// grab before trigger fired in case trigger trashes DOM thru rerendering
|
|
@@ -9157,7 +9239,7 @@ var FullCalendar = (function (exports) {
|
|
|
9157
9239
|
let url = hasUrlContainer ? hasUrlContainer.querySelector('a[href]').href : '';
|
|
9158
9240
|
context.emitter.trigger('eventClick', {
|
|
9159
9241
|
el: segEl,
|
|
9160
|
-
event: new EventImpl(component.context,
|
|
9242
|
+
event: new EventImpl(component.context, eventRange.def, eventRange.instance),
|
|
9161
9243
|
jsEvent: ev,
|
|
9162
9244
|
view: context.viewApi,
|
|
9163
9245
|
});
|
|
@@ -9185,7 +9267,7 @@ var FullCalendar = (function (exports) {
|
|
|
9185
9267
|
}
|
|
9186
9268
|
};
|
|
9187
9269
|
this.handleSegEnter = (ev, segEl) => {
|
|
9188
|
-
if (
|
|
9270
|
+
if (getElEventRange(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper
|
|
9189
9271
|
this.currentSegEl = segEl;
|
|
9190
9272
|
this.triggerEvent('eventMouseEnter', ev, segEl);
|
|
9191
9273
|
}
|
|
@@ -9205,11 +9287,11 @@ var FullCalendar = (function (exports) {
|
|
|
9205
9287
|
triggerEvent(publicEvName, ev, segEl) {
|
|
9206
9288
|
let { component } = this;
|
|
9207
9289
|
let { context } = component;
|
|
9208
|
-
let
|
|
9290
|
+
let eventRange = getElEventRange(segEl);
|
|
9209
9291
|
if (!ev || component.isValidSegDownEl(ev.target)) {
|
|
9210
9292
|
context.emitter.trigger(publicEvName, {
|
|
9211
9293
|
el: segEl,
|
|
9212
|
-
event: new EventImpl(context,
|
|
9294
|
+
event: new EventImpl(context, eventRange.def, eventRange.instance),
|
|
9213
9295
|
jsEvent: ev,
|
|
9214
9296
|
view: context.viewApi,
|
|
9215
9297
|
});
|
|
@@ -9517,7 +9599,7 @@ var FullCalendar = (function (exports) {
|
|
|
9517
9599
|
return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;
|
|
9518
9600
|
}
|
|
9519
9601
|
|
|
9520
|
-
const version = '7.0.0-beta.
|
|
9602
|
+
const version = '7.0.0-beta.1';
|
|
9521
9603
|
|
|
9522
9604
|
exports.Calendar = Calendar;
|
|
9523
9605
|
exports.Internal = internal;
|