fullcalendar 6.0.0 → 6.0.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.global.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Standard Bundle v6.0.0
2
+ FullCalendar Standard Bundle v6.0.1
3
3
  Docs & License: https://fullcalendar.io/docs/initialize-globals
4
4
  (c) 2022 Adam Shaw
5
5
  */
@@ -251,8 +251,6 @@ var FullCalendar = (function (exports) {
251
251
  return res;
252
252
  }
253
253
 
254
- const globalLocales = [];
255
-
256
254
  // TODO: new util arrayify?
257
255
  function removeExact(array, exactVal) {
258
256
  let removeCnt = 0;
@@ -689,165 +687,6 @@ var FullCalendar = (function (exports) {
689
687
  contentWidthEl.getBoundingClientRect().width;
690
688
  }
691
689
 
692
- // TODO: easier way to add new hooks? need to update a million things
693
- function createPlugin(input) {
694
- return {
695
- id: guid(),
696
- name: input.name,
697
- premiumReleaseDate: input.premiumReleaseDate ? new Date(input.premiumReleaseDate) : undefined,
698
- deps: input.deps || [],
699
- reducers: input.reducers || [],
700
- isLoadingFuncs: input.isLoadingFuncs || [],
701
- contextInit: [].concat(input.contextInit || []),
702
- eventRefiners: input.eventRefiners || {},
703
- eventDefMemberAdders: input.eventDefMemberAdders || [],
704
- eventSourceRefiners: input.eventSourceRefiners || {},
705
- isDraggableTransformers: input.isDraggableTransformers || [],
706
- eventDragMutationMassagers: input.eventDragMutationMassagers || [],
707
- eventDefMutationAppliers: input.eventDefMutationAppliers || [],
708
- dateSelectionTransformers: input.dateSelectionTransformers || [],
709
- datePointTransforms: input.datePointTransforms || [],
710
- dateSpanTransforms: input.dateSpanTransforms || [],
711
- views: input.views || {},
712
- viewPropsTransformers: input.viewPropsTransformers || [],
713
- isPropsValid: input.isPropsValid || null,
714
- externalDefTransforms: input.externalDefTransforms || [],
715
- viewContainerAppends: input.viewContainerAppends || [],
716
- eventDropTransformers: input.eventDropTransformers || [],
717
- componentInteractions: input.componentInteractions || [],
718
- calendarInteractions: input.calendarInteractions || [],
719
- themeClasses: input.themeClasses || {},
720
- eventSourceDefs: input.eventSourceDefs || [],
721
- cmdFormatter: input.cmdFormatter,
722
- recurringTypes: input.recurringTypes || [],
723
- namedTimeZonedImpl: input.namedTimeZonedImpl,
724
- initialView: input.initialView || '',
725
- elementDraggingImpl: input.elementDraggingImpl,
726
- optionChangeHandlers: input.optionChangeHandlers || {},
727
- scrollGridImpl: input.scrollGridImpl || null,
728
- listenerRefiners: input.listenerRefiners || {},
729
- optionRefiners: input.optionRefiners || {},
730
- propSetHandlers: input.propSetHandlers || {},
731
- };
732
- }
733
- function buildPluginHooks(pluginDefs, globalDefs) {
734
- let currentPluginIds = {};
735
- let hooks = {
736
- premiumReleaseDate: undefined,
737
- reducers: [],
738
- isLoadingFuncs: [],
739
- contextInit: [],
740
- eventRefiners: {},
741
- eventDefMemberAdders: [],
742
- eventSourceRefiners: {},
743
- isDraggableTransformers: [],
744
- eventDragMutationMassagers: [],
745
- eventDefMutationAppliers: [],
746
- dateSelectionTransformers: [],
747
- datePointTransforms: [],
748
- dateSpanTransforms: [],
749
- views: {},
750
- viewPropsTransformers: [],
751
- isPropsValid: null,
752
- externalDefTransforms: [],
753
- viewContainerAppends: [],
754
- eventDropTransformers: [],
755
- componentInteractions: [],
756
- calendarInteractions: [],
757
- themeClasses: {},
758
- eventSourceDefs: [],
759
- cmdFormatter: null,
760
- recurringTypes: [],
761
- namedTimeZonedImpl: null,
762
- initialView: '',
763
- elementDraggingImpl: null,
764
- optionChangeHandlers: {},
765
- scrollGridImpl: null,
766
- listenerRefiners: {},
767
- optionRefiners: {},
768
- propSetHandlers: {},
769
- };
770
- function addDefs(defs) {
771
- for (let def of defs) {
772
- const pluginName = def.name;
773
- const currentId = currentPluginIds[pluginName];
774
- if (currentId === undefined) {
775
- currentPluginIds[pluginName] = def.id;
776
- addDefs(def.deps);
777
- hooks = combineHooks(hooks, def);
778
- }
779
- else if (currentId !== def.id) {
780
- // different ID than the one already added
781
- console.warn(`Duplicate plugin '${pluginName}'`);
782
- }
783
- }
784
- }
785
- if (pluginDefs) {
786
- addDefs(pluginDefs);
787
- }
788
- addDefs(globalDefs);
789
- return hooks;
790
- }
791
- function buildBuildPluginHooks() {
792
- let currentOverrideDefs = [];
793
- let currentGlobalDefs = [];
794
- let currentHooks;
795
- return (overrideDefs, globalDefs) => {
796
- if (!currentHooks || !isArraysEqual(overrideDefs, currentOverrideDefs) || !isArraysEqual(globalDefs, currentGlobalDefs)) {
797
- currentHooks = buildPluginHooks(overrideDefs, globalDefs);
798
- }
799
- currentOverrideDefs = overrideDefs;
800
- currentGlobalDefs = globalDefs;
801
- return currentHooks;
802
- };
803
- }
804
- function combineHooks(hooks0, hooks1) {
805
- return {
806
- premiumReleaseDate: compareOptionalDates(hooks0.premiumReleaseDate, hooks1.premiumReleaseDate),
807
- reducers: hooks0.reducers.concat(hooks1.reducers),
808
- isLoadingFuncs: hooks0.isLoadingFuncs.concat(hooks1.isLoadingFuncs),
809
- contextInit: hooks0.contextInit.concat(hooks1.contextInit),
810
- eventRefiners: Object.assign(Object.assign({}, hooks0.eventRefiners), hooks1.eventRefiners),
811
- eventDefMemberAdders: hooks0.eventDefMemberAdders.concat(hooks1.eventDefMemberAdders),
812
- eventSourceRefiners: Object.assign(Object.assign({}, hooks0.eventSourceRefiners), hooks1.eventSourceRefiners),
813
- isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers),
814
- eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers),
815
- eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers),
816
- dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers),
817
- datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms),
818
- dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms),
819
- views: Object.assign(Object.assign({}, hooks0.views), hooks1.views),
820
- viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers),
821
- isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid,
822
- externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms),
823
- viewContainerAppends: hooks0.viewContainerAppends.concat(hooks1.viewContainerAppends),
824
- eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),
825
- calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),
826
- componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),
827
- themeClasses: Object.assign(Object.assign({}, hooks0.themeClasses), hooks1.themeClasses),
828
- eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs),
829
- cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter,
830
- recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes),
831
- namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl,
832
- initialView: hooks0.initialView || hooks1.initialView,
833
- elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl,
834
- optionChangeHandlers: Object.assign(Object.assign({}, hooks0.optionChangeHandlers), hooks1.optionChangeHandlers),
835
- scrollGridImpl: hooks1.scrollGridImpl || hooks0.scrollGridImpl,
836
- listenerRefiners: Object.assign(Object.assign({}, hooks0.listenerRefiners), hooks1.listenerRefiners),
837
- optionRefiners: Object.assign(Object.assign({}, hooks0.optionRefiners), hooks1.optionRefiners),
838
- propSetHandlers: Object.assign(Object.assign({}, hooks0.propSetHandlers), hooks1.propSetHandlers),
839
- };
840
- }
841
- function compareOptionalDates(date0, date1) {
842
- if (date0 === undefined) {
843
- return date1;
844
- }
845
- if (date1 === undefined) {
846
- return date0;
847
- }
848
- return new Date(Math.max(date0.valueOf(), date1.valueOf()));
849
- }
850
-
851
690
  const DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
852
691
  // Adding
853
692
  function addWeeks(m, n) {
@@ -3547,229 +3386,65 @@ var FullCalendar = (function (exports) {
3547
3386
  return null;
3548
3387
  }
3549
3388
 
3550
- function initEventSources(calendarOptions, dateProfile, context) {
3551
- let activeRange = dateProfile ? dateProfile.activeRange : null;
3552
- return addSources({}, parseInitialSources(calendarOptions, context), activeRange, context);
3553
- }
3554
- function reduceEventSources(eventSources, action, dateProfile, context) {
3555
- let activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?
3389
+ function reduceEventStore(eventStore, action, eventSources, dateProfile, context) {
3556
3390
  switch (action.type) {
3557
- case 'ADD_EVENT_SOURCES': // already parsed
3558
- return addSources(eventSources, action.sources, activeRange, context);
3559
- case 'REMOVE_EVENT_SOURCE':
3560
- return removeSource(eventSources, action.sourceId);
3391
+ case 'RECEIVE_EVENTS': // raw
3392
+ return receiveRawEvents(eventStore, eventSources[action.sourceId], action.fetchId, action.fetchRange, action.rawEvents, context);
3393
+ case 'ADD_EVENTS': // already parsed, but not expanded
3394
+ return addEvent(eventStore, action.eventStore, // new ones
3395
+ dateProfile ? dateProfile.activeRange : null, context);
3396
+ case 'RESET_EVENTS':
3397
+ return action.eventStore;
3398
+ case 'MERGE_EVENTS': // already parsed and expanded
3399
+ return mergeEventStores(eventStore, action.eventStore);
3561
3400
  case 'PREV': // TODO: how do we track all actions that affect dateProfile :(
3562
3401
  case 'NEXT':
3563
3402
  case 'CHANGE_DATE':
3564
3403
  case 'CHANGE_VIEW_TYPE':
3565
3404
  if (dateProfile) {
3566
- return fetchDirtySources(eventSources, activeRange, context);
3405
+ return expandRecurring(eventStore, dateProfile.activeRange, context);
3567
3406
  }
3568
- return eventSources;
3569
- case 'FETCH_EVENT_SOURCES':
3570
- return fetchSourcesByIds(eventSources, action.sourceIds ? // why no type?
3571
- arrayToHash(action.sourceIds) :
3572
- excludeStaticSources(eventSources, context), activeRange, action.isRefetch || false, context);
3573
- case 'RECEIVE_EVENTS':
3574
- case 'RECEIVE_EVENT_ERROR':
3575
- return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange);
3407
+ return eventStore;
3408
+ case 'REMOVE_EVENTS':
3409
+ return excludeSubEventStore(eventStore, action.eventStore);
3410
+ case 'REMOVE_EVENT_SOURCE':
3411
+ return excludeEventsBySourceId(eventStore, action.sourceId);
3576
3412
  case 'REMOVE_ALL_EVENT_SOURCES':
3577
- return {};
3413
+ return filterEventStoreDefs(eventStore, (eventDef) => (!eventDef.sourceId // only keep events with no source id
3414
+ ));
3415
+ case 'REMOVE_ALL_EVENTS':
3416
+ return createEmptyEventStore();
3578
3417
  default:
3579
- return eventSources;
3418
+ return eventStore;
3580
3419
  }
3581
3420
  }
3582
- function reduceEventSourcesNewTimeZone(eventSources, dateProfile, context) {
3583
- let activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?
3584
- return fetchSourcesByIds(eventSources, excludeStaticSources(eventSources, context), activeRange, true, context);
3585
- }
3586
- function computeEventSourcesLoading(eventSources) {
3587
- for (let sourceId in eventSources) {
3588
- if (eventSources[sourceId].isFetching) {
3589
- return true;
3421
+ function receiveRawEvents(eventStore, eventSource, fetchId, fetchRange, rawEvents, context) {
3422
+ if (eventSource && // not already removed
3423
+ fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources
3424
+ ) {
3425
+ let subset = parseEvents(transformRawEvents(rawEvents, eventSource, context), eventSource, context);
3426
+ if (fetchRange) {
3427
+ subset = expandRecurring(subset, fetchRange, context);
3590
3428
  }
3429
+ return mergeEventStores(excludeEventsBySourceId(eventStore, eventSource.sourceId), subset);
3591
3430
  }
3592
- return false;
3431
+ return eventStore;
3593
3432
  }
3594
- function addSources(eventSourceHash, sources, fetchRange, context) {
3595
- let hash = {};
3596
- for (let source of sources) {
3597
- hash[source.sourceId] = source;
3433
+ function transformRawEvents(rawEvents, eventSource, context) {
3434
+ let calEachTransform = context.options.eventDataTransform;
3435
+ let sourceEachTransform = eventSource ? eventSource.eventDataTransform : null;
3436
+ if (sourceEachTransform) {
3437
+ rawEvents = transformEachRawEvent(rawEvents, sourceEachTransform);
3598
3438
  }
3599
- if (fetchRange) {
3600
- hash = fetchDirtySources(hash, fetchRange, context);
3439
+ if (calEachTransform) {
3440
+ rawEvents = transformEachRawEvent(rawEvents, calEachTransform);
3601
3441
  }
3602
- return Object.assign(Object.assign({}, eventSourceHash), hash);
3603
- }
3604
- function removeSource(eventSourceHash, sourceId) {
3605
- return filterHash(eventSourceHash, (eventSource) => eventSource.sourceId !== sourceId);
3606
- }
3607
- function fetchDirtySources(sourceHash, fetchRange, context) {
3608
- return fetchSourcesByIds(sourceHash, filterHash(sourceHash, (eventSource) => isSourceDirty(eventSource, fetchRange, context)), fetchRange, false, context);
3442
+ return rawEvents;
3609
3443
  }
3610
- function isSourceDirty(eventSource, fetchRange, context) {
3611
- if (!doesSourceNeedRange(eventSource, context)) {
3612
- return !eventSource.latestFetchId;
3613
- }
3614
- return !context.options.lazyFetching ||
3615
- !eventSource.fetchRange ||
3616
- eventSource.isFetching || // always cancel outdated in-progress fetches
3617
- fetchRange.start < eventSource.fetchRange.start ||
3618
- fetchRange.end > eventSource.fetchRange.end;
3619
- }
3620
- function fetchSourcesByIds(prevSources, sourceIdHash, fetchRange, isRefetch, context) {
3621
- let nextSources = {};
3622
- for (let sourceId in prevSources) {
3623
- let source = prevSources[sourceId];
3624
- if (sourceIdHash[sourceId]) {
3625
- nextSources[sourceId] = fetchSource(source, fetchRange, isRefetch, context);
3626
- }
3627
- else {
3628
- nextSources[sourceId] = source;
3629
- }
3630
- }
3631
- return nextSources;
3632
- }
3633
- function fetchSource(eventSource, fetchRange, isRefetch, context) {
3634
- let { options, calendarApi } = context;
3635
- let sourceDef = context.pluginHooks.eventSourceDefs[eventSource.sourceDefId];
3636
- let fetchId = guid();
3637
- sourceDef.fetch({
3638
- eventSource,
3639
- range: fetchRange,
3640
- isRefetch,
3641
- context,
3642
- }, (res) => {
3643
- let { rawEvents } = res;
3644
- if (options.eventSourceSuccess) {
3645
- rawEvents = options.eventSourceSuccess.call(calendarApi, rawEvents, res.response) || rawEvents;
3646
- }
3647
- if (eventSource.success) {
3648
- rawEvents = eventSource.success.call(calendarApi, rawEvents, res.response) || rawEvents;
3649
- }
3650
- context.dispatch({
3651
- type: 'RECEIVE_EVENTS',
3652
- sourceId: eventSource.sourceId,
3653
- fetchId,
3654
- fetchRange,
3655
- rawEvents,
3656
- });
3657
- }, (error) => {
3658
- let errorHandled = false;
3659
- if (options.eventSourceFailure) {
3660
- options.eventSourceFailure.call(calendarApi, error);
3661
- errorHandled = true;
3662
- }
3663
- if (eventSource.failure) {
3664
- eventSource.failure(error);
3665
- errorHandled = true;
3666
- }
3667
- if (!errorHandled) {
3668
- console.warn(error.message, error);
3669
- }
3670
- context.dispatch({
3671
- type: 'RECEIVE_EVENT_ERROR',
3672
- sourceId: eventSource.sourceId,
3673
- fetchId,
3674
- fetchRange,
3675
- error,
3676
- });
3677
- });
3678
- return Object.assign(Object.assign({}, eventSource), { isFetching: true, latestFetchId: fetchId });
3679
- }
3680
- function receiveResponse(sourceHash, sourceId, fetchId, fetchRange) {
3681
- let eventSource = sourceHash[sourceId];
3682
- if (eventSource && // not already removed
3683
- fetchId === eventSource.latestFetchId) {
3684
- return Object.assign(Object.assign({}, sourceHash), { [sourceId]: Object.assign(Object.assign({}, eventSource), { isFetching: false, fetchRange }) });
3685
- }
3686
- return sourceHash;
3687
- }
3688
- function excludeStaticSources(eventSources, context) {
3689
- return filterHash(eventSources, (eventSource) => doesSourceNeedRange(eventSource, context));
3690
- }
3691
- function parseInitialSources(rawOptions, context) {
3692
- let refiners = buildEventSourceRefiners(context);
3693
- let rawSources = [].concat(rawOptions.eventSources || []);
3694
- let sources = []; // parsed
3695
- if (rawOptions.initialEvents) {
3696
- rawSources.unshift(rawOptions.initialEvents);
3697
- }
3698
- if (rawOptions.events) {
3699
- rawSources.unshift(rawOptions.events);
3700
- }
3701
- for (let rawSource of rawSources) {
3702
- let source = parseEventSource(rawSource, context, refiners);
3703
- if (source) {
3704
- sources.push(source);
3705
- }
3706
- }
3707
- return sources;
3708
- }
3709
- function doesSourceNeedRange(eventSource, context) {
3710
- let defs = context.pluginHooks.eventSourceDefs;
3711
- return !defs[eventSource.sourceDefId].ignoreRange;
3712
- }
3713
-
3714
- function reduceEventStore(eventStore, action, eventSources, dateProfile, context) {
3715
- switch (action.type) {
3716
- case 'RECEIVE_EVENTS': // raw
3717
- return receiveRawEvents(eventStore, eventSources[action.sourceId], action.fetchId, action.fetchRange, action.rawEvents, context);
3718
- case 'ADD_EVENTS': // already parsed, but not expanded
3719
- return addEvent(eventStore, action.eventStore, // new ones
3720
- dateProfile ? dateProfile.activeRange : null, context);
3721
- case 'RESET_EVENTS':
3722
- return action.eventStore;
3723
- case 'MERGE_EVENTS': // already parsed and expanded
3724
- return mergeEventStores(eventStore, action.eventStore);
3725
- case 'PREV': // TODO: how do we track all actions that affect dateProfile :(
3726
- case 'NEXT':
3727
- case 'CHANGE_DATE':
3728
- case 'CHANGE_VIEW_TYPE':
3729
- if (dateProfile) {
3730
- return expandRecurring(eventStore, dateProfile.activeRange, context);
3731
- }
3732
- return eventStore;
3733
- case 'REMOVE_EVENTS':
3734
- return excludeSubEventStore(eventStore, action.eventStore);
3735
- case 'REMOVE_EVENT_SOURCE':
3736
- return excludeEventsBySourceId(eventStore, action.sourceId);
3737
- case 'REMOVE_ALL_EVENT_SOURCES':
3738
- return filterEventStoreDefs(eventStore, (eventDef) => (!eventDef.sourceId // only keep events with no source id
3739
- ));
3740
- case 'REMOVE_ALL_EVENTS':
3741
- return createEmptyEventStore();
3742
- default:
3743
- return eventStore;
3744
- }
3745
- }
3746
- function receiveRawEvents(eventStore, eventSource, fetchId, fetchRange, rawEvents, context) {
3747
- if (eventSource && // not already removed
3748
- fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources
3749
- ) {
3750
- let subset = parseEvents(transformRawEvents(rawEvents, eventSource, context), eventSource, context);
3751
- if (fetchRange) {
3752
- subset = expandRecurring(subset, fetchRange, context);
3753
- }
3754
- return mergeEventStores(excludeEventsBySourceId(eventStore, eventSource.sourceId), subset);
3755
- }
3756
- return eventStore;
3757
- }
3758
- function transformRawEvents(rawEvents, eventSource, context) {
3759
- let calEachTransform = context.options.eventDataTransform;
3760
- let sourceEachTransform = eventSource ? eventSource.eventDataTransform : null;
3761
- if (sourceEachTransform) {
3762
- rawEvents = transformEachRawEvent(rawEvents, sourceEachTransform);
3763
- }
3764
- if (calEachTransform) {
3765
- rawEvents = transformEachRawEvent(rawEvents, calEachTransform);
3766
- }
3767
- return rawEvents;
3768
- }
3769
- function transformEachRawEvent(rawEvents, func) {
3770
- let refinedEvents;
3771
- if (!func) {
3772
- refinedEvents = rawEvents;
3444
+ function transformEachRawEvent(rawEvents, func) {
3445
+ let refinedEvents;
3446
+ if (!func) {
3447
+ refinedEvents = rawEvents;
3773
3448
  }
3774
3449
  else {
3775
3450
  refinedEvents = [];
@@ -3894,25 +3569,6 @@ var FullCalendar = (function (exports) {
3894
3569
  return rawDefs;
3895
3570
  }
3896
3571
 
3897
- let eventSourceDef$2 = {
3898
- ignoreRange: true,
3899
- parseMeta(refined) {
3900
- if (Array.isArray(refined.events)) {
3901
- return refined.events;
3902
- }
3903
- return null;
3904
- },
3905
- fetch(arg, successCallback) {
3906
- successCallback({
3907
- rawEvents: arg.eventSource.meta,
3908
- });
3909
- },
3910
- };
3911
- const arrayEventSourcePlugin = createPlugin({
3912
- name: 'array-event-source',
3913
- eventSourceDefs: [eventSourceDef$2],
3914
- });
3915
-
3916
3572
  function triggerDateSelect(selection, pev, context) {
3917
3573
  context.emitter.trigger('select', Object.assign(Object.assign({}, buildDateSpanApiWithContext(selection, context)), { jsEvent: pev ? pev.origEvent : null, view: context.viewApi || context.calendarApi.view }));
3918
3574
  }
@@ -4798,24 +4454,6 @@ var FullCalendar = (function (exports) {
4798
4454
  }
4799
4455
  }
4800
4456
 
4801
- let eventSourceDef$1 = {
4802
- parseMeta(refined) {
4803
- if (typeof refined.events === 'function') {
4804
- return refined.events;
4805
- }
4806
- return null;
4807
- },
4808
- fetch(arg, successCallback, errorCallback) {
4809
- const { dateEnv } = arg.context;
4810
- const func = arg.eventSource.meta;
4811
- unpromisify(func.bind(null, buildRangeApiWithTimeZone(arg.range, dateEnv)), (rawEvents) => successCallback({ rawEvents }), errorCallback);
4812
- },
4813
- };
4814
- const funcEventSourcePlugin = createPlugin({
4815
- name: 'func-event-source',
4816
- eventSourceDefs: [eventSourceDef$1],
4817
- });
4818
-
4819
4457
  class JsonRequestError extends Error {
4820
4458
  constructor(message, response) {
4821
4459
  super(message);
@@ -4851,232 +4489,18 @@ var FullCalendar = (function (exports) {
4851
4489
  });
4852
4490
  }
4853
4491
 
4854
- const JSON_FEED_EVENT_SOURCE_REFINERS = {
4855
- method: String,
4856
- extraParams: identity,
4857
- startParam: String,
4858
- endParam: String,
4859
- timeZoneParam: String,
4860
- };
4861
-
4862
- let eventSourceDef = {
4863
- parseMeta(refined) {
4864
- if (refined.url && (refined.format === 'json' || !refined.format)) {
4865
- return {
4866
- url: refined.url,
4867
- format: 'json',
4868
- method: (refined.method || 'GET').toUpperCase(),
4869
- extraParams: refined.extraParams,
4870
- startParam: refined.startParam,
4871
- endParam: refined.endParam,
4872
- timeZoneParam: refined.timeZoneParam,
4873
- };
4874
- }
4875
- return null;
4876
- },
4877
- fetch(arg, successCallback, errorCallback) {
4878
- const { meta } = arg.eventSource;
4879
- const requestParams = buildRequestParams(meta, arg.range, arg.context);
4880
- requestJson(meta.method, meta.url, requestParams).then(([rawEvents, response]) => {
4881
- successCallback({ rawEvents, response });
4882
- }, errorCallback);
4883
- },
4884
- };
4885
- const jsonFeedEventSourcePlugin = createPlugin({
4886
- name: 'json-event-source',
4887
- eventSourceRefiners: JSON_FEED_EVENT_SOURCE_REFINERS,
4888
- eventSourceDefs: [eventSourceDef],
4889
- });
4890
- function buildRequestParams(meta, range, context) {
4891
- let { dateEnv, options } = context;
4892
- let startParam;
4893
- let endParam;
4894
- let timeZoneParam;
4895
- let customRequestParams;
4896
- let params = {};
4897
- startParam = meta.startParam;
4898
- if (startParam == null) {
4899
- startParam = options.startParam;
4900
- }
4901
- endParam = meta.endParam;
4902
- if (endParam == null) {
4903
- endParam = options.endParam;
4492
+ let canVGrowWithinCell;
4493
+ function getCanVGrowWithinCell() {
4494
+ if (canVGrowWithinCell == null) {
4495
+ canVGrowWithinCell = computeCanVGrowWithinCell();
4904
4496
  }
4905
- timeZoneParam = meta.timeZoneParam;
4906
- if (timeZoneParam == null) {
4907
- timeZoneParam = options.timeZoneParam;
4908
- }
4909
- // retrieve any outbound GET/POST data from the options
4910
- if (typeof meta.extraParams === 'function') {
4911
- // supplied as a function that returns a key/value object
4912
- customRequestParams = meta.extraParams();
4913
- }
4914
- else {
4915
- // probably supplied as a straight key/value object
4916
- customRequestParams = meta.extraParams || {};
4917
- }
4918
- Object.assign(params, customRequestParams);
4919
- params[startParam] = dateEnv.formatIso(range.start);
4920
- params[endParam] = dateEnv.formatIso(range.end);
4921
- if (dateEnv.timeZone !== 'local') {
4922
- params[timeZoneParam] = dateEnv.timeZone;
4923
- }
4924
- return params;
4925
- }
4926
-
4927
- const SIMPLE_RECURRING_REFINERS = {
4928
- daysOfWeek: identity,
4929
- startTime: createDuration,
4930
- endTime: createDuration,
4931
- duration: createDuration,
4932
- startRecur: identity,
4933
- endRecur: identity,
4934
- };
4935
-
4936
- let recurring = {
4937
- parse(refined, dateEnv) {
4938
- if (refined.daysOfWeek || refined.startTime || refined.endTime || refined.startRecur || refined.endRecur) {
4939
- let recurringData = {
4940
- daysOfWeek: refined.daysOfWeek || null,
4941
- startTime: refined.startTime || null,
4942
- endTime: refined.endTime || null,
4943
- startRecur: refined.startRecur ? dateEnv.createMarker(refined.startRecur) : null,
4944
- endRecur: refined.endRecur ? dateEnv.createMarker(refined.endRecur) : null,
4945
- };
4946
- let duration;
4947
- if (refined.duration) {
4948
- duration = refined.duration;
4949
- }
4950
- if (!duration && refined.startTime && refined.endTime) {
4951
- duration = subtractDurations(refined.endTime, refined.startTime);
4952
- }
4953
- return {
4954
- allDayGuess: Boolean(!refined.startTime && !refined.endTime),
4955
- duration,
4956
- typeData: recurringData, // doesn't need endTime anymore but oh well
4957
- };
4958
- }
4959
- return null;
4960
- },
4961
- expand(typeData, framingRange, dateEnv) {
4962
- let clippedFramingRange = intersectRanges(framingRange, { start: typeData.startRecur, end: typeData.endRecur });
4963
- if (clippedFramingRange) {
4964
- return expandRanges(typeData.daysOfWeek, typeData.startTime, clippedFramingRange, dateEnv);
4965
- }
4966
- return [];
4967
- },
4968
- };
4969
- const simpleRecurringEventsPlugin = createPlugin({
4970
- name: 'simple-recurring-event',
4971
- recurringTypes: [recurring],
4972
- eventRefiners: SIMPLE_RECURRING_REFINERS,
4973
- });
4974
- function expandRanges(daysOfWeek, startTime, framingRange, dateEnv) {
4975
- let dowHash = daysOfWeek ? arrayToHash(daysOfWeek) : null;
4976
- let dayMarker = startOfDay(framingRange.start);
4977
- let endMarker = framingRange.end;
4978
- let instanceStarts = [];
4979
- while (dayMarker < endMarker) {
4980
- let instanceStart;
4981
- // if everyday, or this particular day-of-week
4982
- if (!dowHash || dowHash[dayMarker.getUTCDay()]) {
4983
- if (startTime) {
4984
- instanceStart = dateEnv.add(dayMarker, startTime);
4985
- }
4986
- else {
4987
- instanceStart = dayMarker;
4988
- }
4989
- instanceStarts.push(instanceStart);
4990
- }
4991
- dayMarker = addDays(dayMarker, 1);
4992
- }
4993
- return instanceStarts;
4994
- }
4995
-
4996
- const changeHandlerPlugin = createPlugin({
4997
- name: 'change-handler',
4998
- optionChangeHandlers: {
4999
- events(events, context) {
5000
- handleEventSources([events], context);
5001
- },
5002
- eventSources: handleEventSources,
5003
- },
5004
- });
5005
- /*
5006
- BUG: if `event` was supplied, all previously-given `eventSources` will be wiped out
5007
- */
5008
- function handleEventSources(inputs, context) {
5009
- let unfoundSources = hashValuesToArray(context.getCurrentData().eventSources);
5010
- let newInputs = [];
5011
- for (let input of inputs) {
5012
- let inputFound = false;
5013
- for (let i = 0; i < unfoundSources.length; i += 1) {
5014
- if (unfoundSources[i]._raw === input) {
5015
- unfoundSources.splice(i, 1); // delete
5016
- inputFound = true;
5017
- break;
5018
- }
5019
- }
5020
- if (!inputFound) {
5021
- newInputs.push(input);
5022
- }
5023
- }
5024
- for (let unfoundSource of unfoundSources) {
5025
- context.dispatch({
5026
- type: 'REMOVE_EVENT_SOURCE',
5027
- sourceId: unfoundSource.sourceId,
5028
- });
5029
- }
5030
- for (let newInput of newInputs) {
5031
- context.calendarApi.addEventSource(newInput);
5032
- }
5033
- }
5034
-
5035
- function handleDateProfile(dateProfile, context) {
5036
- context.emitter.trigger('datesSet', Object.assign(Object.assign({}, buildRangeApiWithTimeZone(dateProfile.activeRange, context.dateEnv)), { view: context.viewApi }));
5037
- }
5038
-
5039
- function handleEventStore(eventStore, context) {
5040
- let { emitter } = context;
5041
- if (emitter.hasHandlers('eventsSet')) {
5042
- emitter.trigger('eventsSet', buildEventApis(eventStore, context));
5043
- }
5044
- }
5045
-
5046
- /*
5047
- this array is exposed on the root namespace so that UMD plugins can add to it.
5048
- see the rollup-bundles script.
5049
- */
5050
- const globalPlugins = [
5051
- arrayEventSourcePlugin,
5052
- funcEventSourcePlugin,
5053
- jsonFeedEventSourcePlugin,
5054
- simpleRecurringEventsPlugin,
5055
- changeHandlerPlugin,
5056
- createPlugin({
5057
- name: 'misc',
5058
- isLoadingFuncs: [
5059
- (state) => computeEventSourcesLoading(state.eventSources),
5060
- ],
5061
- propSetHandlers: {
5062
- dateProfile: handleDateProfile,
5063
- eventStore: handleEventStore,
5064
- },
5065
- }),
5066
- ];
5067
-
5068
- let canVGrowWithinCell;
5069
- function getCanVGrowWithinCell() {
5070
- if (canVGrowWithinCell == null) {
5071
- canVGrowWithinCell = computeCanVGrowWithinCell();
5072
- }
5073
- return canVGrowWithinCell;
5074
- }
5075
- function computeCanVGrowWithinCell() {
5076
- // for SSR, because this function is call immediately at top-level
5077
- // TODO: just make this logic execute top-level, immediately, instead of doing lazily
5078
- if (typeof document === 'undefined') {
5079
- return true;
4497
+ return canVGrowWithinCell;
4498
+ }
4499
+ function computeCanVGrowWithinCell() {
4500
+ // for SSR, because this function is call immediately at top-level
4501
+ // TODO: just make this logic execute top-level, immediately, instead of doing lazily
4502
+ if (typeof document === 'undefined') {
4503
+ return true;
5080
4504
  }
5081
4505
  let el = document.createElement('div');
5082
4506
  el.style.position = 'absolute';
@@ -7975,8 +7399,6 @@ var FullCalendar = (function (exports) {
7975
7399
  getStickyFooterScrollbar: getStickyFooterScrollbar,
7976
7400
  getStickyHeaderDates: getStickyHeaderDates,
7977
7401
  getUniqueDomId: getUniqueDomId,
7978
- globalLocales: globalLocales,
7979
- globalPlugins: globalPlugins,
7980
7402
  greatestDurationDenominator: greatestDurationDenominator,
7981
7403
  groupIntersectingEntries: groupIntersectingEntries,
7982
7404
  guid: guid,
@@ -8046,6 +7468,8 @@ var FullCalendar = (function (exports) {
8046
7468
  var css_248z$3 = ":root{--fc-small-font-size:.85em;--fc-page-bg-color:#fff;--fc-neutral-bg-color:hsla(0,0%,82%,.3);--fc-neutral-text-color:grey;--fc-border-color:#ddd;--fc-button-text-color:#fff;--fc-button-bg-color:#2c3e50;--fc-button-border-color:#2c3e50;--fc-button-hover-bg-color:#1e2b37;--fc-button-hover-border-color:#1a252f;--fc-button-active-bg-color:#1a252f;--fc-button-active-border-color:#151e27;--fc-event-bg-color:#3788d8;--fc-event-border-color:#3788d8;--fc-event-text-color:#fff;--fc-event-selected-overlay-color:rgba(0,0,0,.25);--fc-more-link-bg-color:#d0d0d0;--fc-more-link-text-color:inherit;--fc-event-resizer-thickness:8px;--fc-event-resizer-dot-total-width:8px;--fc-event-resizer-dot-border-width:1px;--fc-non-business-color:hsla(0,0%,84%,.3);--fc-bg-event-color:#8fdf82;--fc-bg-event-opacity:0.3;--fc-highlight-color:rgba(188,232,241,.3);--fc-today-bg-color:rgba(255,220,40,.15);--fc-now-indicator-color:red}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc-unselectable{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-user-select:none;-moz-user-select:none;user-select:none}.fc{display:flex;flex-direction:column;font-size:1em}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{padding:0;vertical-align:top}.fc a[data-navlink]{cursor:pointer}.fc a[data-navlink]:hover{text-decoration:underline}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid var(--fc-border-color)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;font-style:normal;font-weight:400;src:url(\"data:application/x-font-ttf;charset=utf-8;base64,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\") format(\"truetype\")}.fc-icon{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:fcicons!important;font-style:normal;font-variant:normal;font-weight:400;height:1em;line-height:1;text-align:center;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:1em}.fc-icon-chevron-left:before{content:\"\\e900\"}.fc-icon-chevron-right:before{content:\"\\e901\"}.fc-icon-chevrons-left:before{content:\"\\e902\"}.fc-icon-chevrons-right:before{content:\"\\e903\"}.fc-icon-minus-square:before{content:\"\\e904\"}.fc-icon-plus-square:before{content:\"\\e905\"}.fc-icon-x:before{content:\"\\e906\"}.fc .fc-button{border-radius:0;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}.fc .fc-button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.fc .fc-button{-webkit-appearance:button}.fc .fc-button:not(:disabled){cursor:pointer}.fc .fc-button::-moz-focus-inner{border-style:none;padding:0}.fc .fc-button{background-color:transparent;border:1px solid transparent;border-radius:.25em;display:inline-block;font-size:1em;font-weight:400;line-height:1.5;padding:.4em .65em;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.fc .fc-button:hover{text-decoration:none}.fc .fc-button:focus{box-shadow:0 0 0 .2rem rgba(44,62,80,.25);outline:0}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:hover{background-color:var(--fc-button-hover-bg-color);border-color:var(--fc-button-hover-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:disabled{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{background-color:var(--fc-button-active-bg-color);border-color:var(--fc-button-active-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button .fc-icon{font-size:1.5em;vertical-align:middle}.fc .fc-button-group{display:inline-flex;position:relative;vertical-align:middle}.fc .fc-button-group>.fc-button{flex:1 1 auto;position:relative}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-bottom-left-radius:0;border-top-left-radius:0}.fc .fc-toolbar{align-items:center;display:flex;justify-content:space-between}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-scroller-harness{direction:ltr;overflow:hidden;position:relative}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--fc-border-color)}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{table-layout:fixed;width:100%}.fc .fc-scrollgrid table{border-left-style:hidden;border-right-style:hidden;border-top-style:hidden}.fc .fc-scrollgrid{border-bottom-width:0;border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-left-width:0;border-top-width:0}.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-view-harness-active>.fc-view{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-non-business{background:var(--fc-non-business-color)}.fc .fc-bg-event{background:var(--fc-bg-event-color);opacity:var(--fc-bg-event-opacity)}.fc .fc-bg-event .fc-event-title{font-size:var(--fc-small-font-size);font-style:italic;margin:.5em}.fc .fc-highlight{background:var(--fc-highlight-color)}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:var(--fc-neutral-bg-color)}a.fc-event,a.fc-event:hover{text-decoration:none}.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer{display:block}.fc-event-selected .fc-event-resizer{background:var(--fc-page-bg-color);border-color:inherit;border-radius:calc(var(--fc-event-resizer-dot-total-width)/2);border-style:solid;border-width:var(--fc-event-resizer-dot-border-width);height:var(--fc-event-resizer-dot-total-width);width:var(--fc-event-resizer-dot-total-width)}.fc-event-selected .fc-event-resizer:before{bottom:-20px;content:\"\";left:-20px;position:absolute;right:-20px;top:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:3}.fc-event-selected:after,.fc-event:focus:after{background:var(--fc-event-selected-overlay-color);bottom:-1px;content:\"\";left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fc-h-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-h-event .fc-event-main{color:var(--fc-event-text-color)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;left:0;max-width:100%;overflow:hidden;right:0;vertical-align:top}.fc-h-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{bottom:0;top:0;width:var(--fc-event-resizer-thickness)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-h-event.fc-event-selected .fc-event-resizer{margin-top:calc(var(--fc-event-resizer-dot-total-width)*-.5);top:50%}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc .fc-popover{box-shadow:0 2px 6px rgba(0,0,0,.15);position:absolute;z-index:9999}.fc .fc-popover-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;font-size:1.1em;opacity:.65}.fc-theme-standard .fc-popover{background:var(--fc-page-bg-color);border:1px solid var(--fc-border-color)}.fc-theme-standard .fc-popover-header{background:var(--fc-neutral-bg-color)}";
8047
7469
  injectStyles(css_248z$3);
8048
7470
 
7471
+ const globalLocales = [];
7472
+
8049
7473
  const MINIMAL_RAW_EN_LOCALE = {
8050
7474
  code: 'en',
8051
7475
  week: {
@@ -8139,89 +7563,248 @@ var FullCalendar = (function (exports) {
8139
7563
  };
8140
7564
  }
8141
7565
 
8142
- class StandardTheme extends Theme {
8143
- }
8144
- StandardTheme.prototype.classes = {
8145
- root: 'fc-theme-standard',
8146
- tableCellShaded: 'fc-cell-shaded',
8147
- buttonGroup: 'fc-button-group',
8148
- button: 'fc-button fc-button-primary',
8149
- buttonActive: 'fc-button-active',
8150
- };
8151
- StandardTheme.prototype.baseIconClass = 'fc-icon';
8152
- StandardTheme.prototype.iconClasses = {
8153
- close: 'fc-icon-x',
8154
- prev: 'fc-icon-chevron-left',
8155
- next: 'fc-icon-chevron-right',
8156
- prevYear: 'fc-icon-chevrons-left',
8157
- nextYear: 'fc-icon-chevrons-right',
8158
- };
8159
- StandardTheme.prototype.rtlIconClasses = {
8160
- prev: 'fc-icon-chevron-right',
8161
- next: 'fc-icon-chevron-left',
8162
- prevYear: 'fc-icon-chevrons-right',
8163
- nextYear: 'fc-icon-chevrons-left',
8164
- };
8165
- StandardTheme.prototype.iconOverrideOption = 'buttonIcons'; // TODO: make TS-friendly
8166
- StandardTheme.prototype.iconOverrideCustomButtonOption = 'icon';
8167
- StandardTheme.prototype.iconOverridePrefix = 'fc-icon-';
8168
-
8169
- function compileViewDefs(defaultConfigs, overrideConfigs) {
8170
- let hash = {};
8171
- let viewType;
8172
- for (viewType in defaultConfigs) {
8173
- ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs);
8174
- }
8175
- for (viewType in overrideConfigs) {
8176
- ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs);
8177
- }
8178
- return hash;
8179
- }
8180
- function ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs) {
8181
- if (hash[viewType]) {
8182
- return hash[viewType];
8183
- }
8184
- let viewDef = buildViewDef(viewType, hash, defaultConfigs, overrideConfigs);
8185
- if (viewDef) {
8186
- hash[viewType] = viewDef;
8187
- }
8188
- return viewDef;
8189
- }
8190
- function buildViewDef(viewType, hash, defaultConfigs, overrideConfigs) {
8191
- let defaultConfig = defaultConfigs[viewType];
8192
- let overrideConfig = overrideConfigs[viewType];
8193
- let queryProp = (name) => ((defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] :
8194
- ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null));
8195
- let theComponent = queryProp('component');
8196
- let superType = queryProp('superType');
8197
- let superDef = null;
8198
- if (superType) {
8199
- if (superType === viewType) {
8200
- throw new Error('Can\'t have a custom view type that references itself');
8201
- }
8202
- superDef = ensureViewDef(superType, hash, defaultConfigs, overrideConfigs);
8203
- }
8204
- if (!theComponent && superDef) {
8205
- theComponent = superDef.component;
8206
- }
8207
- if (!theComponent) {
8208
- return null; // don't throw a warning, might be settings for a single-unit view
8209
- }
7566
+ // TODO: easier way to add new hooks? need to update a million things
7567
+ function createPlugin(input) {
8210
7568
  return {
8211
- type: viewType,
8212
- component: theComponent,
8213
- defaults: Object.assign(Object.assign({}, (superDef ? superDef.defaults : {})), (defaultConfig ? defaultConfig.rawOptions : {})),
8214
- overrides: Object.assign(Object.assign({}, (superDef ? superDef.overrides : {})), (overrideConfig ? overrideConfig.rawOptions : {})),
8215
- };
8216
- }
8217
-
8218
- function parseViewConfigs(inputs) {
8219
- return mapHash(inputs, parseViewConfig);
8220
- }
8221
- function parseViewConfig(input) {
8222
- let rawOptions = typeof input === 'function' ?
8223
- { component: input } :
8224
- input;
7569
+ id: guid(),
7570
+ name: input.name,
7571
+ premiumReleaseDate: input.premiumReleaseDate ? new Date(input.premiumReleaseDate) : undefined,
7572
+ deps: input.deps || [],
7573
+ reducers: input.reducers || [],
7574
+ isLoadingFuncs: input.isLoadingFuncs || [],
7575
+ contextInit: [].concat(input.contextInit || []),
7576
+ eventRefiners: input.eventRefiners || {},
7577
+ eventDefMemberAdders: input.eventDefMemberAdders || [],
7578
+ eventSourceRefiners: input.eventSourceRefiners || {},
7579
+ isDraggableTransformers: input.isDraggableTransformers || [],
7580
+ eventDragMutationMassagers: input.eventDragMutationMassagers || [],
7581
+ eventDefMutationAppliers: input.eventDefMutationAppliers || [],
7582
+ dateSelectionTransformers: input.dateSelectionTransformers || [],
7583
+ datePointTransforms: input.datePointTransforms || [],
7584
+ dateSpanTransforms: input.dateSpanTransforms || [],
7585
+ views: input.views || {},
7586
+ viewPropsTransformers: input.viewPropsTransformers || [],
7587
+ isPropsValid: input.isPropsValid || null,
7588
+ externalDefTransforms: input.externalDefTransforms || [],
7589
+ viewContainerAppends: input.viewContainerAppends || [],
7590
+ eventDropTransformers: input.eventDropTransformers || [],
7591
+ componentInteractions: input.componentInteractions || [],
7592
+ calendarInteractions: input.calendarInteractions || [],
7593
+ themeClasses: input.themeClasses || {},
7594
+ eventSourceDefs: input.eventSourceDefs || [],
7595
+ cmdFormatter: input.cmdFormatter,
7596
+ recurringTypes: input.recurringTypes || [],
7597
+ namedTimeZonedImpl: input.namedTimeZonedImpl,
7598
+ initialView: input.initialView || '',
7599
+ elementDraggingImpl: input.elementDraggingImpl,
7600
+ optionChangeHandlers: input.optionChangeHandlers || {},
7601
+ scrollGridImpl: input.scrollGridImpl || null,
7602
+ listenerRefiners: input.listenerRefiners || {},
7603
+ optionRefiners: input.optionRefiners || {},
7604
+ propSetHandlers: input.propSetHandlers || {},
7605
+ };
7606
+ }
7607
+ function buildPluginHooks(pluginDefs, globalDefs) {
7608
+ let currentPluginIds = {};
7609
+ let hooks = {
7610
+ premiumReleaseDate: undefined,
7611
+ reducers: [],
7612
+ isLoadingFuncs: [],
7613
+ contextInit: [],
7614
+ eventRefiners: {},
7615
+ eventDefMemberAdders: [],
7616
+ eventSourceRefiners: {},
7617
+ isDraggableTransformers: [],
7618
+ eventDragMutationMassagers: [],
7619
+ eventDefMutationAppliers: [],
7620
+ dateSelectionTransformers: [],
7621
+ datePointTransforms: [],
7622
+ dateSpanTransforms: [],
7623
+ views: {},
7624
+ viewPropsTransformers: [],
7625
+ isPropsValid: null,
7626
+ externalDefTransforms: [],
7627
+ viewContainerAppends: [],
7628
+ eventDropTransformers: [],
7629
+ componentInteractions: [],
7630
+ calendarInteractions: [],
7631
+ themeClasses: {},
7632
+ eventSourceDefs: [],
7633
+ cmdFormatter: null,
7634
+ recurringTypes: [],
7635
+ namedTimeZonedImpl: null,
7636
+ initialView: '',
7637
+ elementDraggingImpl: null,
7638
+ optionChangeHandlers: {},
7639
+ scrollGridImpl: null,
7640
+ listenerRefiners: {},
7641
+ optionRefiners: {},
7642
+ propSetHandlers: {},
7643
+ };
7644
+ function addDefs(defs) {
7645
+ for (let def of defs) {
7646
+ const pluginName = def.name;
7647
+ const currentId = currentPluginIds[pluginName];
7648
+ if (currentId === undefined) {
7649
+ currentPluginIds[pluginName] = def.id;
7650
+ addDefs(def.deps);
7651
+ hooks = combineHooks(hooks, def);
7652
+ }
7653
+ else if (currentId !== def.id) {
7654
+ // different ID than the one already added
7655
+ console.warn(`Duplicate plugin '${pluginName}'`);
7656
+ }
7657
+ }
7658
+ }
7659
+ if (pluginDefs) {
7660
+ addDefs(pluginDefs);
7661
+ }
7662
+ addDefs(globalDefs);
7663
+ return hooks;
7664
+ }
7665
+ function buildBuildPluginHooks() {
7666
+ let currentOverrideDefs = [];
7667
+ let currentGlobalDefs = [];
7668
+ let currentHooks;
7669
+ return (overrideDefs, globalDefs) => {
7670
+ if (!currentHooks || !isArraysEqual(overrideDefs, currentOverrideDefs) || !isArraysEqual(globalDefs, currentGlobalDefs)) {
7671
+ currentHooks = buildPluginHooks(overrideDefs, globalDefs);
7672
+ }
7673
+ currentOverrideDefs = overrideDefs;
7674
+ currentGlobalDefs = globalDefs;
7675
+ return currentHooks;
7676
+ };
7677
+ }
7678
+ function combineHooks(hooks0, hooks1) {
7679
+ return {
7680
+ premiumReleaseDate: compareOptionalDates(hooks0.premiumReleaseDate, hooks1.premiumReleaseDate),
7681
+ reducers: hooks0.reducers.concat(hooks1.reducers),
7682
+ isLoadingFuncs: hooks0.isLoadingFuncs.concat(hooks1.isLoadingFuncs),
7683
+ contextInit: hooks0.contextInit.concat(hooks1.contextInit),
7684
+ eventRefiners: Object.assign(Object.assign({}, hooks0.eventRefiners), hooks1.eventRefiners),
7685
+ eventDefMemberAdders: hooks0.eventDefMemberAdders.concat(hooks1.eventDefMemberAdders),
7686
+ eventSourceRefiners: Object.assign(Object.assign({}, hooks0.eventSourceRefiners), hooks1.eventSourceRefiners),
7687
+ isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers),
7688
+ eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers),
7689
+ eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers),
7690
+ dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers),
7691
+ datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms),
7692
+ dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms),
7693
+ views: Object.assign(Object.assign({}, hooks0.views), hooks1.views),
7694
+ viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers),
7695
+ isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid,
7696
+ externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms),
7697
+ viewContainerAppends: hooks0.viewContainerAppends.concat(hooks1.viewContainerAppends),
7698
+ eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),
7699
+ calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),
7700
+ componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),
7701
+ themeClasses: Object.assign(Object.assign({}, hooks0.themeClasses), hooks1.themeClasses),
7702
+ eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs),
7703
+ cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter,
7704
+ recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes),
7705
+ namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl,
7706
+ initialView: hooks0.initialView || hooks1.initialView,
7707
+ elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl,
7708
+ optionChangeHandlers: Object.assign(Object.assign({}, hooks0.optionChangeHandlers), hooks1.optionChangeHandlers),
7709
+ scrollGridImpl: hooks1.scrollGridImpl || hooks0.scrollGridImpl,
7710
+ listenerRefiners: Object.assign(Object.assign({}, hooks0.listenerRefiners), hooks1.listenerRefiners),
7711
+ optionRefiners: Object.assign(Object.assign({}, hooks0.optionRefiners), hooks1.optionRefiners),
7712
+ propSetHandlers: Object.assign(Object.assign({}, hooks0.propSetHandlers), hooks1.propSetHandlers),
7713
+ };
7714
+ }
7715
+ function compareOptionalDates(date0, date1) {
7716
+ if (date0 === undefined) {
7717
+ return date1;
7718
+ }
7719
+ if (date1 === undefined) {
7720
+ return date0;
7721
+ }
7722
+ return new Date(Math.max(date0.valueOf(), date1.valueOf()));
7723
+ }
7724
+
7725
+ class StandardTheme extends Theme {
7726
+ }
7727
+ StandardTheme.prototype.classes = {
7728
+ root: 'fc-theme-standard',
7729
+ tableCellShaded: 'fc-cell-shaded',
7730
+ buttonGroup: 'fc-button-group',
7731
+ button: 'fc-button fc-button-primary',
7732
+ buttonActive: 'fc-button-active',
7733
+ };
7734
+ StandardTheme.prototype.baseIconClass = 'fc-icon';
7735
+ StandardTheme.prototype.iconClasses = {
7736
+ close: 'fc-icon-x',
7737
+ prev: 'fc-icon-chevron-left',
7738
+ next: 'fc-icon-chevron-right',
7739
+ prevYear: 'fc-icon-chevrons-left',
7740
+ nextYear: 'fc-icon-chevrons-right',
7741
+ };
7742
+ StandardTheme.prototype.rtlIconClasses = {
7743
+ prev: 'fc-icon-chevron-right',
7744
+ next: 'fc-icon-chevron-left',
7745
+ prevYear: 'fc-icon-chevrons-right',
7746
+ nextYear: 'fc-icon-chevrons-left',
7747
+ };
7748
+ StandardTheme.prototype.iconOverrideOption = 'buttonIcons'; // TODO: make TS-friendly
7749
+ StandardTheme.prototype.iconOverrideCustomButtonOption = 'icon';
7750
+ StandardTheme.prototype.iconOverridePrefix = 'fc-icon-';
7751
+
7752
+ function compileViewDefs(defaultConfigs, overrideConfigs) {
7753
+ let hash = {};
7754
+ let viewType;
7755
+ for (viewType in defaultConfigs) {
7756
+ ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs);
7757
+ }
7758
+ for (viewType in overrideConfigs) {
7759
+ ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs);
7760
+ }
7761
+ return hash;
7762
+ }
7763
+ function ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs) {
7764
+ if (hash[viewType]) {
7765
+ return hash[viewType];
7766
+ }
7767
+ let viewDef = buildViewDef(viewType, hash, defaultConfigs, overrideConfigs);
7768
+ if (viewDef) {
7769
+ hash[viewType] = viewDef;
7770
+ }
7771
+ return viewDef;
7772
+ }
7773
+ function buildViewDef(viewType, hash, defaultConfigs, overrideConfigs) {
7774
+ let defaultConfig = defaultConfigs[viewType];
7775
+ let overrideConfig = overrideConfigs[viewType];
7776
+ let queryProp = (name) => ((defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] :
7777
+ ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null));
7778
+ let theComponent = queryProp('component');
7779
+ let superType = queryProp('superType');
7780
+ let superDef = null;
7781
+ if (superType) {
7782
+ if (superType === viewType) {
7783
+ throw new Error('Can\'t have a custom view type that references itself');
7784
+ }
7785
+ superDef = ensureViewDef(superType, hash, defaultConfigs, overrideConfigs);
7786
+ }
7787
+ if (!theComponent && superDef) {
7788
+ theComponent = superDef.component;
7789
+ }
7790
+ if (!theComponent) {
7791
+ return null; // don't throw a warning, might be settings for a single-unit view
7792
+ }
7793
+ return {
7794
+ type: viewType,
7795
+ component: theComponent,
7796
+ defaults: Object.assign(Object.assign({}, (superDef ? superDef.defaults : {})), (defaultConfig ? defaultConfig.rawOptions : {})),
7797
+ overrides: Object.assign(Object.assign({}, (superDef ? superDef.overrides : {})), (overrideConfig ? overrideConfig.rawOptions : {})),
7798
+ };
7799
+ }
7800
+
7801
+ function parseViewConfigs(inputs) {
7802
+ return mapHash(inputs, parseViewConfig);
7803
+ }
7804
+ function parseViewConfig(input) {
7805
+ let rawOptions = typeof input === 'function' ?
7806
+ { component: input } :
7807
+ input;
8225
7808
  let { component } = rawOptions;
8226
7809
  if (rawOptions.content) {
8227
7810
  component = createViewHookComponent(rawOptions);
@@ -8368,6 +7951,170 @@ var FullCalendar = (function (exports) {
8368
7951
  return currentDateProfile;
8369
7952
  }
8370
7953
 
7954
+ function initEventSources(calendarOptions, dateProfile, context) {
7955
+ let activeRange = dateProfile ? dateProfile.activeRange : null;
7956
+ return addSources({}, parseInitialSources(calendarOptions, context), activeRange, context);
7957
+ }
7958
+ function reduceEventSources(eventSources, action, dateProfile, context) {
7959
+ let activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?
7960
+ switch (action.type) {
7961
+ case 'ADD_EVENT_SOURCES': // already parsed
7962
+ return addSources(eventSources, action.sources, activeRange, context);
7963
+ case 'REMOVE_EVENT_SOURCE':
7964
+ return removeSource(eventSources, action.sourceId);
7965
+ case 'PREV': // TODO: how do we track all actions that affect dateProfile :(
7966
+ case 'NEXT':
7967
+ case 'CHANGE_DATE':
7968
+ case 'CHANGE_VIEW_TYPE':
7969
+ if (dateProfile) {
7970
+ return fetchDirtySources(eventSources, activeRange, context);
7971
+ }
7972
+ return eventSources;
7973
+ case 'FETCH_EVENT_SOURCES':
7974
+ return fetchSourcesByIds(eventSources, action.sourceIds ? // why no type?
7975
+ arrayToHash(action.sourceIds) :
7976
+ excludeStaticSources(eventSources, context), activeRange, action.isRefetch || false, context);
7977
+ case 'RECEIVE_EVENTS':
7978
+ case 'RECEIVE_EVENT_ERROR':
7979
+ return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange);
7980
+ case 'REMOVE_ALL_EVENT_SOURCES':
7981
+ return {};
7982
+ default:
7983
+ return eventSources;
7984
+ }
7985
+ }
7986
+ function reduceEventSourcesNewTimeZone(eventSources, dateProfile, context) {
7987
+ let activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?
7988
+ return fetchSourcesByIds(eventSources, excludeStaticSources(eventSources, context), activeRange, true, context);
7989
+ }
7990
+ function computeEventSourcesLoading(eventSources) {
7991
+ for (let sourceId in eventSources) {
7992
+ if (eventSources[sourceId].isFetching) {
7993
+ return true;
7994
+ }
7995
+ }
7996
+ return false;
7997
+ }
7998
+ function addSources(eventSourceHash, sources, fetchRange, context) {
7999
+ let hash = {};
8000
+ for (let source of sources) {
8001
+ hash[source.sourceId] = source;
8002
+ }
8003
+ if (fetchRange) {
8004
+ hash = fetchDirtySources(hash, fetchRange, context);
8005
+ }
8006
+ return Object.assign(Object.assign({}, eventSourceHash), hash);
8007
+ }
8008
+ function removeSource(eventSourceHash, sourceId) {
8009
+ return filterHash(eventSourceHash, (eventSource) => eventSource.sourceId !== sourceId);
8010
+ }
8011
+ function fetchDirtySources(sourceHash, fetchRange, context) {
8012
+ return fetchSourcesByIds(sourceHash, filterHash(sourceHash, (eventSource) => isSourceDirty(eventSource, fetchRange, context)), fetchRange, false, context);
8013
+ }
8014
+ function isSourceDirty(eventSource, fetchRange, context) {
8015
+ if (!doesSourceNeedRange(eventSource, context)) {
8016
+ return !eventSource.latestFetchId;
8017
+ }
8018
+ return !context.options.lazyFetching ||
8019
+ !eventSource.fetchRange ||
8020
+ eventSource.isFetching || // always cancel outdated in-progress fetches
8021
+ fetchRange.start < eventSource.fetchRange.start ||
8022
+ fetchRange.end > eventSource.fetchRange.end;
8023
+ }
8024
+ function fetchSourcesByIds(prevSources, sourceIdHash, fetchRange, isRefetch, context) {
8025
+ let nextSources = {};
8026
+ for (let sourceId in prevSources) {
8027
+ let source = prevSources[sourceId];
8028
+ if (sourceIdHash[sourceId]) {
8029
+ nextSources[sourceId] = fetchSource(source, fetchRange, isRefetch, context);
8030
+ }
8031
+ else {
8032
+ nextSources[sourceId] = source;
8033
+ }
8034
+ }
8035
+ return nextSources;
8036
+ }
8037
+ function fetchSource(eventSource, fetchRange, isRefetch, context) {
8038
+ let { options, calendarApi } = context;
8039
+ let sourceDef = context.pluginHooks.eventSourceDefs[eventSource.sourceDefId];
8040
+ let fetchId = guid();
8041
+ sourceDef.fetch({
8042
+ eventSource,
8043
+ range: fetchRange,
8044
+ isRefetch,
8045
+ context,
8046
+ }, (res) => {
8047
+ let { rawEvents } = res;
8048
+ if (options.eventSourceSuccess) {
8049
+ rawEvents = options.eventSourceSuccess.call(calendarApi, rawEvents, res.response) || rawEvents;
8050
+ }
8051
+ if (eventSource.success) {
8052
+ rawEvents = eventSource.success.call(calendarApi, rawEvents, res.response) || rawEvents;
8053
+ }
8054
+ context.dispatch({
8055
+ type: 'RECEIVE_EVENTS',
8056
+ sourceId: eventSource.sourceId,
8057
+ fetchId,
8058
+ fetchRange,
8059
+ rawEvents,
8060
+ });
8061
+ }, (error) => {
8062
+ let errorHandled = false;
8063
+ if (options.eventSourceFailure) {
8064
+ options.eventSourceFailure.call(calendarApi, error);
8065
+ errorHandled = true;
8066
+ }
8067
+ if (eventSource.failure) {
8068
+ eventSource.failure(error);
8069
+ errorHandled = true;
8070
+ }
8071
+ if (!errorHandled) {
8072
+ console.warn(error.message, error);
8073
+ }
8074
+ context.dispatch({
8075
+ type: 'RECEIVE_EVENT_ERROR',
8076
+ sourceId: eventSource.sourceId,
8077
+ fetchId,
8078
+ fetchRange,
8079
+ error,
8080
+ });
8081
+ });
8082
+ return Object.assign(Object.assign({}, eventSource), { isFetching: true, latestFetchId: fetchId });
8083
+ }
8084
+ function receiveResponse(sourceHash, sourceId, fetchId, fetchRange) {
8085
+ let eventSource = sourceHash[sourceId];
8086
+ if (eventSource && // not already removed
8087
+ fetchId === eventSource.latestFetchId) {
8088
+ return Object.assign(Object.assign({}, sourceHash), { [sourceId]: Object.assign(Object.assign({}, eventSource), { isFetching: false, fetchRange }) });
8089
+ }
8090
+ return sourceHash;
8091
+ }
8092
+ function excludeStaticSources(eventSources, context) {
8093
+ return filterHash(eventSources, (eventSource) => doesSourceNeedRange(eventSource, context));
8094
+ }
8095
+ function parseInitialSources(rawOptions, context) {
8096
+ let refiners = buildEventSourceRefiners(context);
8097
+ let rawSources = [].concat(rawOptions.eventSources || []);
8098
+ let sources = []; // parsed
8099
+ if (rawOptions.initialEvents) {
8100
+ rawSources.unshift(rawOptions.initialEvents);
8101
+ }
8102
+ if (rawOptions.events) {
8103
+ rawSources.unshift(rawOptions.events);
8104
+ }
8105
+ for (let rawSource of rawSources) {
8106
+ let source = parseEventSource(rawSource, context, refiners);
8107
+ if (source) {
8108
+ sources.push(source);
8109
+ }
8110
+ }
8111
+ return sources;
8112
+ }
8113
+ function doesSourceNeedRange(eventSource, context) {
8114
+ let defs = context.pluginHooks.eventSourceDefs;
8115
+ return !defs[eventSource.sourceDefId].ignoreRange;
8116
+ }
8117
+
8371
8118
  function reduceDateSelection(currentSelection, action) {
8372
8119
  switch (action.type) {
8373
8120
  case 'UNSELECT_DATES':
@@ -8553,6 +8300,257 @@ var FullCalendar = (function (exports) {
8553
8300
  }
8554
8301
  }
8555
8302
 
8303
+ let eventSourceDef$2 = {
8304
+ ignoreRange: true,
8305
+ parseMeta(refined) {
8306
+ if (Array.isArray(refined.events)) {
8307
+ return refined.events;
8308
+ }
8309
+ return null;
8310
+ },
8311
+ fetch(arg, successCallback) {
8312
+ successCallback({
8313
+ rawEvents: arg.eventSource.meta,
8314
+ });
8315
+ },
8316
+ };
8317
+ const arrayEventSourcePlugin = createPlugin({
8318
+ name: 'array-event-source',
8319
+ eventSourceDefs: [eventSourceDef$2],
8320
+ });
8321
+
8322
+ let eventSourceDef$1 = {
8323
+ parseMeta(refined) {
8324
+ if (typeof refined.events === 'function') {
8325
+ return refined.events;
8326
+ }
8327
+ return null;
8328
+ },
8329
+ fetch(arg, successCallback, errorCallback) {
8330
+ const { dateEnv } = arg.context;
8331
+ const func = arg.eventSource.meta;
8332
+ unpromisify(func.bind(null, buildRangeApiWithTimeZone(arg.range, dateEnv)), (rawEvents) => successCallback({ rawEvents }), errorCallback);
8333
+ },
8334
+ };
8335
+ const funcEventSourcePlugin = createPlugin({
8336
+ name: 'func-event-source',
8337
+ eventSourceDefs: [eventSourceDef$1],
8338
+ });
8339
+
8340
+ const JSON_FEED_EVENT_SOURCE_REFINERS = {
8341
+ method: String,
8342
+ extraParams: identity,
8343
+ startParam: String,
8344
+ endParam: String,
8345
+ timeZoneParam: String,
8346
+ };
8347
+
8348
+ let eventSourceDef = {
8349
+ parseMeta(refined) {
8350
+ if (refined.url && (refined.format === 'json' || !refined.format)) {
8351
+ return {
8352
+ url: refined.url,
8353
+ format: 'json',
8354
+ method: (refined.method || 'GET').toUpperCase(),
8355
+ extraParams: refined.extraParams,
8356
+ startParam: refined.startParam,
8357
+ endParam: refined.endParam,
8358
+ timeZoneParam: refined.timeZoneParam,
8359
+ };
8360
+ }
8361
+ return null;
8362
+ },
8363
+ fetch(arg, successCallback, errorCallback) {
8364
+ const { meta } = arg.eventSource;
8365
+ const requestParams = buildRequestParams(meta, arg.range, arg.context);
8366
+ requestJson(meta.method, meta.url, requestParams).then(([rawEvents, response]) => {
8367
+ successCallback({ rawEvents, response });
8368
+ }, errorCallback);
8369
+ },
8370
+ };
8371
+ const jsonFeedEventSourcePlugin = createPlugin({
8372
+ name: 'json-event-source',
8373
+ eventSourceRefiners: JSON_FEED_EVENT_SOURCE_REFINERS,
8374
+ eventSourceDefs: [eventSourceDef],
8375
+ });
8376
+ function buildRequestParams(meta, range, context) {
8377
+ let { dateEnv, options } = context;
8378
+ let startParam;
8379
+ let endParam;
8380
+ let timeZoneParam;
8381
+ let customRequestParams;
8382
+ let params = {};
8383
+ startParam = meta.startParam;
8384
+ if (startParam == null) {
8385
+ startParam = options.startParam;
8386
+ }
8387
+ endParam = meta.endParam;
8388
+ if (endParam == null) {
8389
+ endParam = options.endParam;
8390
+ }
8391
+ timeZoneParam = meta.timeZoneParam;
8392
+ if (timeZoneParam == null) {
8393
+ timeZoneParam = options.timeZoneParam;
8394
+ }
8395
+ // retrieve any outbound GET/POST data from the options
8396
+ if (typeof meta.extraParams === 'function') {
8397
+ // supplied as a function that returns a key/value object
8398
+ customRequestParams = meta.extraParams();
8399
+ }
8400
+ else {
8401
+ // probably supplied as a straight key/value object
8402
+ customRequestParams = meta.extraParams || {};
8403
+ }
8404
+ Object.assign(params, customRequestParams);
8405
+ params[startParam] = dateEnv.formatIso(range.start);
8406
+ params[endParam] = dateEnv.formatIso(range.end);
8407
+ if (dateEnv.timeZone !== 'local') {
8408
+ params[timeZoneParam] = dateEnv.timeZone;
8409
+ }
8410
+ return params;
8411
+ }
8412
+
8413
+ const SIMPLE_RECURRING_REFINERS = {
8414
+ daysOfWeek: identity,
8415
+ startTime: createDuration,
8416
+ endTime: createDuration,
8417
+ duration: createDuration,
8418
+ startRecur: identity,
8419
+ endRecur: identity,
8420
+ };
8421
+
8422
+ let recurring = {
8423
+ parse(refined, dateEnv) {
8424
+ if (refined.daysOfWeek || refined.startTime || refined.endTime || refined.startRecur || refined.endRecur) {
8425
+ let recurringData = {
8426
+ daysOfWeek: refined.daysOfWeek || null,
8427
+ startTime: refined.startTime || null,
8428
+ endTime: refined.endTime || null,
8429
+ startRecur: refined.startRecur ? dateEnv.createMarker(refined.startRecur) : null,
8430
+ endRecur: refined.endRecur ? dateEnv.createMarker(refined.endRecur) : null,
8431
+ };
8432
+ let duration;
8433
+ if (refined.duration) {
8434
+ duration = refined.duration;
8435
+ }
8436
+ if (!duration && refined.startTime && refined.endTime) {
8437
+ duration = subtractDurations(refined.endTime, refined.startTime);
8438
+ }
8439
+ return {
8440
+ allDayGuess: Boolean(!refined.startTime && !refined.endTime),
8441
+ duration,
8442
+ typeData: recurringData, // doesn't need endTime anymore but oh well
8443
+ };
8444
+ }
8445
+ return null;
8446
+ },
8447
+ expand(typeData, framingRange, dateEnv) {
8448
+ let clippedFramingRange = intersectRanges(framingRange, { start: typeData.startRecur, end: typeData.endRecur });
8449
+ if (clippedFramingRange) {
8450
+ return expandRanges(typeData.daysOfWeek, typeData.startTime, clippedFramingRange, dateEnv);
8451
+ }
8452
+ return [];
8453
+ },
8454
+ };
8455
+ const simpleRecurringEventsPlugin = createPlugin({
8456
+ name: 'simple-recurring-event',
8457
+ recurringTypes: [recurring],
8458
+ eventRefiners: SIMPLE_RECURRING_REFINERS,
8459
+ });
8460
+ function expandRanges(daysOfWeek, startTime, framingRange, dateEnv) {
8461
+ let dowHash = daysOfWeek ? arrayToHash(daysOfWeek) : null;
8462
+ let dayMarker = startOfDay(framingRange.start);
8463
+ let endMarker = framingRange.end;
8464
+ let instanceStarts = [];
8465
+ while (dayMarker < endMarker) {
8466
+ let instanceStart;
8467
+ // if everyday, or this particular day-of-week
8468
+ if (!dowHash || dowHash[dayMarker.getUTCDay()]) {
8469
+ if (startTime) {
8470
+ instanceStart = dateEnv.add(dayMarker, startTime);
8471
+ }
8472
+ else {
8473
+ instanceStart = dayMarker;
8474
+ }
8475
+ instanceStarts.push(instanceStart);
8476
+ }
8477
+ dayMarker = addDays(dayMarker, 1);
8478
+ }
8479
+ return instanceStarts;
8480
+ }
8481
+
8482
+ const changeHandlerPlugin = createPlugin({
8483
+ name: 'change-handler',
8484
+ optionChangeHandlers: {
8485
+ events(events, context) {
8486
+ handleEventSources([events], context);
8487
+ },
8488
+ eventSources: handleEventSources,
8489
+ },
8490
+ });
8491
+ /*
8492
+ BUG: if `event` was supplied, all previously-given `eventSources` will be wiped out
8493
+ */
8494
+ function handleEventSources(inputs, context) {
8495
+ let unfoundSources = hashValuesToArray(context.getCurrentData().eventSources);
8496
+ let newInputs = [];
8497
+ for (let input of inputs) {
8498
+ let inputFound = false;
8499
+ for (let i = 0; i < unfoundSources.length; i += 1) {
8500
+ if (unfoundSources[i]._raw === input) {
8501
+ unfoundSources.splice(i, 1); // delete
8502
+ inputFound = true;
8503
+ break;
8504
+ }
8505
+ }
8506
+ if (!inputFound) {
8507
+ newInputs.push(input);
8508
+ }
8509
+ }
8510
+ for (let unfoundSource of unfoundSources) {
8511
+ context.dispatch({
8512
+ type: 'REMOVE_EVENT_SOURCE',
8513
+ sourceId: unfoundSource.sourceId,
8514
+ });
8515
+ }
8516
+ for (let newInput of newInputs) {
8517
+ context.calendarApi.addEventSource(newInput);
8518
+ }
8519
+ }
8520
+
8521
+ function handleDateProfile(dateProfile, context) {
8522
+ context.emitter.trigger('datesSet', Object.assign(Object.assign({}, buildRangeApiWithTimeZone(dateProfile.activeRange, context.dateEnv)), { view: context.viewApi }));
8523
+ }
8524
+
8525
+ function handleEventStore(eventStore, context) {
8526
+ let { emitter } = context;
8527
+ if (emitter.hasHandlers('eventsSet')) {
8528
+ emitter.trigger('eventsSet', buildEventApis(eventStore, context));
8529
+ }
8530
+ }
8531
+
8532
+ /*
8533
+ this array is exposed on the root namespace so that UMD plugins can add to it.
8534
+ see the rollup-bundles script.
8535
+ */
8536
+ const globalPlugins = [
8537
+ arrayEventSourcePlugin,
8538
+ funcEventSourcePlugin,
8539
+ jsonFeedEventSourcePlugin,
8540
+ simpleRecurringEventsPlugin,
8541
+ changeHandlerPlugin,
8542
+ createPlugin({
8543
+ name: 'misc',
8544
+ isLoadingFuncs: [
8545
+ (state) => computeEventSourcesLoading(state.eventSources),
8546
+ ],
8547
+ propSetHandlers: {
8548
+ dateProfile: handleDateProfile,
8549
+ eventStore: handleEventStore,
8550
+ },
8551
+ }),
8552
+ ];
8553
+
8556
8554
  class TaskRunner {
8557
8555
  constructor(runTaskOption, drainedOption) {
8558
8556
  this.runTaskOption = runTaskOption;
@@ -9571,7 +9569,7 @@ var FullCalendar = (function (exports) {
9571
9569
  return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;
9572
9570
  }
9573
9571
 
9574
- const version = '6.0.0';
9572
+ const version = '6.0.1';
9575
9573
 
9576
9574
  config.touchMouseIgnoreWait = 500;
9577
9575
  let ignoreMouseDepth = 0;
@@ -14031,6 +14029,8 @@ var FullCalendar = (function (exports) {
14031
14029
  exports.createPlugin = createPlugin;
14032
14030
  exports.formatDate = formatDate;
14033
14031
  exports.formatRange = formatRange;
14032
+ exports.globalLocales = globalLocales;
14033
+ exports.globalPlugins = globalPlugins;
14034
14034
  exports.sliceEvents = sliceEvents;
14035
14035
  exports.version = version;
14036
14036