@fullcalendar/core 6.0.0 → 6.0.2
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 +587 -9
- package/index.d.ts +7 -3
- package/index.global.js +786 -771
- package/index.global.min.js +2 -2
- package/index.js +580 -4
- package/index.js.map +1 -0
- package/internal-common.cjs +23 -586
- package/internal-common.d.ts +4 -5
- package/internal-common.js +18 -579
- package/internal-common.js.map +1 -0
- package/internal.cjs +0 -2
- package/internal.d.ts +1 -1
- package/internal.js +1 -1
- package/internal.js.map +1 -0
- package/locales/af.global.js +4 -4
- package/locales/af.global.min.js +2 -2
- package/locales/af.js.map +1 -0
- package/locales/ar-dz.global.js +4 -4
- package/locales/ar-dz.global.min.js +2 -2
- package/locales/ar-dz.js.map +1 -0
- package/locales/ar-kw.global.js +4 -4
- package/locales/ar-kw.global.min.js +2 -2
- package/locales/ar-kw.js.map +1 -0
- package/locales/ar-ly.global.js +4 -4
- package/locales/ar-ly.global.min.js +2 -2
- package/locales/ar-ly.js.map +1 -0
- package/locales/ar-ma.global.js +4 -4
- package/locales/ar-ma.global.min.js +2 -2
- package/locales/ar-ma.js.map +1 -0
- package/locales/ar-sa.global.js +4 -4
- package/locales/ar-sa.global.min.js +2 -2
- package/locales/ar-sa.js.map +1 -0
- package/locales/ar-tn.global.js +4 -4
- package/locales/ar-tn.global.min.js +2 -2
- package/locales/ar-tn.js.map +1 -0
- package/locales/ar.global.js +4 -4
- package/locales/ar.global.min.js +2 -2
- package/locales/ar.js.map +1 -0
- package/locales/az.global.js +4 -4
- package/locales/az.global.min.js +2 -2
- package/locales/az.js.map +1 -0
- package/locales/bg.global.js +4 -4
- package/locales/bg.global.min.js +2 -2
- package/locales/bg.js.map +1 -0
- package/locales/bn.global.js +4 -4
- package/locales/bn.global.min.js +2 -2
- package/locales/bn.js.map +1 -0
- package/locales/bs.global.js +4 -4
- package/locales/bs.global.min.js +2 -2
- package/locales/bs.js.map +1 -0
- package/locales/ca.global.js +4 -4
- package/locales/ca.global.min.js +2 -2
- package/locales/ca.js.map +1 -0
- package/locales/cs.global.js +4 -4
- package/locales/cs.global.min.js +2 -2
- package/locales/cs.js.map +1 -0
- package/locales/cy.global.js +4 -4
- package/locales/cy.global.min.js +2 -2
- package/locales/cy.js.map +1 -0
- package/locales/da.global.js +4 -4
- package/locales/da.global.min.js +2 -2
- package/locales/da.js.map +1 -0
- package/locales/de-at.global.js +4 -4
- package/locales/de-at.global.min.js +2 -2
- package/locales/de-at.js.map +1 -0
- package/locales/de.global.js +4 -4
- package/locales/de.global.min.js +2 -2
- package/locales/de.js.map +1 -0
- package/locales/el.global.js +4 -4
- package/locales/el.global.min.js +2 -2
- package/locales/el.js.map +1 -0
- package/locales/en-au.global.js +4 -4
- package/locales/en-au.global.min.js +2 -2
- package/locales/en-au.js.map +1 -0
- package/locales/en-gb.global.js +4 -4
- package/locales/en-gb.global.min.js +2 -2
- package/locales/en-gb.js.map +1 -0
- package/locales/en-nz.global.js +4 -4
- package/locales/en-nz.global.min.js +2 -2
- package/locales/en-nz.js.map +1 -0
- package/locales/eo.global.js +4 -4
- package/locales/eo.global.min.js +2 -2
- package/locales/eo.js.map +1 -0
- package/locales/es-us.global.js +4 -4
- package/locales/es-us.global.min.js +2 -2
- package/locales/es-us.js.map +1 -0
- package/locales/es.global.js +4 -4
- package/locales/es.global.min.js +2 -2
- package/locales/es.js.map +1 -0
- package/locales/et.global.js +4 -4
- package/locales/et.global.min.js +2 -2
- package/locales/et.js.map +1 -0
- package/locales/eu.global.js +4 -4
- package/locales/eu.global.min.js +2 -2
- package/locales/eu.js.map +1 -0
- package/locales/fa.global.js +4 -4
- package/locales/fa.global.min.js +2 -2
- package/locales/fa.js.map +1 -0
- package/locales/fi.global.js +4 -4
- package/locales/fi.global.min.js +2 -2
- package/locales/fi.js.map +1 -0
- package/locales/fr-ca.global.js +4 -4
- package/locales/fr-ca.global.min.js +2 -2
- package/locales/fr-ca.js.map +1 -0
- package/locales/fr-ch.global.js +4 -4
- package/locales/fr-ch.global.min.js +2 -2
- package/locales/fr-ch.js.map +1 -0
- package/locales/fr.global.js +4 -4
- package/locales/fr.global.min.js +2 -2
- package/locales/fr.js.map +1 -0
- package/locales/gl.global.js +4 -4
- package/locales/gl.global.min.js +2 -2
- package/locales/gl.js.map +1 -0
- package/locales/he.global.js +4 -4
- package/locales/he.global.min.js +2 -2
- package/locales/he.js.map +1 -0
- package/locales/hi.global.js +4 -4
- package/locales/hi.global.min.js +2 -2
- package/locales/hi.js.map +1 -0
- package/locales/hr.global.js +4 -4
- package/locales/hr.global.min.js +2 -2
- package/locales/hr.js.map +1 -0
- package/locales/hu.global.js +4 -4
- package/locales/hu.global.min.js +2 -2
- package/locales/hu.js.map +1 -0
- package/locales/hy-am.global.js +4 -4
- package/locales/hy-am.global.min.js +2 -2
- package/locales/hy-am.js.map +1 -0
- package/locales/id.global.js +4 -4
- package/locales/id.global.min.js +2 -2
- package/locales/id.js.map +1 -0
- package/locales/is.global.js +4 -4
- package/locales/is.global.min.js +2 -2
- package/locales/is.js.map +1 -0
- package/locales/it.global.js +4 -4
- package/locales/it.global.min.js +2 -2
- package/locales/it.js.map +1 -0
- package/locales/ja.global.js +4 -4
- package/locales/ja.global.min.js +2 -2
- package/locales/ja.js.map +1 -0
- package/locales/ka.global.js +4 -4
- package/locales/ka.global.min.js +2 -2
- package/locales/ka.js.map +1 -0
- package/locales/kk.global.js +4 -4
- package/locales/kk.global.min.js +2 -2
- package/locales/kk.js.map +1 -0
- package/locales/km.global.js +4 -4
- package/locales/km.global.min.js +2 -2
- package/locales/km.js.map +1 -0
- package/locales/ko.global.js +4 -4
- package/locales/ko.global.min.js +2 -2
- package/locales/ko.js.map +1 -0
- package/locales/ku.global.js +4 -4
- package/locales/ku.global.min.js +2 -2
- package/locales/ku.js.map +1 -0
- package/locales/lb.global.js +4 -4
- package/locales/lb.global.min.js +2 -2
- package/locales/lb.js.map +1 -0
- package/locales/lt.global.js +4 -4
- package/locales/lt.global.min.js +2 -2
- package/locales/lt.js.map +1 -0
- package/locales/lv.global.js +4 -4
- package/locales/lv.global.min.js +2 -2
- package/locales/lv.js.map +1 -0
- package/locales/mk.global.js +4 -4
- package/locales/mk.global.min.js +2 -2
- package/locales/mk.js.map +1 -0
- package/locales/ms.global.js +4 -4
- package/locales/ms.global.min.js +2 -2
- package/locales/ms.js.map +1 -0
- package/locales/nb.global.js +4 -4
- package/locales/nb.global.min.js +2 -2
- package/locales/nb.js.map +1 -0
- package/locales/ne.global.js +4 -4
- package/locales/ne.global.min.js +2 -2
- package/locales/ne.js.map +1 -0
- package/locales/nl.global.js +4 -4
- package/locales/nl.global.min.js +2 -2
- package/locales/nl.js.map +1 -0
- package/locales/nn.global.js +4 -4
- package/locales/nn.global.min.js +2 -2
- package/locales/nn.js.map +1 -0
- package/locales/pl.global.js +4 -4
- package/locales/pl.global.min.js +2 -2
- package/locales/pl.js.map +1 -0
- package/locales/pt-br.global.js +4 -4
- package/locales/pt-br.global.min.js +2 -2
- package/locales/pt-br.js.map +1 -0
- package/locales/pt.global.js +4 -4
- package/locales/pt.global.min.js +2 -2
- package/locales/pt.js.map +1 -0
- package/locales/ro.global.js +4 -4
- package/locales/ro.global.min.js +2 -2
- package/locales/ro.js.map +1 -0
- package/locales/ru.global.js +4 -4
- package/locales/ru.global.min.js +2 -2
- package/locales/ru.js.map +1 -0
- package/locales/si-lk.global.js +4 -4
- package/locales/si-lk.global.min.js +2 -2
- package/locales/si-lk.js.map +1 -0
- package/locales/sk.global.js +4 -4
- package/locales/sk.global.min.js +2 -2
- package/locales/sk.js.map +1 -0
- package/locales/sl.global.js +4 -4
- package/locales/sl.global.min.js +2 -2
- package/locales/sl.js.map +1 -0
- package/locales/sm.global.js +4 -4
- package/locales/sm.global.min.js +2 -2
- package/locales/sm.js.map +1 -0
- package/locales/sq.global.js +4 -4
- package/locales/sq.global.min.js +2 -2
- package/locales/sq.js.map +1 -0
- package/locales/sr-cyrl.global.js +4 -4
- package/locales/sr-cyrl.global.min.js +2 -2
- package/locales/sr-cyrl.js.map +1 -0
- package/locales/sr.global.js +4 -4
- package/locales/sr.global.min.js +2 -2
- package/locales/sr.js.map +1 -0
- package/locales/sv.global.js +4 -4
- package/locales/sv.global.min.js +2 -2
- package/locales/sv.js.map +1 -0
- package/locales/ta-in.global.js +4 -4
- package/locales/ta-in.global.min.js +2 -2
- package/locales/ta-in.js.map +1 -0
- package/locales/th.global.js +4 -4
- package/locales/th.global.min.js +2 -2
- package/locales/th.js.map +1 -0
- package/locales/tr.global.js +4 -4
- package/locales/tr.global.min.js +2 -2
- package/locales/tr.js.map +1 -0
- package/locales/ug.global.js +4 -4
- package/locales/ug.global.min.js +2 -2
- package/locales/ug.js.map +1 -0
- package/locales/uk.global.js +4 -4
- package/locales/uk.global.min.js +2 -2
- package/locales/uk.js.map +1 -0
- package/locales/uz.global.js +4 -4
- package/locales/uz.global.min.js +2 -2
- package/locales/uz.js.map +1 -0
- package/locales/vi.global.js +4 -4
- package/locales/vi.global.min.js +2 -2
- package/locales/vi.js.map +1 -0
- package/locales/zh-cn.global.js +4 -4
- package/locales/zh-cn.global.min.js +2 -2
- package/locales/zh-cn.js.map +1 -0
- package/locales/zh-tw.global.js +4 -4
- package/locales/zh-tw.global.min.js +2 -2
- package/locales/zh-tw.js.map +1 -0
- package/locales-all.global.js +4 -4
- package/locales-all.global.min.js +2 -2
- package/locales-all.js.map +1 -0
- package/package.json +1 -1
- package/preact.js +1 -1
- package/preact.js.map +1 -0
package/internal-common.js
CHANGED
|
@@ -179,6 +179,16 @@ function isPropsEqual(obj0, obj1) {
|
|
|
179
179
|
}
|
|
180
180
|
return true;
|
|
181
181
|
}
|
|
182
|
+
const HANDLER_RE = /^on[A-Z]/;
|
|
183
|
+
function isNonHandlerPropsEqual(obj0, obj1) {
|
|
184
|
+
const keys = getUnequalProps(obj0, obj1);
|
|
185
|
+
for (let key of keys) {
|
|
186
|
+
if (!HANDLER_RE.test(key)) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
182
192
|
function getUnequalProps(obj0, obj1) {
|
|
183
193
|
let keys = [];
|
|
184
194
|
for (let key in obj0) {
|
|
@@ -241,8 +251,6 @@ function collectFromHash(hash, startIndex = 0, endIndex, step = 1) {
|
|
|
241
251
|
return res;
|
|
242
252
|
}
|
|
243
253
|
|
|
244
|
-
const globalLocales = [];
|
|
245
|
-
|
|
246
254
|
// TODO: new util arrayify?
|
|
247
255
|
function removeExact(array, exactVal) {
|
|
248
256
|
let removeCnt = 0;
|
|
@@ -679,165 +687,6 @@ function computeSmallestCellWidth(cellEl) {
|
|
|
679
687
|
contentWidthEl.getBoundingClientRect().width;
|
|
680
688
|
}
|
|
681
689
|
|
|
682
|
-
// TODO: easier way to add new hooks? need to update a million things
|
|
683
|
-
function createPlugin(input) {
|
|
684
|
-
return {
|
|
685
|
-
id: guid(),
|
|
686
|
-
name: input.name,
|
|
687
|
-
premiumReleaseDate: input.premiumReleaseDate ? new Date(input.premiumReleaseDate) : undefined,
|
|
688
|
-
deps: input.deps || [],
|
|
689
|
-
reducers: input.reducers || [],
|
|
690
|
-
isLoadingFuncs: input.isLoadingFuncs || [],
|
|
691
|
-
contextInit: [].concat(input.contextInit || []),
|
|
692
|
-
eventRefiners: input.eventRefiners || {},
|
|
693
|
-
eventDefMemberAdders: input.eventDefMemberAdders || [],
|
|
694
|
-
eventSourceRefiners: input.eventSourceRefiners || {},
|
|
695
|
-
isDraggableTransformers: input.isDraggableTransformers || [],
|
|
696
|
-
eventDragMutationMassagers: input.eventDragMutationMassagers || [],
|
|
697
|
-
eventDefMutationAppliers: input.eventDefMutationAppliers || [],
|
|
698
|
-
dateSelectionTransformers: input.dateSelectionTransformers || [],
|
|
699
|
-
datePointTransforms: input.datePointTransforms || [],
|
|
700
|
-
dateSpanTransforms: input.dateSpanTransforms || [],
|
|
701
|
-
views: input.views || {},
|
|
702
|
-
viewPropsTransformers: input.viewPropsTransformers || [],
|
|
703
|
-
isPropsValid: input.isPropsValid || null,
|
|
704
|
-
externalDefTransforms: input.externalDefTransforms || [],
|
|
705
|
-
viewContainerAppends: input.viewContainerAppends || [],
|
|
706
|
-
eventDropTransformers: input.eventDropTransformers || [],
|
|
707
|
-
componentInteractions: input.componentInteractions || [],
|
|
708
|
-
calendarInteractions: input.calendarInteractions || [],
|
|
709
|
-
themeClasses: input.themeClasses || {},
|
|
710
|
-
eventSourceDefs: input.eventSourceDefs || [],
|
|
711
|
-
cmdFormatter: input.cmdFormatter,
|
|
712
|
-
recurringTypes: input.recurringTypes || [],
|
|
713
|
-
namedTimeZonedImpl: input.namedTimeZonedImpl,
|
|
714
|
-
initialView: input.initialView || '',
|
|
715
|
-
elementDraggingImpl: input.elementDraggingImpl,
|
|
716
|
-
optionChangeHandlers: input.optionChangeHandlers || {},
|
|
717
|
-
scrollGridImpl: input.scrollGridImpl || null,
|
|
718
|
-
listenerRefiners: input.listenerRefiners || {},
|
|
719
|
-
optionRefiners: input.optionRefiners || {},
|
|
720
|
-
propSetHandlers: input.propSetHandlers || {},
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
function buildPluginHooks(pluginDefs, globalDefs) {
|
|
724
|
-
let currentPluginIds = {};
|
|
725
|
-
let hooks = {
|
|
726
|
-
premiumReleaseDate: undefined,
|
|
727
|
-
reducers: [],
|
|
728
|
-
isLoadingFuncs: [],
|
|
729
|
-
contextInit: [],
|
|
730
|
-
eventRefiners: {},
|
|
731
|
-
eventDefMemberAdders: [],
|
|
732
|
-
eventSourceRefiners: {},
|
|
733
|
-
isDraggableTransformers: [],
|
|
734
|
-
eventDragMutationMassagers: [],
|
|
735
|
-
eventDefMutationAppliers: [],
|
|
736
|
-
dateSelectionTransformers: [],
|
|
737
|
-
datePointTransforms: [],
|
|
738
|
-
dateSpanTransforms: [],
|
|
739
|
-
views: {},
|
|
740
|
-
viewPropsTransformers: [],
|
|
741
|
-
isPropsValid: null,
|
|
742
|
-
externalDefTransforms: [],
|
|
743
|
-
viewContainerAppends: [],
|
|
744
|
-
eventDropTransformers: [],
|
|
745
|
-
componentInteractions: [],
|
|
746
|
-
calendarInteractions: [],
|
|
747
|
-
themeClasses: {},
|
|
748
|
-
eventSourceDefs: [],
|
|
749
|
-
cmdFormatter: null,
|
|
750
|
-
recurringTypes: [],
|
|
751
|
-
namedTimeZonedImpl: null,
|
|
752
|
-
initialView: '',
|
|
753
|
-
elementDraggingImpl: null,
|
|
754
|
-
optionChangeHandlers: {},
|
|
755
|
-
scrollGridImpl: null,
|
|
756
|
-
listenerRefiners: {},
|
|
757
|
-
optionRefiners: {},
|
|
758
|
-
propSetHandlers: {},
|
|
759
|
-
};
|
|
760
|
-
function addDefs(defs) {
|
|
761
|
-
for (let def of defs) {
|
|
762
|
-
const pluginName = def.name;
|
|
763
|
-
const currentId = currentPluginIds[pluginName];
|
|
764
|
-
if (currentId === undefined) {
|
|
765
|
-
currentPluginIds[pluginName] = def.id;
|
|
766
|
-
addDefs(def.deps);
|
|
767
|
-
hooks = combineHooks(hooks, def);
|
|
768
|
-
}
|
|
769
|
-
else if (currentId !== def.id) {
|
|
770
|
-
// different ID than the one already added
|
|
771
|
-
console.warn(`Duplicate plugin '${pluginName}'`);
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
if (pluginDefs) {
|
|
776
|
-
addDefs(pluginDefs);
|
|
777
|
-
}
|
|
778
|
-
addDefs(globalDefs);
|
|
779
|
-
return hooks;
|
|
780
|
-
}
|
|
781
|
-
function buildBuildPluginHooks() {
|
|
782
|
-
let currentOverrideDefs = [];
|
|
783
|
-
let currentGlobalDefs = [];
|
|
784
|
-
let currentHooks;
|
|
785
|
-
return (overrideDefs, globalDefs) => {
|
|
786
|
-
if (!currentHooks || !isArraysEqual(overrideDefs, currentOverrideDefs) || !isArraysEqual(globalDefs, currentGlobalDefs)) {
|
|
787
|
-
currentHooks = buildPluginHooks(overrideDefs, globalDefs);
|
|
788
|
-
}
|
|
789
|
-
currentOverrideDefs = overrideDefs;
|
|
790
|
-
currentGlobalDefs = globalDefs;
|
|
791
|
-
return currentHooks;
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
function combineHooks(hooks0, hooks1) {
|
|
795
|
-
return {
|
|
796
|
-
premiumReleaseDate: compareOptionalDates(hooks0.premiumReleaseDate, hooks1.premiumReleaseDate),
|
|
797
|
-
reducers: hooks0.reducers.concat(hooks1.reducers),
|
|
798
|
-
isLoadingFuncs: hooks0.isLoadingFuncs.concat(hooks1.isLoadingFuncs),
|
|
799
|
-
contextInit: hooks0.contextInit.concat(hooks1.contextInit),
|
|
800
|
-
eventRefiners: Object.assign(Object.assign({}, hooks0.eventRefiners), hooks1.eventRefiners),
|
|
801
|
-
eventDefMemberAdders: hooks0.eventDefMemberAdders.concat(hooks1.eventDefMemberAdders),
|
|
802
|
-
eventSourceRefiners: Object.assign(Object.assign({}, hooks0.eventSourceRefiners), hooks1.eventSourceRefiners),
|
|
803
|
-
isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers),
|
|
804
|
-
eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers),
|
|
805
|
-
eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers),
|
|
806
|
-
dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers),
|
|
807
|
-
datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms),
|
|
808
|
-
dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms),
|
|
809
|
-
views: Object.assign(Object.assign({}, hooks0.views), hooks1.views),
|
|
810
|
-
viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers),
|
|
811
|
-
isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid,
|
|
812
|
-
externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms),
|
|
813
|
-
viewContainerAppends: hooks0.viewContainerAppends.concat(hooks1.viewContainerAppends),
|
|
814
|
-
eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),
|
|
815
|
-
calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),
|
|
816
|
-
componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),
|
|
817
|
-
themeClasses: Object.assign(Object.assign({}, hooks0.themeClasses), hooks1.themeClasses),
|
|
818
|
-
eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs),
|
|
819
|
-
cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter,
|
|
820
|
-
recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes),
|
|
821
|
-
namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl,
|
|
822
|
-
initialView: hooks0.initialView || hooks1.initialView,
|
|
823
|
-
elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl,
|
|
824
|
-
optionChangeHandlers: Object.assign(Object.assign({}, hooks0.optionChangeHandlers), hooks1.optionChangeHandlers),
|
|
825
|
-
scrollGridImpl: hooks1.scrollGridImpl || hooks0.scrollGridImpl,
|
|
826
|
-
listenerRefiners: Object.assign(Object.assign({}, hooks0.listenerRefiners), hooks1.listenerRefiners),
|
|
827
|
-
optionRefiners: Object.assign(Object.assign({}, hooks0.optionRefiners), hooks1.optionRefiners),
|
|
828
|
-
propSetHandlers: Object.assign(Object.assign({}, hooks0.propSetHandlers), hooks1.propSetHandlers),
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
function compareOptionalDates(date0, date1) {
|
|
832
|
-
if (date0 === undefined) {
|
|
833
|
-
return date1;
|
|
834
|
-
}
|
|
835
|
-
if (date1 === undefined) {
|
|
836
|
-
return date0;
|
|
837
|
-
}
|
|
838
|
-
return new Date(Math.max(date0.valueOf(), date1.valueOf()));
|
|
839
|
-
}
|
|
840
|
-
|
|
841
690
|
const DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
|
842
691
|
// Adding
|
|
843
692
|
function addWeeks(m, n) {
|
|
@@ -2534,7 +2383,7 @@ class ContentInjector extends BaseComponent {
|
|
|
2534
2383
|
ContentInjector.addPropsEquality({
|
|
2535
2384
|
elClasses: isArraysEqual,
|
|
2536
2385
|
elStyle: isPropsEqual,
|
|
2537
|
-
elAttrs:
|
|
2386
|
+
elAttrs: isNonHandlerPropsEqual,
|
|
2538
2387
|
renderProps: isPropsEqual,
|
|
2539
2388
|
});
|
|
2540
2389
|
// Util
|
|
@@ -3537,170 +3386,6 @@ function buildEventSourceMeta(raw, context) {
|
|
|
3537
3386
|
return null;
|
|
3538
3387
|
}
|
|
3539
3388
|
|
|
3540
|
-
function initEventSources(calendarOptions, dateProfile, context) {
|
|
3541
|
-
let activeRange = dateProfile ? dateProfile.activeRange : null;
|
|
3542
|
-
return addSources({}, parseInitialSources(calendarOptions, context), activeRange, context);
|
|
3543
|
-
}
|
|
3544
|
-
function reduceEventSources(eventSources, action, dateProfile, context) {
|
|
3545
|
-
let activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?
|
|
3546
|
-
switch (action.type) {
|
|
3547
|
-
case 'ADD_EVENT_SOURCES': // already parsed
|
|
3548
|
-
return addSources(eventSources, action.sources, activeRange, context);
|
|
3549
|
-
case 'REMOVE_EVENT_SOURCE':
|
|
3550
|
-
return removeSource(eventSources, action.sourceId);
|
|
3551
|
-
case 'PREV': // TODO: how do we track all actions that affect dateProfile :(
|
|
3552
|
-
case 'NEXT':
|
|
3553
|
-
case 'CHANGE_DATE':
|
|
3554
|
-
case 'CHANGE_VIEW_TYPE':
|
|
3555
|
-
if (dateProfile) {
|
|
3556
|
-
return fetchDirtySources(eventSources, activeRange, context);
|
|
3557
|
-
}
|
|
3558
|
-
return eventSources;
|
|
3559
|
-
case 'FETCH_EVENT_SOURCES':
|
|
3560
|
-
return fetchSourcesByIds(eventSources, action.sourceIds ? // why no type?
|
|
3561
|
-
arrayToHash(action.sourceIds) :
|
|
3562
|
-
excludeStaticSources(eventSources, context), activeRange, action.isRefetch || false, context);
|
|
3563
|
-
case 'RECEIVE_EVENTS':
|
|
3564
|
-
case 'RECEIVE_EVENT_ERROR':
|
|
3565
|
-
return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange);
|
|
3566
|
-
case 'REMOVE_ALL_EVENT_SOURCES':
|
|
3567
|
-
return {};
|
|
3568
|
-
default:
|
|
3569
|
-
return eventSources;
|
|
3570
|
-
}
|
|
3571
|
-
}
|
|
3572
|
-
function reduceEventSourcesNewTimeZone(eventSources, dateProfile, context) {
|
|
3573
|
-
let activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?
|
|
3574
|
-
return fetchSourcesByIds(eventSources, excludeStaticSources(eventSources, context), activeRange, true, context);
|
|
3575
|
-
}
|
|
3576
|
-
function computeEventSourcesLoading(eventSources) {
|
|
3577
|
-
for (let sourceId in eventSources) {
|
|
3578
|
-
if (eventSources[sourceId].isFetching) {
|
|
3579
|
-
return true;
|
|
3580
|
-
}
|
|
3581
|
-
}
|
|
3582
|
-
return false;
|
|
3583
|
-
}
|
|
3584
|
-
function addSources(eventSourceHash, sources, fetchRange, context) {
|
|
3585
|
-
let hash = {};
|
|
3586
|
-
for (let source of sources) {
|
|
3587
|
-
hash[source.sourceId] = source;
|
|
3588
|
-
}
|
|
3589
|
-
if (fetchRange) {
|
|
3590
|
-
hash = fetchDirtySources(hash, fetchRange, context);
|
|
3591
|
-
}
|
|
3592
|
-
return Object.assign(Object.assign({}, eventSourceHash), hash);
|
|
3593
|
-
}
|
|
3594
|
-
function removeSource(eventSourceHash, sourceId) {
|
|
3595
|
-
return filterHash(eventSourceHash, (eventSource) => eventSource.sourceId !== sourceId);
|
|
3596
|
-
}
|
|
3597
|
-
function fetchDirtySources(sourceHash, fetchRange, context) {
|
|
3598
|
-
return fetchSourcesByIds(sourceHash, filterHash(sourceHash, (eventSource) => isSourceDirty(eventSource, fetchRange, context)), fetchRange, false, context);
|
|
3599
|
-
}
|
|
3600
|
-
function isSourceDirty(eventSource, fetchRange, context) {
|
|
3601
|
-
if (!doesSourceNeedRange(eventSource, context)) {
|
|
3602
|
-
return !eventSource.latestFetchId;
|
|
3603
|
-
}
|
|
3604
|
-
return !context.options.lazyFetching ||
|
|
3605
|
-
!eventSource.fetchRange ||
|
|
3606
|
-
eventSource.isFetching || // always cancel outdated in-progress fetches
|
|
3607
|
-
fetchRange.start < eventSource.fetchRange.start ||
|
|
3608
|
-
fetchRange.end > eventSource.fetchRange.end;
|
|
3609
|
-
}
|
|
3610
|
-
function fetchSourcesByIds(prevSources, sourceIdHash, fetchRange, isRefetch, context) {
|
|
3611
|
-
let nextSources = {};
|
|
3612
|
-
for (let sourceId in prevSources) {
|
|
3613
|
-
let source = prevSources[sourceId];
|
|
3614
|
-
if (sourceIdHash[sourceId]) {
|
|
3615
|
-
nextSources[sourceId] = fetchSource(source, fetchRange, isRefetch, context);
|
|
3616
|
-
}
|
|
3617
|
-
else {
|
|
3618
|
-
nextSources[sourceId] = source;
|
|
3619
|
-
}
|
|
3620
|
-
}
|
|
3621
|
-
return nextSources;
|
|
3622
|
-
}
|
|
3623
|
-
function fetchSource(eventSource, fetchRange, isRefetch, context) {
|
|
3624
|
-
let { options, calendarApi } = context;
|
|
3625
|
-
let sourceDef = context.pluginHooks.eventSourceDefs[eventSource.sourceDefId];
|
|
3626
|
-
let fetchId = guid();
|
|
3627
|
-
sourceDef.fetch({
|
|
3628
|
-
eventSource,
|
|
3629
|
-
range: fetchRange,
|
|
3630
|
-
isRefetch,
|
|
3631
|
-
context,
|
|
3632
|
-
}, (res) => {
|
|
3633
|
-
let { rawEvents } = res;
|
|
3634
|
-
if (options.eventSourceSuccess) {
|
|
3635
|
-
rawEvents = options.eventSourceSuccess.call(calendarApi, rawEvents, res.response) || rawEvents;
|
|
3636
|
-
}
|
|
3637
|
-
if (eventSource.success) {
|
|
3638
|
-
rawEvents = eventSource.success.call(calendarApi, rawEvents, res.response) || rawEvents;
|
|
3639
|
-
}
|
|
3640
|
-
context.dispatch({
|
|
3641
|
-
type: 'RECEIVE_EVENTS',
|
|
3642
|
-
sourceId: eventSource.sourceId,
|
|
3643
|
-
fetchId,
|
|
3644
|
-
fetchRange,
|
|
3645
|
-
rawEvents,
|
|
3646
|
-
});
|
|
3647
|
-
}, (error) => {
|
|
3648
|
-
let errorHandled = false;
|
|
3649
|
-
if (options.eventSourceFailure) {
|
|
3650
|
-
options.eventSourceFailure.call(calendarApi, error);
|
|
3651
|
-
errorHandled = true;
|
|
3652
|
-
}
|
|
3653
|
-
if (eventSource.failure) {
|
|
3654
|
-
eventSource.failure(error);
|
|
3655
|
-
errorHandled = true;
|
|
3656
|
-
}
|
|
3657
|
-
if (!errorHandled) {
|
|
3658
|
-
console.warn(error.message, error);
|
|
3659
|
-
}
|
|
3660
|
-
context.dispatch({
|
|
3661
|
-
type: 'RECEIVE_EVENT_ERROR',
|
|
3662
|
-
sourceId: eventSource.sourceId,
|
|
3663
|
-
fetchId,
|
|
3664
|
-
fetchRange,
|
|
3665
|
-
error,
|
|
3666
|
-
});
|
|
3667
|
-
});
|
|
3668
|
-
return Object.assign(Object.assign({}, eventSource), { isFetching: true, latestFetchId: fetchId });
|
|
3669
|
-
}
|
|
3670
|
-
function receiveResponse(sourceHash, sourceId, fetchId, fetchRange) {
|
|
3671
|
-
let eventSource = sourceHash[sourceId];
|
|
3672
|
-
if (eventSource && // not already removed
|
|
3673
|
-
fetchId === eventSource.latestFetchId) {
|
|
3674
|
-
return Object.assign(Object.assign({}, sourceHash), { [sourceId]: Object.assign(Object.assign({}, eventSource), { isFetching: false, fetchRange }) });
|
|
3675
|
-
}
|
|
3676
|
-
return sourceHash;
|
|
3677
|
-
}
|
|
3678
|
-
function excludeStaticSources(eventSources, context) {
|
|
3679
|
-
return filterHash(eventSources, (eventSource) => doesSourceNeedRange(eventSource, context));
|
|
3680
|
-
}
|
|
3681
|
-
function parseInitialSources(rawOptions, context) {
|
|
3682
|
-
let refiners = buildEventSourceRefiners(context);
|
|
3683
|
-
let rawSources = [].concat(rawOptions.eventSources || []);
|
|
3684
|
-
let sources = []; // parsed
|
|
3685
|
-
if (rawOptions.initialEvents) {
|
|
3686
|
-
rawSources.unshift(rawOptions.initialEvents);
|
|
3687
|
-
}
|
|
3688
|
-
if (rawOptions.events) {
|
|
3689
|
-
rawSources.unshift(rawOptions.events);
|
|
3690
|
-
}
|
|
3691
|
-
for (let rawSource of rawSources) {
|
|
3692
|
-
let source = parseEventSource(rawSource, context, refiners);
|
|
3693
|
-
if (source) {
|
|
3694
|
-
sources.push(source);
|
|
3695
|
-
}
|
|
3696
|
-
}
|
|
3697
|
-
return sources;
|
|
3698
|
-
}
|
|
3699
|
-
function doesSourceNeedRange(eventSource, context) {
|
|
3700
|
-
let defs = context.pluginHooks.eventSourceDefs;
|
|
3701
|
-
return !defs[eventSource.sourceDefId].ignoreRange;
|
|
3702
|
-
}
|
|
3703
|
-
|
|
3704
3389
|
function reduceEventStore(eventStore, action, eventSources, dateProfile, context) {
|
|
3705
3390
|
switch (action.type) {
|
|
3706
3391
|
case 'RECEIVE_EVENTS': // raw
|
|
@@ -3884,25 +3569,6 @@ function refineInputs(input) {
|
|
|
3884
3569
|
return rawDefs;
|
|
3885
3570
|
}
|
|
3886
3571
|
|
|
3887
|
-
let eventSourceDef$2 = {
|
|
3888
|
-
ignoreRange: true,
|
|
3889
|
-
parseMeta(refined) {
|
|
3890
|
-
if (Array.isArray(refined.events)) {
|
|
3891
|
-
return refined.events;
|
|
3892
|
-
}
|
|
3893
|
-
return null;
|
|
3894
|
-
},
|
|
3895
|
-
fetch(arg, successCallback) {
|
|
3896
|
-
successCallback({
|
|
3897
|
-
rawEvents: arg.eventSource.meta,
|
|
3898
|
-
});
|
|
3899
|
-
},
|
|
3900
|
-
};
|
|
3901
|
-
const arrayEventSourcePlugin = createPlugin({
|
|
3902
|
-
name: 'array-event-source',
|
|
3903
|
-
eventSourceDefs: [eventSourceDef$2],
|
|
3904
|
-
});
|
|
3905
|
-
|
|
3906
3572
|
function triggerDateSelect(selection, pev, context) {
|
|
3907
3573
|
context.emitter.trigger('select', Object.assign(Object.assign({}, buildDateSpanApiWithContext(selection, context)), { jsEvent: pev ? pev.origEvent : null, view: context.viewApi || context.calendarApi.view }));
|
|
3908
3574
|
}
|
|
@@ -4788,24 +4454,6 @@ function unpromisify(func, normalizedSuccessCallback, normalizedFailureCallback)
|
|
|
4788
4454
|
}
|
|
4789
4455
|
}
|
|
4790
4456
|
|
|
4791
|
-
let eventSourceDef$1 = {
|
|
4792
|
-
parseMeta(refined) {
|
|
4793
|
-
if (typeof refined.events === 'function') {
|
|
4794
|
-
return refined.events;
|
|
4795
|
-
}
|
|
4796
|
-
return null;
|
|
4797
|
-
},
|
|
4798
|
-
fetch(arg, successCallback, errorCallback) {
|
|
4799
|
-
const { dateEnv } = arg.context;
|
|
4800
|
-
const func = arg.eventSource.meta;
|
|
4801
|
-
unpromisify(func.bind(null, buildRangeApiWithTimeZone(arg.range, dateEnv)), (rawEvents) => successCallback({ rawEvents }), errorCallback);
|
|
4802
|
-
},
|
|
4803
|
-
};
|
|
4804
|
-
const funcEventSourcePlugin = createPlugin({
|
|
4805
|
-
name: 'func-event-source',
|
|
4806
|
-
eventSourceDefs: [eventSourceDef$1],
|
|
4807
|
-
});
|
|
4808
|
-
|
|
4809
4457
|
class JsonRequestError extends Error {
|
|
4810
4458
|
constructor(message, response) {
|
|
4811
4459
|
super(message);
|
|
@@ -4841,220 +4489,6 @@ function requestJson(method, url, params) {
|
|
|
4841
4489
|
});
|
|
4842
4490
|
}
|
|
4843
4491
|
|
|
4844
|
-
const JSON_FEED_EVENT_SOURCE_REFINERS = {
|
|
4845
|
-
method: String,
|
|
4846
|
-
extraParams: identity,
|
|
4847
|
-
startParam: String,
|
|
4848
|
-
endParam: String,
|
|
4849
|
-
timeZoneParam: String,
|
|
4850
|
-
};
|
|
4851
|
-
|
|
4852
|
-
let eventSourceDef = {
|
|
4853
|
-
parseMeta(refined) {
|
|
4854
|
-
if (refined.url && (refined.format === 'json' || !refined.format)) {
|
|
4855
|
-
return {
|
|
4856
|
-
url: refined.url,
|
|
4857
|
-
format: 'json',
|
|
4858
|
-
method: (refined.method || 'GET').toUpperCase(),
|
|
4859
|
-
extraParams: refined.extraParams,
|
|
4860
|
-
startParam: refined.startParam,
|
|
4861
|
-
endParam: refined.endParam,
|
|
4862
|
-
timeZoneParam: refined.timeZoneParam,
|
|
4863
|
-
};
|
|
4864
|
-
}
|
|
4865
|
-
return null;
|
|
4866
|
-
},
|
|
4867
|
-
fetch(arg, successCallback, errorCallback) {
|
|
4868
|
-
const { meta } = arg.eventSource;
|
|
4869
|
-
const requestParams = buildRequestParams(meta, arg.range, arg.context);
|
|
4870
|
-
requestJson(meta.method, meta.url, requestParams).then(([rawEvents, response]) => {
|
|
4871
|
-
successCallback({ rawEvents, response });
|
|
4872
|
-
}, errorCallback);
|
|
4873
|
-
},
|
|
4874
|
-
};
|
|
4875
|
-
const jsonFeedEventSourcePlugin = createPlugin({
|
|
4876
|
-
name: 'json-event-source',
|
|
4877
|
-
eventSourceRefiners: JSON_FEED_EVENT_SOURCE_REFINERS,
|
|
4878
|
-
eventSourceDefs: [eventSourceDef],
|
|
4879
|
-
});
|
|
4880
|
-
function buildRequestParams(meta, range, context) {
|
|
4881
|
-
let { dateEnv, options } = context;
|
|
4882
|
-
let startParam;
|
|
4883
|
-
let endParam;
|
|
4884
|
-
let timeZoneParam;
|
|
4885
|
-
let customRequestParams;
|
|
4886
|
-
let params = {};
|
|
4887
|
-
startParam = meta.startParam;
|
|
4888
|
-
if (startParam == null) {
|
|
4889
|
-
startParam = options.startParam;
|
|
4890
|
-
}
|
|
4891
|
-
endParam = meta.endParam;
|
|
4892
|
-
if (endParam == null) {
|
|
4893
|
-
endParam = options.endParam;
|
|
4894
|
-
}
|
|
4895
|
-
timeZoneParam = meta.timeZoneParam;
|
|
4896
|
-
if (timeZoneParam == null) {
|
|
4897
|
-
timeZoneParam = options.timeZoneParam;
|
|
4898
|
-
}
|
|
4899
|
-
// retrieve any outbound GET/POST data from the options
|
|
4900
|
-
if (typeof meta.extraParams === 'function') {
|
|
4901
|
-
// supplied as a function that returns a key/value object
|
|
4902
|
-
customRequestParams = meta.extraParams();
|
|
4903
|
-
}
|
|
4904
|
-
else {
|
|
4905
|
-
// probably supplied as a straight key/value object
|
|
4906
|
-
customRequestParams = meta.extraParams || {};
|
|
4907
|
-
}
|
|
4908
|
-
Object.assign(params, customRequestParams);
|
|
4909
|
-
params[startParam] = dateEnv.formatIso(range.start);
|
|
4910
|
-
params[endParam] = dateEnv.formatIso(range.end);
|
|
4911
|
-
if (dateEnv.timeZone !== 'local') {
|
|
4912
|
-
params[timeZoneParam] = dateEnv.timeZone;
|
|
4913
|
-
}
|
|
4914
|
-
return params;
|
|
4915
|
-
}
|
|
4916
|
-
|
|
4917
|
-
const SIMPLE_RECURRING_REFINERS = {
|
|
4918
|
-
daysOfWeek: identity,
|
|
4919
|
-
startTime: createDuration,
|
|
4920
|
-
endTime: createDuration,
|
|
4921
|
-
duration: createDuration,
|
|
4922
|
-
startRecur: identity,
|
|
4923
|
-
endRecur: identity,
|
|
4924
|
-
};
|
|
4925
|
-
|
|
4926
|
-
let recurring = {
|
|
4927
|
-
parse(refined, dateEnv) {
|
|
4928
|
-
if (refined.daysOfWeek || refined.startTime || refined.endTime || refined.startRecur || refined.endRecur) {
|
|
4929
|
-
let recurringData = {
|
|
4930
|
-
daysOfWeek: refined.daysOfWeek || null,
|
|
4931
|
-
startTime: refined.startTime || null,
|
|
4932
|
-
endTime: refined.endTime || null,
|
|
4933
|
-
startRecur: refined.startRecur ? dateEnv.createMarker(refined.startRecur) : null,
|
|
4934
|
-
endRecur: refined.endRecur ? dateEnv.createMarker(refined.endRecur) : null,
|
|
4935
|
-
};
|
|
4936
|
-
let duration;
|
|
4937
|
-
if (refined.duration) {
|
|
4938
|
-
duration = refined.duration;
|
|
4939
|
-
}
|
|
4940
|
-
if (!duration && refined.startTime && refined.endTime) {
|
|
4941
|
-
duration = subtractDurations(refined.endTime, refined.startTime);
|
|
4942
|
-
}
|
|
4943
|
-
return {
|
|
4944
|
-
allDayGuess: Boolean(!refined.startTime && !refined.endTime),
|
|
4945
|
-
duration,
|
|
4946
|
-
typeData: recurringData, // doesn't need endTime anymore but oh well
|
|
4947
|
-
};
|
|
4948
|
-
}
|
|
4949
|
-
return null;
|
|
4950
|
-
},
|
|
4951
|
-
expand(typeData, framingRange, dateEnv) {
|
|
4952
|
-
let clippedFramingRange = intersectRanges(framingRange, { start: typeData.startRecur, end: typeData.endRecur });
|
|
4953
|
-
if (clippedFramingRange) {
|
|
4954
|
-
return expandRanges(typeData.daysOfWeek, typeData.startTime, clippedFramingRange, dateEnv);
|
|
4955
|
-
}
|
|
4956
|
-
return [];
|
|
4957
|
-
},
|
|
4958
|
-
};
|
|
4959
|
-
const simpleRecurringEventsPlugin = createPlugin({
|
|
4960
|
-
name: 'simple-recurring-event',
|
|
4961
|
-
recurringTypes: [recurring],
|
|
4962
|
-
eventRefiners: SIMPLE_RECURRING_REFINERS,
|
|
4963
|
-
});
|
|
4964
|
-
function expandRanges(daysOfWeek, startTime, framingRange, dateEnv) {
|
|
4965
|
-
let dowHash = daysOfWeek ? arrayToHash(daysOfWeek) : null;
|
|
4966
|
-
let dayMarker = startOfDay(framingRange.start);
|
|
4967
|
-
let endMarker = framingRange.end;
|
|
4968
|
-
let instanceStarts = [];
|
|
4969
|
-
while (dayMarker < endMarker) {
|
|
4970
|
-
let instanceStart;
|
|
4971
|
-
// if everyday, or this particular day-of-week
|
|
4972
|
-
if (!dowHash || dowHash[dayMarker.getUTCDay()]) {
|
|
4973
|
-
if (startTime) {
|
|
4974
|
-
instanceStart = dateEnv.add(dayMarker, startTime);
|
|
4975
|
-
}
|
|
4976
|
-
else {
|
|
4977
|
-
instanceStart = dayMarker;
|
|
4978
|
-
}
|
|
4979
|
-
instanceStarts.push(instanceStart);
|
|
4980
|
-
}
|
|
4981
|
-
dayMarker = addDays(dayMarker, 1);
|
|
4982
|
-
}
|
|
4983
|
-
return instanceStarts;
|
|
4984
|
-
}
|
|
4985
|
-
|
|
4986
|
-
const changeHandlerPlugin = createPlugin({
|
|
4987
|
-
name: 'change-handler',
|
|
4988
|
-
optionChangeHandlers: {
|
|
4989
|
-
events(events, context) {
|
|
4990
|
-
handleEventSources([events], context);
|
|
4991
|
-
},
|
|
4992
|
-
eventSources: handleEventSources,
|
|
4993
|
-
},
|
|
4994
|
-
});
|
|
4995
|
-
/*
|
|
4996
|
-
BUG: if `event` was supplied, all previously-given `eventSources` will be wiped out
|
|
4997
|
-
*/
|
|
4998
|
-
function handleEventSources(inputs, context) {
|
|
4999
|
-
let unfoundSources = hashValuesToArray(context.getCurrentData().eventSources);
|
|
5000
|
-
let newInputs = [];
|
|
5001
|
-
for (let input of inputs) {
|
|
5002
|
-
let inputFound = false;
|
|
5003
|
-
for (let i = 0; i < unfoundSources.length; i += 1) {
|
|
5004
|
-
if (unfoundSources[i]._raw === input) {
|
|
5005
|
-
unfoundSources.splice(i, 1); // delete
|
|
5006
|
-
inputFound = true;
|
|
5007
|
-
break;
|
|
5008
|
-
}
|
|
5009
|
-
}
|
|
5010
|
-
if (!inputFound) {
|
|
5011
|
-
newInputs.push(input);
|
|
5012
|
-
}
|
|
5013
|
-
}
|
|
5014
|
-
for (let unfoundSource of unfoundSources) {
|
|
5015
|
-
context.dispatch({
|
|
5016
|
-
type: 'REMOVE_EVENT_SOURCE',
|
|
5017
|
-
sourceId: unfoundSource.sourceId,
|
|
5018
|
-
});
|
|
5019
|
-
}
|
|
5020
|
-
for (let newInput of newInputs) {
|
|
5021
|
-
context.calendarApi.addEventSource(newInput);
|
|
5022
|
-
}
|
|
5023
|
-
}
|
|
5024
|
-
|
|
5025
|
-
function handleDateProfile(dateProfile, context) {
|
|
5026
|
-
context.emitter.trigger('datesSet', Object.assign(Object.assign({}, buildRangeApiWithTimeZone(dateProfile.activeRange, context.dateEnv)), { view: context.viewApi }));
|
|
5027
|
-
}
|
|
5028
|
-
|
|
5029
|
-
function handleEventStore(eventStore, context) {
|
|
5030
|
-
let { emitter } = context;
|
|
5031
|
-
if (emitter.hasHandlers('eventsSet')) {
|
|
5032
|
-
emitter.trigger('eventsSet', buildEventApis(eventStore, context));
|
|
5033
|
-
}
|
|
5034
|
-
}
|
|
5035
|
-
|
|
5036
|
-
/*
|
|
5037
|
-
this array is exposed on the root namespace so that UMD plugins can add to it.
|
|
5038
|
-
see the rollup-bundles script.
|
|
5039
|
-
*/
|
|
5040
|
-
const globalPlugins = [
|
|
5041
|
-
arrayEventSourcePlugin,
|
|
5042
|
-
funcEventSourcePlugin,
|
|
5043
|
-
jsonFeedEventSourcePlugin,
|
|
5044
|
-
simpleRecurringEventsPlugin,
|
|
5045
|
-
changeHandlerPlugin,
|
|
5046
|
-
createPlugin({
|
|
5047
|
-
name: 'misc',
|
|
5048
|
-
isLoadingFuncs: [
|
|
5049
|
-
(state) => computeEventSourcesLoading(state.eventSources),
|
|
5050
|
-
],
|
|
5051
|
-
propSetHandlers: {
|
|
5052
|
-
dateProfile: handleDateProfile,
|
|
5053
|
-
eventStore: handleEventStore,
|
|
5054
|
-
},
|
|
5055
|
-
}),
|
|
5056
|
-
];
|
|
5057
|
-
|
|
5058
4492
|
let canVGrowWithinCell;
|
|
5059
4493
|
function getCanVGrowWithinCell() {
|
|
5060
4494
|
if (canVGrowWithinCell == null) {
|
|
@@ -7418,10 +6852,10 @@ class EventContainer extends BaseComponent {
|
|
|
7418
6852
|
constructor() {
|
|
7419
6853
|
super(...arguments);
|
|
7420
6854
|
this.handleEl = (el) => {
|
|
6855
|
+
this.el = el;
|
|
7421
6856
|
if (el) {
|
|
7422
6857
|
setElSeg(el, this.props.seg);
|
|
7423
6858
|
}
|
|
7424
|
-
// TODO: when null, should unset to avoid memory leaks?
|
|
7425
6859
|
};
|
|
7426
6860
|
}
|
|
7427
6861
|
render() {
|
|
@@ -7456,6 +6890,11 @@ class EventContainer extends BaseComponent {
|
|
|
7456
6890
|
...(props.elClasses || []),
|
|
7457
6891
|
], renderProps: renderProps, generatorName: "eventContent", generator: options.eventContent || props.defaultGenerator, classNameGenerator: options.eventClassNames, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount })));
|
|
7458
6892
|
}
|
|
6893
|
+
componentDidUpdate(prevProps) {
|
|
6894
|
+
if (this.el && this.props.seg !== prevProps.seg) {
|
|
6895
|
+
setElSeg(this.el, this.props.seg);
|
|
6896
|
+
}
|
|
6897
|
+
}
|
|
7459
6898
|
}
|
|
7460
6899
|
|
|
7461
6900
|
// should not be a purecomponent
|
|
@@ -7841,4 +7280,4 @@ class CustomRenderingStore extends Store {
|
|
|
7841
7280
|
}
|
|
7842
7281
|
}
|
|
7843
7282
|
|
|
7844
|
-
export {
|
|
7283
|
+
export { getElSeg as $, memoizeObjArg as A, BASE_OPTION_DEFAULTS as B, ContentContainer as C, DelayedRunner as D, isPropsEqual as E, Emitter as F, getInitialDate as G, rangeContainsMarker as H, createEmptyEventStore as I, reduceCurrentDate as J, reduceEventStore as K, rezoneEventStoreDates as L, mergeRawOptions as M, BASE_OPTION_REFINERS as N, CALENDAR_LISTENER_REFINERS as O, CALENDAR_OPTION_REFINERS as P, COMPLEX_OPTION_COMPARATORS as Q, VIEW_OPTION_REFINERS as R, DateEnv as S, Theme as T, DateProfileGenerator as U, ViewContextType as V, createEventUi as W, parseBusinessHours as X, BaseComponent as Y, setRef as Z, Interaction as _, isArraysEqual as a, getDateMeta as a$, elementClosest as a0, EventImpl as a1, listenBySelector as a2, listenToHoverBySelector as a3, PureComponent as a4, buildViewContext as a5, getUniqueDomId as a6, parseInteractionSettings as a7, interactionSettingsStore as a8, getNow as a9, diffDates as aA, removeExact as aB, memoizeArraylike as aC, memoizeHashlike as aD, intersectRects as aE, pointInsideRect as aF, constrainPoint as aG, getRectCenter as aH, diffPoints as aI, translateRect as aJ, compareObjs as aK, collectFromHash as aL, findElements as aM, findDirectChildren as aN, removeElement as aO, applyStyle as aP, elementMatches as aQ, getElRoot as aR, getEventTargetViaRoot as aS, parseClassNames as aT, getCanVGrowWithinCell as aU, mergeEventStores as aV, getRelevantEvents as aW, eventTupleToStore as aX, combineEventUis as aY, Splitter as aZ, getDayClassNames as a_, CalendarImpl as aa, flushSync as ab, CalendarRoot as ac, RenderId as ad, applyStyleProp as ae, sliceEventStore as af, JsonRequestError as ag, createContext as ah, refineProps as ai, createEventInstance as aj, parseEventDef as ak, refineEventDef as al, padStart as am, isInt as an, parseFieldSpecs as ao, compareByFieldSpecs as ap, flexibleCompare as aq, preventSelection as ar, allowSelection as as, preventContextMenu as at, allowContextMenu as au, compareNumbers as av, enableCursor as aw, disableCursor as ax, computeVisibleDayRange as ay, isMultiDayRange as az, mapHash as b, SimpleScrollGrid as b$, getSlotClassNames as b0, buildNavLinkAttrs as b1, preventDefault as b2, whenTransitionDone as b3, computeInnerRect as b4, computeEdges as b5, getClippingParents as b6, computeRect as b7, rangesEqual as b8, rangesIntersect as b9, SegHierarchy as bA, buildEntryKey as bB, getEntrySpanEnd as bC, binarySearch as bD, groupIntersectingEntries as bE, intersectSpans as bF, interactionSettingsToStore as bG, ElementDragging as bH, config as bI, parseDragMeta as bJ, DayHeader as bK, computeFallbackHeaderFormat as bL, TableDateCell as bM, TableDowCell as bN, DaySeriesModel as bO, hasBgRendering as bP, buildSegTimeText as bQ, sortEventSegs as bR, getSegMeta as bS, buildEventRangeKey as bT, getSegAnchorAttrs as bU, DayTableModel as bV, Slicer as bW, applyMutationToEventStore as bX, isPropsValid as bY, isInteractionValid as bZ, isDateSelectionValid as b_, rangeContainsRange as ba, PositionCache as bb, ScrollController as bc, ElementScrollController as bd, WindowScrollController as be, DateComponent as bf, isDateSpansEqual as bg, addMs as bh, addWeeks as bi, diffWeeks as bj, diffWholeWeeks as bk, diffDayAndTime as bl, diffDays as bm, isValidDate as bn, asCleanDays as bo, multiplyDuration as bp, addDurations as bq, asRoughMinutes as br, asRoughSeconds as bs, asRoughMs as bt, wholeDivideDurations as bu, formatIsoTimeString as bv, formatDayString as bw, buildIsoString as bx, NamedTimeZoneImpl as by, parse as bz, buildViewClassNames as c, hasShrinkWidth as c0, renderMicroColGroup as c1, getScrollGridClassNames as c2, getSectionClassNames as c3, getSectionHasLiquidHeight as c4, getAllowYScrolling as c5, renderChunkContent as c6, computeShrinkWidth as c7, sanitizeShrinkWidth as c8, isColPropsEqual as c9, renderScrollShim as ca, getStickyFooterScrollbar as cb, getStickyHeaderDates as cc, Scroller as cd, getScrollbarWidths as ce, RefMap as cf, getIsRtlScrollbarOnLeft as cg, NowTimer as ch, ScrollResponder as ci, StandardEvent as cj, NowIndicatorContainer as ck, DayCellContainer as cl, hasCustomDayCellContent as cm, EventContainer as cn, renderFill as co, BgEvent as cp, WeekNumberContainer as cq, MoreLinkContainer as cr, computeEarliestSegStart as cs, ViewContainer as ct, triggerDateSelect as cu, getDefaultEventEnd as cv, buildElAttrs as cw, CustomRenderingStore as cx, greatestDurationDenominator as d, createDuration as e, arrayToHash as f, guid as g, filterHash as h, injectStyles as i, buildEventSourceRefiners as j, formatWithOrdinals as k, buildRangeApiWithTimeZone as l, mergeProps as m, identity as n, intersectRanges as o, parseEventSource as p, startOfDay as q, requestJson as r, subtractDurations as s, addDays as t, unpromisify as u, hashValuesToArray as v, buildEventApis as w, createFormatter as x, diffWholeDays as y, memoize as z };
|