@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.cjs
CHANGED
|
@@ -200,6 +200,16 @@ function isPropsEqual(obj0, obj1) {
|
|
|
200
200
|
}
|
|
201
201
|
return true;
|
|
202
202
|
}
|
|
203
|
+
const HANDLER_RE = /^on[A-Z]/;
|
|
204
|
+
function isNonHandlerPropsEqual(obj0, obj1) {
|
|
205
|
+
const keys = getUnequalProps(obj0, obj1);
|
|
206
|
+
for (let key of keys) {
|
|
207
|
+
if (!HANDLER_RE.test(key)) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
203
213
|
function getUnequalProps(obj0, obj1) {
|
|
204
214
|
let keys = [];
|
|
205
215
|
for (let key in obj0) {
|
|
@@ -262,8 +272,6 @@ function collectFromHash(hash, startIndex = 0, endIndex, step = 1) {
|
|
|
262
272
|
return res;
|
|
263
273
|
}
|
|
264
274
|
|
|
265
|
-
const globalLocales = [];
|
|
266
|
-
|
|
267
275
|
// TODO: new util arrayify?
|
|
268
276
|
function removeExact(array, exactVal) {
|
|
269
277
|
let removeCnt = 0;
|
|
@@ -700,165 +708,6 @@ function computeSmallestCellWidth(cellEl) {
|
|
|
700
708
|
contentWidthEl.getBoundingClientRect().width;
|
|
701
709
|
}
|
|
702
710
|
|
|
703
|
-
// TODO: easier way to add new hooks? need to update a million things
|
|
704
|
-
function createPlugin(input) {
|
|
705
|
-
return {
|
|
706
|
-
id: guid(),
|
|
707
|
-
name: input.name,
|
|
708
|
-
premiumReleaseDate: input.premiumReleaseDate ? new Date(input.premiumReleaseDate) : undefined,
|
|
709
|
-
deps: input.deps || [],
|
|
710
|
-
reducers: input.reducers || [],
|
|
711
|
-
isLoadingFuncs: input.isLoadingFuncs || [],
|
|
712
|
-
contextInit: [].concat(input.contextInit || []),
|
|
713
|
-
eventRefiners: input.eventRefiners || {},
|
|
714
|
-
eventDefMemberAdders: input.eventDefMemberAdders || [],
|
|
715
|
-
eventSourceRefiners: input.eventSourceRefiners || {},
|
|
716
|
-
isDraggableTransformers: input.isDraggableTransformers || [],
|
|
717
|
-
eventDragMutationMassagers: input.eventDragMutationMassagers || [],
|
|
718
|
-
eventDefMutationAppliers: input.eventDefMutationAppliers || [],
|
|
719
|
-
dateSelectionTransformers: input.dateSelectionTransformers || [],
|
|
720
|
-
datePointTransforms: input.datePointTransforms || [],
|
|
721
|
-
dateSpanTransforms: input.dateSpanTransforms || [],
|
|
722
|
-
views: input.views || {},
|
|
723
|
-
viewPropsTransformers: input.viewPropsTransformers || [],
|
|
724
|
-
isPropsValid: input.isPropsValid || null,
|
|
725
|
-
externalDefTransforms: input.externalDefTransforms || [],
|
|
726
|
-
viewContainerAppends: input.viewContainerAppends || [],
|
|
727
|
-
eventDropTransformers: input.eventDropTransformers || [],
|
|
728
|
-
componentInteractions: input.componentInteractions || [],
|
|
729
|
-
calendarInteractions: input.calendarInteractions || [],
|
|
730
|
-
themeClasses: input.themeClasses || {},
|
|
731
|
-
eventSourceDefs: input.eventSourceDefs || [],
|
|
732
|
-
cmdFormatter: input.cmdFormatter,
|
|
733
|
-
recurringTypes: input.recurringTypes || [],
|
|
734
|
-
namedTimeZonedImpl: input.namedTimeZonedImpl,
|
|
735
|
-
initialView: input.initialView || '',
|
|
736
|
-
elementDraggingImpl: input.elementDraggingImpl,
|
|
737
|
-
optionChangeHandlers: input.optionChangeHandlers || {},
|
|
738
|
-
scrollGridImpl: input.scrollGridImpl || null,
|
|
739
|
-
listenerRefiners: input.listenerRefiners || {},
|
|
740
|
-
optionRefiners: input.optionRefiners || {},
|
|
741
|
-
propSetHandlers: input.propSetHandlers || {},
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
function buildPluginHooks(pluginDefs, globalDefs) {
|
|
745
|
-
let currentPluginIds = {};
|
|
746
|
-
let hooks = {
|
|
747
|
-
premiumReleaseDate: undefined,
|
|
748
|
-
reducers: [],
|
|
749
|
-
isLoadingFuncs: [],
|
|
750
|
-
contextInit: [],
|
|
751
|
-
eventRefiners: {},
|
|
752
|
-
eventDefMemberAdders: [],
|
|
753
|
-
eventSourceRefiners: {},
|
|
754
|
-
isDraggableTransformers: [],
|
|
755
|
-
eventDragMutationMassagers: [],
|
|
756
|
-
eventDefMutationAppliers: [],
|
|
757
|
-
dateSelectionTransformers: [],
|
|
758
|
-
datePointTransforms: [],
|
|
759
|
-
dateSpanTransforms: [],
|
|
760
|
-
views: {},
|
|
761
|
-
viewPropsTransformers: [],
|
|
762
|
-
isPropsValid: null,
|
|
763
|
-
externalDefTransforms: [],
|
|
764
|
-
viewContainerAppends: [],
|
|
765
|
-
eventDropTransformers: [],
|
|
766
|
-
componentInteractions: [],
|
|
767
|
-
calendarInteractions: [],
|
|
768
|
-
themeClasses: {},
|
|
769
|
-
eventSourceDefs: [],
|
|
770
|
-
cmdFormatter: null,
|
|
771
|
-
recurringTypes: [],
|
|
772
|
-
namedTimeZonedImpl: null,
|
|
773
|
-
initialView: '',
|
|
774
|
-
elementDraggingImpl: null,
|
|
775
|
-
optionChangeHandlers: {},
|
|
776
|
-
scrollGridImpl: null,
|
|
777
|
-
listenerRefiners: {},
|
|
778
|
-
optionRefiners: {},
|
|
779
|
-
propSetHandlers: {},
|
|
780
|
-
};
|
|
781
|
-
function addDefs(defs) {
|
|
782
|
-
for (let def of defs) {
|
|
783
|
-
const pluginName = def.name;
|
|
784
|
-
const currentId = currentPluginIds[pluginName];
|
|
785
|
-
if (currentId === undefined) {
|
|
786
|
-
currentPluginIds[pluginName] = def.id;
|
|
787
|
-
addDefs(def.deps);
|
|
788
|
-
hooks = combineHooks(hooks, def);
|
|
789
|
-
}
|
|
790
|
-
else if (currentId !== def.id) {
|
|
791
|
-
// different ID than the one already added
|
|
792
|
-
console.warn(`Duplicate plugin '${pluginName}'`);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
if (pluginDefs) {
|
|
797
|
-
addDefs(pluginDefs);
|
|
798
|
-
}
|
|
799
|
-
addDefs(globalDefs);
|
|
800
|
-
return hooks;
|
|
801
|
-
}
|
|
802
|
-
function buildBuildPluginHooks() {
|
|
803
|
-
let currentOverrideDefs = [];
|
|
804
|
-
let currentGlobalDefs = [];
|
|
805
|
-
let currentHooks;
|
|
806
|
-
return (overrideDefs, globalDefs) => {
|
|
807
|
-
if (!currentHooks || !isArraysEqual(overrideDefs, currentOverrideDefs) || !isArraysEqual(globalDefs, currentGlobalDefs)) {
|
|
808
|
-
currentHooks = buildPluginHooks(overrideDefs, globalDefs);
|
|
809
|
-
}
|
|
810
|
-
currentOverrideDefs = overrideDefs;
|
|
811
|
-
currentGlobalDefs = globalDefs;
|
|
812
|
-
return currentHooks;
|
|
813
|
-
};
|
|
814
|
-
}
|
|
815
|
-
function combineHooks(hooks0, hooks1) {
|
|
816
|
-
return {
|
|
817
|
-
premiumReleaseDate: compareOptionalDates(hooks0.premiumReleaseDate, hooks1.premiumReleaseDate),
|
|
818
|
-
reducers: hooks0.reducers.concat(hooks1.reducers),
|
|
819
|
-
isLoadingFuncs: hooks0.isLoadingFuncs.concat(hooks1.isLoadingFuncs),
|
|
820
|
-
contextInit: hooks0.contextInit.concat(hooks1.contextInit),
|
|
821
|
-
eventRefiners: Object.assign(Object.assign({}, hooks0.eventRefiners), hooks1.eventRefiners),
|
|
822
|
-
eventDefMemberAdders: hooks0.eventDefMemberAdders.concat(hooks1.eventDefMemberAdders),
|
|
823
|
-
eventSourceRefiners: Object.assign(Object.assign({}, hooks0.eventSourceRefiners), hooks1.eventSourceRefiners),
|
|
824
|
-
isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers),
|
|
825
|
-
eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers),
|
|
826
|
-
eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers),
|
|
827
|
-
dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers),
|
|
828
|
-
datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms),
|
|
829
|
-
dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms),
|
|
830
|
-
views: Object.assign(Object.assign({}, hooks0.views), hooks1.views),
|
|
831
|
-
viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers),
|
|
832
|
-
isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid,
|
|
833
|
-
externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms),
|
|
834
|
-
viewContainerAppends: hooks0.viewContainerAppends.concat(hooks1.viewContainerAppends),
|
|
835
|
-
eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),
|
|
836
|
-
calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),
|
|
837
|
-
componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),
|
|
838
|
-
themeClasses: Object.assign(Object.assign({}, hooks0.themeClasses), hooks1.themeClasses),
|
|
839
|
-
eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs),
|
|
840
|
-
cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter,
|
|
841
|
-
recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes),
|
|
842
|
-
namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl,
|
|
843
|
-
initialView: hooks0.initialView || hooks1.initialView,
|
|
844
|
-
elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl,
|
|
845
|
-
optionChangeHandlers: Object.assign(Object.assign({}, hooks0.optionChangeHandlers), hooks1.optionChangeHandlers),
|
|
846
|
-
scrollGridImpl: hooks1.scrollGridImpl || hooks0.scrollGridImpl,
|
|
847
|
-
listenerRefiners: Object.assign(Object.assign({}, hooks0.listenerRefiners), hooks1.listenerRefiners),
|
|
848
|
-
optionRefiners: Object.assign(Object.assign({}, hooks0.optionRefiners), hooks1.optionRefiners),
|
|
849
|
-
propSetHandlers: Object.assign(Object.assign({}, hooks0.propSetHandlers), hooks1.propSetHandlers),
|
|
850
|
-
};
|
|
851
|
-
}
|
|
852
|
-
function compareOptionalDates(date0, date1) {
|
|
853
|
-
if (date0 === undefined) {
|
|
854
|
-
return date1;
|
|
855
|
-
}
|
|
856
|
-
if (date1 === undefined) {
|
|
857
|
-
return date0;
|
|
858
|
-
}
|
|
859
|
-
return new Date(Math.max(date0.valueOf(), date1.valueOf()));
|
|
860
|
-
}
|
|
861
|
-
|
|
862
711
|
const DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
|
863
712
|
// Adding
|
|
864
713
|
function addWeeks(m, n) {
|
|
@@ -2555,7 +2404,7 @@ class ContentInjector extends BaseComponent {
|
|
|
2555
2404
|
ContentInjector.addPropsEquality({
|
|
2556
2405
|
elClasses: isArraysEqual,
|
|
2557
2406
|
elStyle: isPropsEqual,
|
|
2558
|
-
elAttrs:
|
|
2407
|
+
elAttrs: isNonHandlerPropsEqual,
|
|
2559
2408
|
renderProps: isPropsEqual,
|
|
2560
2409
|
});
|
|
2561
2410
|
// Util
|
|
@@ -3558,170 +3407,6 @@ function buildEventSourceMeta(raw, context) {
|
|
|
3558
3407
|
return null;
|
|
3559
3408
|
}
|
|
3560
3409
|
|
|
3561
|
-
function initEventSources(calendarOptions, dateProfile, context) {
|
|
3562
|
-
let activeRange = dateProfile ? dateProfile.activeRange : null;
|
|
3563
|
-
return addSources({}, parseInitialSources(calendarOptions, context), activeRange, context);
|
|
3564
|
-
}
|
|
3565
|
-
function reduceEventSources(eventSources, action, dateProfile, context) {
|
|
3566
|
-
let activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?
|
|
3567
|
-
switch (action.type) {
|
|
3568
|
-
case 'ADD_EVENT_SOURCES': // already parsed
|
|
3569
|
-
return addSources(eventSources, action.sources, activeRange, context);
|
|
3570
|
-
case 'REMOVE_EVENT_SOURCE':
|
|
3571
|
-
return removeSource(eventSources, action.sourceId);
|
|
3572
|
-
case 'PREV': // TODO: how do we track all actions that affect dateProfile :(
|
|
3573
|
-
case 'NEXT':
|
|
3574
|
-
case 'CHANGE_DATE':
|
|
3575
|
-
case 'CHANGE_VIEW_TYPE':
|
|
3576
|
-
if (dateProfile) {
|
|
3577
|
-
return fetchDirtySources(eventSources, activeRange, context);
|
|
3578
|
-
}
|
|
3579
|
-
return eventSources;
|
|
3580
|
-
case 'FETCH_EVENT_SOURCES':
|
|
3581
|
-
return fetchSourcesByIds(eventSources, action.sourceIds ? // why no type?
|
|
3582
|
-
arrayToHash(action.sourceIds) :
|
|
3583
|
-
excludeStaticSources(eventSources, context), activeRange, action.isRefetch || false, context);
|
|
3584
|
-
case 'RECEIVE_EVENTS':
|
|
3585
|
-
case 'RECEIVE_EVENT_ERROR':
|
|
3586
|
-
return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange);
|
|
3587
|
-
case 'REMOVE_ALL_EVENT_SOURCES':
|
|
3588
|
-
return {};
|
|
3589
|
-
default:
|
|
3590
|
-
return eventSources;
|
|
3591
|
-
}
|
|
3592
|
-
}
|
|
3593
|
-
function reduceEventSourcesNewTimeZone(eventSources, dateProfile, context) {
|
|
3594
|
-
let activeRange = dateProfile ? dateProfile.activeRange : null; // need this check?
|
|
3595
|
-
return fetchSourcesByIds(eventSources, excludeStaticSources(eventSources, context), activeRange, true, context);
|
|
3596
|
-
}
|
|
3597
|
-
function computeEventSourcesLoading(eventSources) {
|
|
3598
|
-
for (let sourceId in eventSources) {
|
|
3599
|
-
if (eventSources[sourceId].isFetching) {
|
|
3600
|
-
return true;
|
|
3601
|
-
}
|
|
3602
|
-
}
|
|
3603
|
-
return false;
|
|
3604
|
-
}
|
|
3605
|
-
function addSources(eventSourceHash, sources, fetchRange, context) {
|
|
3606
|
-
let hash = {};
|
|
3607
|
-
for (let source of sources) {
|
|
3608
|
-
hash[source.sourceId] = source;
|
|
3609
|
-
}
|
|
3610
|
-
if (fetchRange) {
|
|
3611
|
-
hash = fetchDirtySources(hash, fetchRange, context);
|
|
3612
|
-
}
|
|
3613
|
-
return Object.assign(Object.assign({}, eventSourceHash), hash);
|
|
3614
|
-
}
|
|
3615
|
-
function removeSource(eventSourceHash, sourceId) {
|
|
3616
|
-
return filterHash(eventSourceHash, (eventSource) => eventSource.sourceId !== sourceId);
|
|
3617
|
-
}
|
|
3618
|
-
function fetchDirtySources(sourceHash, fetchRange, context) {
|
|
3619
|
-
return fetchSourcesByIds(sourceHash, filterHash(sourceHash, (eventSource) => isSourceDirty(eventSource, fetchRange, context)), fetchRange, false, context);
|
|
3620
|
-
}
|
|
3621
|
-
function isSourceDirty(eventSource, fetchRange, context) {
|
|
3622
|
-
if (!doesSourceNeedRange(eventSource, context)) {
|
|
3623
|
-
return !eventSource.latestFetchId;
|
|
3624
|
-
}
|
|
3625
|
-
return !context.options.lazyFetching ||
|
|
3626
|
-
!eventSource.fetchRange ||
|
|
3627
|
-
eventSource.isFetching || // always cancel outdated in-progress fetches
|
|
3628
|
-
fetchRange.start < eventSource.fetchRange.start ||
|
|
3629
|
-
fetchRange.end > eventSource.fetchRange.end;
|
|
3630
|
-
}
|
|
3631
|
-
function fetchSourcesByIds(prevSources, sourceIdHash, fetchRange, isRefetch, context) {
|
|
3632
|
-
let nextSources = {};
|
|
3633
|
-
for (let sourceId in prevSources) {
|
|
3634
|
-
let source = prevSources[sourceId];
|
|
3635
|
-
if (sourceIdHash[sourceId]) {
|
|
3636
|
-
nextSources[sourceId] = fetchSource(source, fetchRange, isRefetch, context);
|
|
3637
|
-
}
|
|
3638
|
-
else {
|
|
3639
|
-
nextSources[sourceId] = source;
|
|
3640
|
-
}
|
|
3641
|
-
}
|
|
3642
|
-
return nextSources;
|
|
3643
|
-
}
|
|
3644
|
-
function fetchSource(eventSource, fetchRange, isRefetch, context) {
|
|
3645
|
-
let { options, calendarApi } = context;
|
|
3646
|
-
let sourceDef = context.pluginHooks.eventSourceDefs[eventSource.sourceDefId];
|
|
3647
|
-
let fetchId = guid();
|
|
3648
|
-
sourceDef.fetch({
|
|
3649
|
-
eventSource,
|
|
3650
|
-
range: fetchRange,
|
|
3651
|
-
isRefetch,
|
|
3652
|
-
context,
|
|
3653
|
-
}, (res) => {
|
|
3654
|
-
let { rawEvents } = res;
|
|
3655
|
-
if (options.eventSourceSuccess) {
|
|
3656
|
-
rawEvents = options.eventSourceSuccess.call(calendarApi, rawEvents, res.response) || rawEvents;
|
|
3657
|
-
}
|
|
3658
|
-
if (eventSource.success) {
|
|
3659
|
-
rawEvents = eventSource.success.call(calendarApi, rawEvents, res.response) || rawEvents;
|
|
3660
|
-
}
|
|
3661
|
-
context.dispatch({
|
|
3662
|
-
type: 'RECEIVE_EVENTS',
|
|
3663
|
-
sourceId: eventSource.sourceId,
|
|
3664
|
-
fetchId,
|
|
3665
|
-
fetchRange,
|
|
3666
|
-
rawEvents,
|
|
3667
|
-
});
|
|
3668
|
-
}, (error) => {
|
|
3669
|
-
let errorHandled = false;
|
|
3670
|
-
if (options.eventSourceFailure) {
|
|
3671
|
-
options.eventSourceFailure.call(calendarApi, error);
|
|
3672
|
-
errorHandled = true;
|
|
3673
|
-
}
|
|
3674
|
-
if (eventSource.failure) {
|
|
3675
|
-
eventSource.failure(error);
|
|
3676
|
-
errorHandled = true;
|
|
3677
|
-
}
|
|
3678
|
-
if (!errorHandled) {
|
|
3679
|
-
console.warn(error.message, error);
|
|
3680
|
-
}
|
|
3681
|
-
context.dispatch({
|
|
3682
|
-
type: 'RECEIVE_EVENT_ERROR',
|
|
3683
|
-
sourceId: eventSource.sourceId,
|
|
3684
|
-
fetchId,
|
|
3685
|
-
fetchRange,
|
|
3686
|
-
error,
|
|
3687
|
-
});
|
|
3688
|
-
});
|
|
3689
|
-
return Object.assign(Object.assign({}, eventSource), { isFetching: true, latestFetchId: fetchId });
|
|
3690
|
-
}
|
|
3691
|
-
function receiveResponse(sourceHash, sourceId, fetchId, fetchRange) {
|
|
3692
|
-
let eventSource = sourceHash[sourceId];
|
|
3693
|
-
if (eventSource && // not already removed
|
|
3694
|
-
fetchId === eventSource.latestFetchId) {
|
|
3695
|
-
return Object.assign(Object.assign({}, sourceHash), { [sourceId]: Object.assign(Object.assign({}, eventSource), { isFetching: false, fetchRange }) });
|
|
3696
|
-
}
|
|
3697
|
-
return sourceHash;
|
|
3698
|
-
}
|
|
3699
|
-
function excludeStaticSources(eventSources, context) {
|
|
3700
|
-
return filterHash(eventSources, (eventSource) => doesSourceNeedRange(eventSource, context));
|
|
3701
|
-
}
|
|
3702
|
-
function parseInitialSources(rawOptions, context) {
|
|
3703
|
-
let refiners = buildEventSourceRefiners(context);
|
|
3704
|
-
let rawSources = [].concat(rawOptions.eventSources || []);
|
|
3705
|
-
let sources = []; // parsed
|
|
3706
|
-
if (rawOptions.initialEvents) {
|
|
3707
|
-
rawSources.unshift(rawOptions.initialEvents);
|
|
3708
|
-
}
|
|
3709
|
-
if (rawOptions.events) {
|
|
3710
|
-
rawSources.unshift(rawOptions.events);
|
|
3711
|
-
}
|
|
3712
|
-
for (let rawSource of rawSources) {
|
|
3713
|
-
let source = parseEventSource(rawSource, context, refiners);
|
|
3714
|
-
if (source) {
|
|
3715
|
-
sources.push(source);
|
|
3716
|
-
}
|
|
3717
|
-
}
|
|
3718
|
-
return sources;
|
|
3719
|
-
}
|
|
3720
|
-
function doesSourceNeedRange(eventSource, context) {
|
|
3721
|
-
let defs = context.pluginHooks.eventSourceDefs;
|
|
3722
|
-
return !defs[eventSource.sourceDefId].ignoreRange;
|
|
3723
|
-
}
|
|
3724
|
-
|
|
3725
3410
|
function reduceEventStore(eventStore, action, eventSources, dateProfile, context) {
|
|
3726
3411
|
switch (action.type) {
|
|
3727
3412
|
case 'RECEIVE_EVENTS': // raw
|
|
@@ -3905,25 +3590,6 @@ function refineInputs(input) {
|
|
|
3905
3590
|
return rawDefs;
|
|
3906
3591
|
}
|
|
3907
3592
|
|
|
3908
|
-
let eventSourceDef$2 = {
|
|
3909
|
-
ignoreRange: true,
|
|
3910
|
-
parseMeta(refined) {
|
|
3911
|
-
if (Array.isArray(refined.events)) {
|
|
3912
|
-
return refined.events;
|
|
3913
|
-
}
|
|
3914
|
-
return null;
|
|
3915
|
-
},
|
|
3916
|
-
fetch(arg, successCallback) {
|
|
3917
|
-
successCallback({
|
|
3918
|
-
rawEvents: arg.eventSource.meta,
|
|
3919
|
-
});
|
|
3920
|
-
},
|
|
3921
|
-
};
|
|
3922
|
-
const arrayEventSourcePlugin = createPlugin({
|
|
3923
|
-
name: 'array-event-source',
|
|
3924
|
-
eventSourceDefs: [eventSourceDef$2],
|
|
3925
|
-
});
|
|
3926
|
-
|
|
3927
3593
|
function triggerDateSelect(selection, pev, context) {
|
|
3928
3594
|
context.emitter.trigger('select', Object.assign(Object.assign({}, buildDateSpanApiWithContext(selection, context)), { jsEvent: pev ? pev.origEvent : null, view: context.viewApi || context.calendarApi.view }));
|
|
3929
3595
|
}
|
|
@@ -4809,24 +4475,6 @@ function unpromisify(func, normalizedSuccessCallback, normalizedFailureCallback)
|
|
|
4809
4475
|
}
|
|
4810
4476
|
}
|
|
4811
4477
|
|
|
4812
|
-
let eventSourceDef$1 = {
|
|
4813
|
-
parseMeta(refined) {
|
|
4814
|
-
if (typeof refined.events === 'function') {
|
|
4815
|
-
return refined.events;
|
|
4816
|
-
}
|
|
4817
|
-
return null;
|
|
4818
|
-
},
|
|
4819
|
-
fetch(arg, successCallback, errorCallback) {
|
|
4820
|
-
const { dateEnv } = arg.context;
|
|
4821
|
-
const func = arg.eventSource.meta;
|
|
4822
|
-
unpromisify(func.bind(null, buildRangeApiWithTimeZone(arg.range, dateEnv)), (rawEvents) => successCallback({ rawEvents }), errorCallback);
|
|
4823
|
-
},
|
|
4824
|
-
};
|
|
4825
|
-
const funcEventSourcePlugin = createPlugin({
|
|
4826
|
-
name: 'func-event-source',
|
|
4827
|
-
eventSourceDefs: [eventSourceDef$1],
|
|
4828
|
-
});
|
|
4829
|
-
|
|
4830
4478
|
class JsonRequestError extends Error {
|
|
4831
4479
|
constructor(message, response) {
|
|
4832
4480
|
super(message);
|
|
@@ -4862,220 +4510,6 @@ function requestJson(method, url, params) {
|
|
|
4862
4510
|
});
|
|
4863
4511
|
}
|
|
4864
4512
|
|
|
4865
|
-
const JSON_FEED_EVENT_SOURCE_REFINERS = {
|
|
4866
|
-
method: String,
|
|
4867
|
-
extraParams: identity,
|
|
4868
|
-
startParam: String,
|
|
4869
|
-
endParam: String,
|
|
4870
|
-
timeZoneParam: String,
|
|
4871
|
-
};
|
|
4872
|
-
|
|
4873
|
-
let eventSourceDef = {
|
|
4874
|
-
parseMeta(refined) {
|
|
4875
|
-
if (refined.url && (refined.format === 'json' || !refined.format)) {
|
|
4876
|
-
return {
|
|
4877
|
-
url: refined.url,
|
|
4878
|
-
format: 'json',
|
|
4879
|
-
method: (refined.method || 'GET').toUpperCase(),
|
|
4880
|
-
extraParams: refined.extraParams,
|
|
4881
|
-
startParam: refined.startParam,
|
|
4882
|
-
endParam: refined.endParam,
|
|
4883
|
-
timeZoneParam: refined.timeZoneParam,
|
|
4884
|
-
};
|
|
4885
|
-
}
|
|
4886
|
-
return null;
|
|
4887
|
-
},
|
|
4888
|
-
fetch(arg, successCallback, errorCallback) {
|
|
4889
|
-
const { meta } = arg.eventSource;
|
|
4890
|
-
const requestParams = buildRequestParams(meta, arg.range, arg.context);
|
|
4891
|
-
requestJson(meta.method, meta.url, requestParams).then(([rawEvents, response]) => {
|
|
4892
|
-
successCallback({ rawEvents, response });
|
|
4893
|
-
}, errorCallback);
|
|
4894
|
-
},
|
|
4895
|
-
};
|
|
4896
|
-
const jsonFeedEventSourcePlugin = createPlugin({
|
|
4897
|
-
name: 'json-event-source',
|
|
4898
|
-
eventSourceRefiners: JSON_FEED_EVENT_SOURCE_REFINERS,
|
|
4899
|
-
eventSourceDefs: [eventSourceDef],
|
|
4900
|
-
});
|
|
4901
|
-
function buildRequestParams(meta, range, context) {
|
|
4902
|
-
let { dateEnv, options } = context;
|
|
4903
|
-
let startParam;
|
|
4904
|
-
let endParam;
|
|
4905
|
-
let timeZoneParam;
|
|
4906
|
-
let customRequestParams;
|
|
4907
|
-
let params = {};
|
|
4908
|
-
startParam = meta.startParam;
|
|
4909
|
-
if (startParam == null) {
|
|
4910
|
-
startParam = options.startParam;
|
|
4911
|
-
}
|
|
4912
|
-
endParam = meta.endParam;
|
|
4913
|
-
if (endParam == null) {
|
|
4914
|
-
endParam = options.endParam;
|
|
4915
|
-
}
|
|
4916
|
-
timeZoneParam = meta.timeZoneParam;
|
|
4917
|
-
if (timeZoneParam == null) {
|
|
4918
|
-
timeZoneParam = options.timeZoneParam;
|
|
4919
|
-
}
|
|
4920
|
-
// retrieve any outbound GET/POST data from the options
|
|
4921
|
-
if (typeof meta.extraParams === 'function') {
|
|
4922
|
-
// supplied as a function that returns a key/value object
|
|
4923
|
-
customRequestParams = meta.extraParams();
|
|
4924
|
-
}
|
|
4925
|
-
else {
|
|
4926
|
-
// probably supplied as a straight key/value object
|
|
4927
|
-
customRequestParams = meta.extraParams || {};
|
|
4928
|
-
}
|
|
4929
|
-
Object.assign(params, customRequestParams);
|
|
4930
|
-
params[startParam] = dateEnv.formatIso(range.start);
|
|
4931
|
-
params[endParam] = dateEnv.formatIso(range.end);
|
|
4932
|
-
if (dateEnv.timeZone !== 'local') {
|
|
4933
|
-
params[timeZoneParam] = dateEnv.timeZone;
|
|
4934
|
-
}
|
|
4935
|
-
return params;
|
|
4936
|
-
}
|
|
4937
|
-
|
|
4938
|
-
const SIMPLE_RECURRING_REFINERS = {
|
|
4939
|
-
daysOfWeek: identity,
|
|
4940
|
-
startTime: createDuration,
|
|
4941
|
-
endTime: createDuration,
|
|
4942
|
-
duration: createDuration,
|
|
4943
|
-
startRecur: identity,
|
|
4944
|
-
endRecur: identity,
|
|
4945
|
-
};
|
|
4946
|
-
|
|
4947
|
-
let recurring = {
|
|
4948
|
-
parse(refined, dateEnv) {
|
|
4949
|
-
if (refined.daysOfWeek || refined.startTime || refined.endTime || refined.startRecur || refined.endRecur) {
|
|
4950
|
-
let recurringData = {
|
|
4951
|
-
daysOfWeek: refined.daysOfWeek || null,
|
|
4952
|
-
startTime: refined.startTime || null,
|
|
4953
|
-
endTime: refined.endTime || null,
|
|
4954
|
-
startRecur: refined.startRecur ? dateEnv.createMarker(refined.startRecur) : null,
|
|
4955
|
-
endRecur: refined.endRecur ? dateEnv.createMarker(refined.endRecur) : null,
|
|
4956
|
-
};
|
|
4957
|
-
let duration;
|
|
4958
|
-
if (refined.duration) {
|
|
4959
|
-
duration = refined.duration;
|
|
4960
|
-
}
|
|
4961
|
-
if (!duration && refined.startTime && refined.endTime) {
|
|
4962
|
-
duration = subtractDurations(refined.endTime, refined.startTime);
|
|
4963
|
-
}
|
|
4964
|
-
return {
|
|
4965
|
-
allDayGuess: Boolean(!refined.startTime && !refined.endTime),
|
|
4966
|
-
duration,
|
|
4967
|
-
typeData: recurringData, // doesn't need endTime anymore but oh well
|
|
4968
|
-
};
|
|
4969
|
-
}
|
|
4970
|
-
return null;
|
|
4971
|
-
},
|
|
4972
|
-
expand(typeData, framingRange, dateEnv) {
|
|
4973
|
-
let clippedFramingRange = intersectRanges(framingRange, { start: typeData.startRecur, end: typeData.endRecur });
|
|
4974
|
-
if (clippedFramingRange) {
|
|
4975
|
-
return expandRanges(typeData.daysOfWeek, typeData.startTime, clippedFramingRange, dateEnv);
|
|
4976
|
-
}
|
|
4977
|
-
return [];
|
|
4978
|
-
},
|
|
4979
|
-
};
|
|
4980
|
-
const simpleRecurringEventsPlugin = createPlugin({
|
|
4981
|
-
name: 'simple-recurring-event',
|
|
4982
|
-
recurringTypes: [recurring],
|
|
4983
|
-
eventRefiners: SIMPLE_RECURRING_REFINERS,
|
|
4984
|
-
});
|
|
4985
|
-
function expandRanges(daysOfWeek, startTime, framingRange, dateEnv) {
|
|
4986
|
-
let dowHash = daysOfWeek ? arrayToHash(daysOfWeek) : null;
|
|
4987
|
-
let dayMarker = startOfDay(framingRange.start);
|
|
4988
|
-
let endMarker = framingRange.end;
|
|
4989
|
-
let instanceStarts = [];
|
|
4990
|
-
while (dayMarker < endMarker) {
|
|
4991
|
-
let instanceStart;
|
|
4992
|
-
// if everyday, or this particular day-of-week
|
|
4993
|
-
if (!dowHash || dowHash[dayMarker.getUTCDay()]) {
|
|
4994
|
-
if (startTime) {
|
|
4995
|
-
instanceStart = dateEnv.add(dayMarker, startTime);
|
|
4996
|
-
}
|
|
4997
|
-
else {
|
|
4998
|
-
instanceStart = dayMarker;
|
|
4999
|
-
}
|
|
5000
|
-
instanceStarts.push(instanceStart);
|
|
5001
|
-
}
|
|
5002
|
-
dayMarker = addDays(dayMarker, 1);
|
|
5003
|
-
}
|
|
5004
|
-
return instanceStarts;
|
|
5005
|
-
}
|
|
5006
|
-
|
|
5007
|
-
const changeHandlerPlugin = createPlugin({
|
|
5008
|
-
name: 'change-handler',
|
|
5009
|
-
optionChangeHandlers: {
|
|
5010
|
-
events(events, context) {
|
|
5011
|
-
handleEventSources([events], context);
|
|
5012
|
-
},
|
|
5013
|
-
eventSources: handleEventSources,
|
|
5014
|
-
},
|
|
5015
|
-
});
|
|
5016
|
-
/*
|
|
5017
|
-
BUG: if `event` was supplied, all previously-given `eventSources` will be wiped out
|
|
5018
|
-
*/
|
|
5019
|
-
function handleEventSources(inputs, context) {
|
|
5020
|
-
let unfoundSources = hashValuesToArray(context.getCurrentData().eventSources);
|
|
5021
|
-
let newInputs = [];
|
|
5022
|
-
for (let input of inputs) {
|
|
5023
|
-
let inputFound = false;
|
|
5024
|
-
for (let i = 0; i < unfoundSources.length; i += 1) {
|
|
5025
|
-
if (unfoundSources[i]._raw === input) {
|
|
5026
|
-
unfoundSources.splice(i, 1); // delete
|
|
5027
|
-
inputFound = true;
|
|
5028
|
-
break;
|
|
5029
|
-
}
|
|
5030
|
-
}
|
|
5031
|
-
if (!inputFound) {
|
|
5032
|
-
newInputs.push(input);
|
|
5033
|
-
}
|
|
5034
|
-
}
|
|
5035
|
-
for (let unfoundSource of unfoundSources) {
|
|
5036
|
-
context.dispatch({
|
|
5037
|
-
type: 'REMOVE_EVENT_SOURCE',
|
|
5038
|
-
sourceId: unfoundSource.sourceId,
|
|
5039
|
-
});
|
|
5040
|
-
}
|
|
5041
|
-
for (let newInput of newInputs) {
|
|
5042
|
-
context.calendarApi.addEventSource(newInput);
|
|
5043
|
-
}
|
|
5044
|
-
}
|
|
5045
|
-
|
|
5046
|
-
function handleDateProfile(dateProfile, context) {
|
|
5047
|
-
context.emitter.trigger('datesSet', Object.assign(Object.assign({}, buildRangeApiWithTimeZone(dateProfile.activeRange, context.dateEnv)), { view: context.viewApi }));
|
|
5048
|
-
}
|
|
5049
|
-
|
|
5050
|
-
function handleEventStore(eventStore, context) {
|
|
5051
|
-
let { emitter } = context;
|
|
5052
|
-
if (emitter.hasHandlers('eventsSet')) {
|
|
5053
|
-
emitter.trigger('eventsSet', buildEventApis(eventStore, context));
|
|
5054
|
-
}
|
|
5055
|
-
}
|
|
5056
|
-
|
|
5057
|
-
/*
|
|
5058
|
-
this array is exposed on the root namespace so that UMD plugins can add to it.
|
|
5059
|
-
see the rollup-bundles script.
|
|
5060
|
-
*/
|
|
5061
|
-
const globalPlugins = [
|
|
5062
|
-
arrayEventSourcePlugin,
|
|
5063
|
-
funcEventSourcePlugin,
|
|
5064
|
-
jsonFeedEventSourcePlugin,
|
|
5065
|
-
simpleRecurringEventsPlugin,
|
|
5066
|
-
changeHandlerPlugin,
|
|
5067
|
-
createPlugin({
|
|
5068
|
-
name: 'misc',
|
|
5069
|
-
isLoadingFuncs: [
|
|
5070
|
-
(state) => computeEventSourcesLoading(state.eventSources),
|
|
5071
|
-
],
|
|
5072
|
-
propSetHandlers: {
|
|
5073
|
-
dateProfile: handleDateProfile,
|
|
5074
|
-
eventStore: handleEventStore,
|
|
5075
|
-
},
|
|
5076
|
-
}),
|
|
5077
|
-
];
|
|
5078
|
-
|
|
5079
4513
|
let canVGrowWithinCell;
|
|
5080
4514
|
function getCanVGrowWithinCell() {
|
|
5081
4515
|
if (canVGrowWithinCell == null) {
|
|
@@ -7439,10 +6873,10 @@ class EventContainer extends BaseComponent {
|
|
|
7439
6873
|
constructor() {
|
|
7440
6874
|
super(...arguments);
|
|
7441
6875
|
this.handleEl = (el) => {
|
|
6876
|
+
this.el = el;
|
|
7442
6877
|
if (el) {
|
|
7443
6878
|
setElSeg(el, this.props.seg);
|
|
7444
6879
|
}
|
|
7445
|
-
// TODO: when null, should unset to avoid memory leaks?
|
|
7446
6880
|
};
|
|
7447
6881
|
}
|
|
7448
6882
|
render() {
|
|
@@ -7477,6 +6911,11 @@ class EventContainer extends BaseComponent {
|
|
|
7477
6911
|
...(props.elClasses || []),
|
|
7478
6912
|
], renderProps: renderProps, generatorName: "eventContent", generator: options.eventContent || props.defaultGenerator, classNameGenerator: options.eventClassNames, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount })));
|
|
7479
6913
|
}
|
|
6914
|
+
componentDidUpdate(prevProps) {
|
|
6915
|
+
if (this.el && this.props.seg !== prevProps.seg) {
|
|
6916
|
+
setElSeg(this.el, this.props.seg);
|
|
6917
|
+
}
|
|
6918
|
+
}
|
|
7480
6919
|
}
|
|
7481
6920
|
|
|
7482
6921
|
// should not be a purecomponent
|
|
@@ -7921,18 +7360,20 @@ exports.allowSelection = allowSelection;
|
|
|
7921
7360
|
exports.applyMutationToEventStore = applyMutationToEventStore;
|
|
7922
7361
|
exports.applyStyle = applyStyle;
|
|
7923
7362
|
exports.applyStyleProp = applyStyleProp;
|
|
7363
|
+
exports.arrayToHash = arrayToHash;
|
|
7924
7364
|
exports.asCleanDays = asCleanDays;
|
|
7925
7365
|
exports.asRoughMinutes = asRoughMinutes;
|
|
7926
7366
|
exports.asRoughMs = asRoughMs;
|
|
7927
7367
|
exports.asRoughSeconds = asRoughSeconds;
|
|
7928
7368
|
exports.binarySearch = binarySearch;
|
|
7929
|
-
exports.buildBuildPluginHooks = buildBuildPluginHooks;
|
|
7930
7369
|
exports.buildElAttrs = buildElAttrs;
|
|
7931
7370
|
exports.buildEntryKey = buildEntryKey;
|
|
7932
7371
|
exports.buildEventApis = buildEventApis;
|
|
7933
7372
|
exports.buildEventRangeKey = buildEventRangeKey;
|
|
7373
|
+
exports.buildEventSourceRefiners = buildEventSourceRefiners;
|
|
7934
7374
|
exports.buildIsoString = buildIsoString;
|
|
7935
7375
|
exports.buildNavLinkAttrs = buildNavLinkAttrs;
|
|
7376
|
+
exports.buildRangeApiWithTimeZone = buildRangeApiWithTimeZone;
|
|
7936
7377
|
exports.buildSegTimeText = buildSegTimeText;
|
|
7937
7378
|
exports.buildViewClassNames = buildViewClassNames;
|
|
7938
7379
|
exports.buildViewContext = buildViewContext;
|
|
@@ -7943,7 +7384,6 @@ exports.compareNumbers = compareNumbers;
|
|
|
7943
7384
|
exports.compareObjs = compareObjs;
|
|
7944
7385
|
exports.computeEarliestSegStart = computeEarliestSegStart;
|
|
7945
7386
|
exports.computeEdges = computeEdges;
|
|
7946
|
-
exports.computeEventSourcesLoading = computeEventSourcesLoading;
|
|
7947
7387
|
exports.computeFallbackHeaderFormat = computeFallbackHeaderFormat;
|
|
7948
7388
|
exports.computeInnerRect = computeInnerRect;
|
|
7949
7389
|
exports.computeRect = computeRect;
|
|
@@ -7957,7 +7397,6 @@ exports.createEmptyEventStore = createEmptyEventStore;
|
|
|
7957
7397
|
exports.createEventInstance = createEventInstance;
|
|
7958
7398
|
exports.createEventUi = createEventUi;
|
|
7959
7399
|
exports.createFormatter = createFormatter;
|
|
7960
|
-
exports.createPlugin = createPlugin;
|
|
7961
7400
|
exports.diffDates = diffDates;
|
|
7962
7401
|
exports.diffDayAndTime = diffDayAndTime;
|
|
7963
7402
|
exports.diffDays = diffDays;
|
|
@@ -8003,16 +7442,14 @@ exports.getSlotClassNames = getSlotClassNames;
|
|
|
8003
7442
|
exports.getStickyFooterScrollbar = getStickyFooterScrollbar;
|
|
8004
7443
|
exports.getStickyHeaderDates = getStickyHeaderDates;
|
|
8005
7444
|
exports.getUniqueDomId = getUniqueDomId;
|
|
8006
|
-
exports.globalLocales = globalLocales;
|
|
8007
|
-
exports.globalPlugins = globalPlugins;
|
|
8008
7445
|
exports.greatestDurationDenominator = greatestDurationDenominator;
|
|
8009
7446
|
exports.groupIntersectingEntries = groupIntersectingEntries;
|
|
8010
7447
|
exports.guid = guid;
|
|
8011
7448
|
exports.hasBgRendering = hasBgRendering;
|
|
8012
7449
|
exports.hasCustomDayCellContent = hasCustomDayCellContent;
|
|
8013
7450
|
exports.hasShrinkWidth = hasShrinkWidth;
|
|
7451
|
+
exports.hashValuesToArray = hashValuesToArray;
|
|
8014
7452
|
exports.identity = identity;
|
|
8015
|
-
exports.initEventSources = initEventSources;
|
|
8016
7453
|
exports.injectStyles = injectStyles;
|
|
8017
7454
|
exports.interactionSettingsStore = interactionSettingsStore;
|
|
8018
7455
|
exports.interactionSettingsToStore = interactionSettingsToStore;
|
|
@@ -8046,6 +7483,7 @@ exports.parseBusinessHours = parseBusinessHours;
|
|
|
8046
7483
|
exports.parseClassNames = parseClassNames;
|
|
8047
7484
|
exports.parseDragMeta = parseDragMeta;
|
|
8048
7485
|
exports.parseEventDef = parseEventDef;
|
|
7486
|
+
exports.parseEventSource = parseEventSource;
|
|
8049
7487
|
exports.parseFieldSpecs = parseFieldSpecs;
|
|
8050
7488
|
exports.parseInteractionSettings = parseInteractionSettings;
|
|
8051
7489
|
exports.pointInsideRect = pointInsideRect;
|
|
@@ -8057,8 +7495,6 @@ exports.rangeContainsRange = rangeContainsRange;
|
|
|
8057
7495
|
exports.rangesEqual = rangesEqual;
|
|
8058
7496
|
exports.rangesIntersect = rangesIntersect;
|
|
8059
7497
|
exports.reduceCurrentDate = reduceCurrentDate;
|
|
8060
|
-
exports.reduceEventSources = reduceEventSources;
|
|
8061
|
-
exports.reduceEventSourcesNewTimeZone = reduceEventSourcesNewTimeZone;
|
|
8062
7498
|
exports.reduceEventStore = reduceEventStore;
|
|
8063
7499
|
exports.refineEventDef = refineEventDef;
|
|
8064
7500
|
exports.refineProps = refineProps;
|
|
@@ -8075,6 +7511,7 @@ exports.setRef = setRef;
|
|
|
8075
7511
|
exports.sliceEventStore = sliceEventStore;
|
|
8076
7512
|
exports.sortEventSegs = sortEventSegs;
|
|
8077
7513
|
exports.startOfDay = startOfDay;
|
|
7514
|
+
exports.subtractDurations = subtractDurations;
|
|
8078
7515
|
exports.translateRect = translateRect;
|
|
8079
7516
|
exports.triggerDateSelect = triggerDateSelect;
|
|
8080
7517
|
exports.unpromisify = unpromisify;
|