@fullcalendar/core 6.0.3 → 6.1.0
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.d.ts +1 -1
- package/index.esm.js +61 -36
- package/index.global.js +293 -150
- package/index.global.min.js +2 -2
- package/index.js +59 -34
- package/internal-common.d.ts +39 -19
- package/internal-common.esm.js +285 -167
- package/internal-common.js +285 -166
- package/internal.d.ts +1 -1
- package/internal.esm.js +1 -1
- package/internal.js +1 -1
- package/locales/af.global.js +1 -1
- package/locales/af.global.min.js +1 -1
- package/locales/ar-dz.esm.js +1 -0
- package/locales/ar-dz.global.js +2 -1
- package/locales/ar-dz.global.min.js +2 -2
- package/locales/ar-dz.js +1 -0
- package/locales/ar-kw.esm.js +1 -0
- package/locales/ar-kw.global.js +2 -1
- package/locales/ar-kw.global.min.js +2 -2
- package/locales/ar-kw.js +1 -0
- package/locales/ar-ly.esm.js +1 -0
- package/locales/ar-ly.global.js +2 -1
- package/locales/ar-ly.global.min.js +2 -2
- package/locales/ar-ly.js +1 -0
- package/locales/ar-ma.esm.js +1 -0
- package/locales/ar-ma.global.js +2 -1
- package/locales/ar-ma.global.min.js +2 -2
- package/locales/ar-ma.js +1 -0
- package/locales/ar-sa.esm.js +1 -0
- package/locales/ar-sa.global.js +2 -1
- package/locales/ar-sa.global.min.js +2 -2
- package/locales/ar-sa.js +1 -0
- package/locales/ar-tn.esm.js +1 -0
- package/locales/ar-tn.global.js +2 -1
- package/locales/ar-tn.global.min.js +2 -2
- package/locales/ar-tn.js +1 -0
- package/locales/ar.esm.js +1 -0
- package/locales/ar.global.js +2 -1
- package/locales/ar.global.min.js +2 -2
- package/locales/ar.js +1 -0
- package/locales/az.esm.js +1 -0
- package/locales/az.global.js +2 -1
- package/locales/az.global.min.js +2 -2
- package/locales/az.js +1 -0
- package/locales/bg.esm.js +1 -0
- package/locales/bg.global.js +2 -1
- package/locales/bg.global.min.js +2 -2
- package/locales/bg.js +1 -0
- package/locales/bn.esm.js +1 -0
- package/locales/bn.global.js +2 -1
- package/locales/bn.global.min.js +2 -2
- package/locales/bn.js +1 -0
- package/locales/bs.esm.js +1 -0
- package/locales/bs.global.js +2 -1
- package/locales/bs.global.min.js +2 -2
- package/locales/bs.js +1 -0
- package/locales/ca.esm.js +1 -0
- package/locales/ca.global.js +2 -1
- package/locales/ca.global.min.js +2 -2
- package/locales/ca.js +1 -0
- package/locales/cs.esm.js +1 -0
- package/locales/cs.global.js +2 -1
- package/locales/cs.global.min.js +2 -2
- package/locales/cs.js +1 -0
- package/locales/cy.global.js +1 -1
- package/locales/cy.global.min.js +1 -1
- package/locales/da.esm.js +1 -0
- package/locales/da.global.js +2 -1
- package/locales/da.global.min.js +2 -2
- package/locales/da.js +1 -0
- package/locales/de-at.global.js +1 -1
- package/locales/de-at.global.min.js +1 -1
- package/locales/de.global.js +1 -1
- package/locales/de.global.min.js +1 -1
- package/locales/el.esm.js +1 -0
- package/locales/el.global.js +2 -1
- package/locales/el.global.min.js +2 -2
- package/locales/el.js +1 -0
- package/locales/en-au.global.js +1 -1
- package/locales/en-au.global.min.js +1 -1
- package/locales/en-gb.global.js +1 -1
- package/locales/en-gb.global.min.js +1 -1
- package/locales/en-nz.global.js +1 -1
- package/locales/en-nz.global.min.js +1 -1
- package/locales/eo.esm.js +1 -0
- package/locales/eo.global.js +2 -1
- package/locales/eo.global.min.js +2 -2
- package/locales/eo.js +1 -0
- package/locales/es-us.esm.js +1 -0
- package/locales/es-us.global.js +2 -1
- package/locales/es-us.global.min.js +2 -2
- package/locales/es-us.js +1 -0
- package/locales/es.esm.js +1 -0
- package/locales/es.global.js +2 -1
- package/locales/es.global.min.js +2 -2
- package/locales/es.js +1 -0
- package/locales/et.esm.js +1 -0
- package/locales/et.global.js +2 -1
- package/locales/et.global.min.js +2 -2
- package/locales/et.js +1 -0
- package/locales/eu.esm.js +1 -0
- package/locales/eu.global.js +2 -1
- package/locales/eu.global.min.js +2 -2
- package/locales/eu.js +1 -0
- package/locales/fa.esm.js +1 -0
- package/locales/fa.global.js +2 -1
- package/locales/fa.global.min.js +2 -2
- package/locales/fa.js +1 -0
- package/locales/fi.esm.js +1 -0
- package/locales/fi.global.js +2 -1
- package/locales/fi.global.min.js +2 -2
- package/locales/fi.js +1 -0
- package/locales/fr-ca.esm.js +1 -1
- package/locales/fr-ca.global.js +2 -2
- package/locales/fr-ca.global.min.js +2 -2
- package/locales/fr-ca.js +1 -1
- package/locales/fr-ch.esm.js +1 -1
- package/locales/fr-ch.global.js +2 -2
- package/locales/fr-ch.global.min.js +2 -2
- package/locales/fr-ch.js +1 -1
- package/locales/fr.esm.js +2 -1
- package/locales/fr.global.js +3 -2
- package/locales/fr.global.min.js +2 -2
- package/locales/fr.js +2 -1
- package/locales/gl.esm.js +20 -0
- package/locales/gl.global.js +21 -1
- package/locales/gl.global.min.js +2 -2
- package/locales/gl.js +20 -0
- package/locales/he.esm.js +1 -0
- package/locales/he.global.js +2 -1
- package/locales/he.global.min.js +2 -2
- package/locales/he.js +1 -0
- package/locales/hi.esm.js +1 -0
- package/locales/hi.global.js +2 -1
- package/locales/hi.global.min.js +2 -2
- package/locales/hi.js +1 -0
- package/locales/hr.esm.js +1 -0
- package/locales/hr.global.js +2 -1
- package/locales/hr.global.min.js +2 -2
- package/locales/hr.js +1 -0
- package/locales/hu.esm.js +1 -0
- package/locales/hu.global.js +2 -1
- package/locales/hu.global.min.js +2 -2
- package/locales/hu.js +1 -0
- package/locales/hy-am.esm.js +1 -0
- package/locales/hy-am.global.js +2 -1
- package/locales/hy-am.global.min.js +2 -2
- package/locales/hy-am.js +1 -0
- package/locales/id.esm.js +1 -0
- package/locales/id.global.js +2 -1
- package/locales/id.global.min.js +2 -2
- package/locales/id.js +1 -0
- package/locales/is.esm.js +1 -0
- package/locales/is.global.js +2 -1
- package/locales/is.global.min.js +2 -2
- package/locales/is.js +1 -0
- package/locales/it.esm.js +1 -0
- package/locales/it.global.js +2 -1
- package/locales/it.global.min.js +2 -2
- package/locales/it.js +1 -0
- package/locales/ja.esm.js +1 -0
- package/locales/ja.global.js +2 -1
- package/locales/ja.global.min.js +2 -2
- package/locales/ja.js +1 -0
- package/locales/ka.esm.js +1 -0
- package/locales/ka.global.js +2 -1
- package/locales/ka.global.min.js +2 -2
- package/locales/ka.js +1 -0
- package/locales/kk.esm.js +1 -0
- package/locales/kk.global.js +2 -1
- package/locales/kk.global.min.js +2 -2
- package/locales/kk.js +1 -0
- package/locales/km.global.js +1 -1
- package/locales/km.global.min.js +1 -1
- package/locales/ko.esm.js +1 -0
- package/locales/ko.global.js +2 -1
- package/locales/ko.global.min.js +2 -2
- package/locales/ko.js +1 -0
- package/locales/ku.esm.js +1 -0
- package/locales/ku.global.js +2 -1
- package/locales/ku.global.min.js +2 -2
- package/locales/ku.js +1 -0
- package/locales/lb.esm.js +1 -0
- package/locales/lb.global.js +2 -1
- package/locales/lb.global.min.js +2 -2
- package/locales/lb.js +1 -0
- package/locales/lt.esm.js +1 -0
- package/locales/lt.global.js +2 -1
- package/locales/lt.global.min.js +2 -2
- package/locales/lt.js +1 -0
- package/locales/lv.esm.js +1 -0
- package/locales/lv.global.js +2 -1
- package/locales/lv.global.min.js +2 -2
- package/locales/lv.js +1 -0
- package/locales/mk.esm.js +1 -0
- package/locales/mk.global.js +2 -1
- package/locales/mk.global.min.js +2 -2
- package/locales/mk.js +1 -0
- package/locales/ms.esm.js +1 -0
- package/locales/ms.global.js +2 -1
- package/locales/ms.global.min.js +2 -2
- package/locales/ms.js +1 -0
- package/locales/nb.esm.js +1 -0
- package/locales/nb.global.js +2 -1
- package/locales/nb.global.min.js +2 -2
- package/locales/nb.js +1 -0
- package/locales/ne.esm.js +1 -0
- package/locales/ne.global.js +2 -1
- package/locales/ne.global.min.js +2 -2
- package/locales/ne.js +1 -0
- package/locales/nl.global.js +1 -1
- package/locales/nl.global.min.js +1 -1
- package/locales/nn.esm.js +1 -0
- package/locales/nn.global.js +2 -1
- package/locales/nn.global.min.js +2 -2
- package/locales/nn.js +1 -0
- package/locales/pl.esm.js +1 -0
- package/locales/pl.global.js +2 -1
- package/locales/pl.global.min.js +2 -2
- package/locales/pl.js +1 -0
- package/locales/pt-br.esm.js +22 -0
- package/locales/pt-br.global.js +23 -1
- package/locales/pt-br.global.min.js +2 -2
- package/locales/pt-br.js +22 -0
- package/locales/pt.esm.js +1 -0
- package/locales/pt.global.js +2 -1
- package/locales/pt.global.min.js +2 -2
- package/locales/pt.js +1 -0
- package/locales/ro.esm.js +1 -0
- package/locales/ro.global.js +2 -1
- package/locales/ro.global.min.js +2 -2
- package/locales/ro.js +1 -0
- package/locales/ru.esm.js +1 -0
- package/locales/ru.global.js +2 -1
- package/locales/ru.global.min.js +2 -2
- package/locales/ru.js +1 -0
- package/locales/si-lk.esm.js +1 -0
- package/locales/si-lk.global.js +2 -1
- package/locales/si-lk.global.min.js +2 -2
- package/locales/si-lk.js +1 -0
- package/locales/sk.esm.js +1 -0
- package/locales/sk.global.js +2 -1
- package/locales/sk.global.min.js +2 -2
- package/locales/sk.js +1 -0
- package/locales/sl.esm.js +1 -0
- package/locales/sl.global.js +2 -1
- package/locales/sl.global.min.js +2 -2
- package/locales/sl.js +1 -0
- package/locales/sm.esm.js +1 -0
- package/locales/sm.global.js +2 -1
- package/locales/sm.global.min.js +2 -2
- package/locales/sm.js +1 -0
- package/locales/sq.esm.js +2 -1
- package/locales/sq.global.js +3 -2
- package/locales/sq.global.min.js +2 -2
- package/locales/sq.js +2 -1
- package/locales/sr-cyrl.esm.js +1 -0
- package/locales/sr-cyrl.global.js +2 -1
- package/locales/sr-cyrl.global.min.js +2 -2
- package/locales/sr-cyrl.js +1 -0
- package/locales/sr.esm.js +1 -0
- package/locales/sr.global.js +2 -1
- package/locales/sr.global.min.js +2 -2
- package/locales/sr.js +1 -0
- package/locales/sv.esm.js +1 -0
- package/locales/sv.global.js +2 -1
- package/locales/sv.global.min.js +2 -2
- package/locales/sv.js +1 -0
- package/locales/ta-in.esm.js +1 -0
- package/locales/ta-in.global.js +2 -1
- package/locales/ta-in.global.min.js +2 -2
- package/locales/ta-in.js +1 -0
- package/locales/th.global.js +1 -1
- package/locales/th.global.min.js +1 -1
- package/locales/tr.esm.js +1 -0
- package/locales/tr.global.js +2 -1
- package/locales/tr.global.min.js +2 -2
- package/locales/tr.js +1 -0
- package/locales/ug.esm.js +4 -0
- package/locales/ug.global.js +5 -1
- package/locales/ug.global.min.js +2 -2
- package/locales/ug.js +4 -0
- package/locales/uk.esm.js +1 -0
- package/locales/uk.global.js +2 -1
- package/locales/uk.global.min.js +2 -2
- package/locales/uk.js +1 -0
- package/locales/uz-cy.d.ts +6 -0
- package/locales/uz-cy.esm.js +24 -0
- package/locales/uz-cy.global.js +34 -0
- package/locales/uz-cy.global.min.js +6 -0
- package/locales/uz-cy.js +28 -0
- package/locales/uz.esm.js +10 -2
- package/locales/uz.global.js +9 -1
- package/locales/uz.global.min.js +2 -2
- package/locales/uz.js +10 -2
- package/locales/vi.esm.js +3 -2
- package/locales/vi.global.js +2 -1
- package/locales/vi.global.min.js +2 -2
- package/locales/vi.js +3 -2
- package/locales/zh-cn.esm.js +3 -2
- package/locales/zh-cn.global.js +2 -1
- package/locales/zh-cn.global.min.js +2 -2
- package/locales/zh-cn.js +3 -2
- package/locales/zh-tw.esm.js +3 -2
- package/locales/zh-tw.global.js +2 -1
- package/locales/zh-tw.global.min.js +2 -2
- package/locales/zh-tw.js +3 -2
- package/locales-all.esm.js +6 -5
- package/locales-all.global.js +148 -9
- package/locales-all.global.min.js +2 -2
- package/locales-all.js +2 -1
- package/package.json +1 -1
- package/preact.esm.js +1 -1
package/internal-common.js
CHANGED
|
@@ -23,6 +23,59 @@ function _interopNamespace(e) {
|
|
|
23
23
|
|
|
24
24
|
var preact__namespace = /*#__PURE__*/_interopNamespace(preact);
|
|
25
25
|
|
|
26
|
+
/*
|
|
27
|
+
NOTE: this can be a public API, especially createElement for hooks.
|
|
28
|
+
See examples/typescript-scheduler/src/index.ts
|
|
29
|
+
*/
|
|
30
|
+
function flushSync(runBeforeFlush) {
|
|
31
|
+
runBeforeFlush();
|
|
32
|
+
let oldDebounceRendering = preact__namespace.options.debounceRendering; // orig
|
|
33
|
+
let callbackQ = [];
|
|
34
|
+
function execCallbackSync(callback) {
|
|
35
|
+
callbackQ.push(callback);
|
|
36
|
+
}
|
|
37
|
+
preact__namespace.options.debounceRendering = execCallbackSync;
|
|
38
|
+
preact__namespace.render(preact__namespace.createElement(FakeComponent, {}), document.createElement('div'));
|
|
39
|
+
while (callbackQ.length) {
|
|
40
|
+
callbackQ.shift()();
|
|
41
|
+
}
|
|
42
|
+
preact__namespace.options.debounceRendering = oldDebounceRendering;
|
|
43
|
+
}
|
|
44
|
+
class FakeComponent extends preact__namespace.Component {
|
|
45
|
+
render() { return preact__namespace.createElement('div', {}); }
|
|
46
|
+
componentDidMount() { this.setState({}); }
|
|
47
|
+
}
|
|
48
|
+
// TODO: use preact/compat instead?
|
|
49
|
+
function createContext(defaultValue) {
|
|
50
|
+
let ContextType = preact__namespace.createContext(defaultValue);
|
|
51
|
+
let origProvider = ContextType.Provider;
|
|
52
|
+
ContextType.Provider = function () {
|
|
53
|
+
let isNew = !this.getChildContext;
|
|
54
|
+
let children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
|
55
|
+
if (isNew) {
|
|
56
|
+
let subs = [];
|
|
57
|
+
this.shouldComponentUpdate = (_props) => {
|
|
58
|
+
if (this.props.value !== _props.value) {
|
|
59
|
+
subs.forEach((c) => {
|
|
60
|
+
c.context = _props.value;
|
|
61
|
+
c.forceUpdate();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
this.sub = (c) => {
|
|
66
|
+
subs.push(c);
|
|
67
|
+
let old = c.componentWillUnmount;
|
|
68
|
+
c.componentWillUnmount = () => {
|
|
69
|
+
subs.splice(subs.indexOf(c), 1);
|
|
70
|
+
old && old.call(c);
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return children;
|
|
75
|
+
};
|
|
76
|
+
return ContextType;
|
|
77
|
+
}
|
|
78
|
+
|
|
26
79
|
function removeElement(el) {
|
|
27
80
|
if (el.parentNode) {
|
|
28
81
|
el.parentNode.removeChild(el);
|
|
@@ -109,11 +162,6 @@ function getEventTargetViaRoot(ev) {
|
|
|
109
162
|
var _a, _b;
|
|
110
163
|
return (_b = (_a = ev.composedPath) === null || _a === void 0 ? void 0 : _a.call(ev)[0]) !== null && _b !== void 0 ? _b : ev.target;
|
|
111
164
|
}
|
|
112
|
-
// Shadow DOM consuderations
|
|
113
|
-
// ----------------------------------------------------------------------------------------------------------------
|
|
114
|
-
function getElRoot(el) {
|
|
115
|
-
return el.getRootNode ? el.getRootNode() : document;
|
|
116
|
-
}
|
|
117
165
|
// Unique ID for DOM attribute
|
|
118
166
|
let guid$1 = 0;
|
|
119
167
|
function getUniqueDomId() {
|
|
@@ -494,22 +542,24 @@ function mergeProps(propObjs, complexPropsMap) {
|
|
|
494
542
|
let dest = {};
|
|
495
543
|
if (complexPropsMap) {
|
|
496
544
|
for (let name in complexPropsMap) {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
let
|
|
501
|
-
|
|
502
|
-
|
|
545
|
+
if (complexPropsMap[name] === isMaybeObjectsEqual) { // implies that it's object-mergeable
|
|
546
|
+
let complexObjs = [];
|
|
547
|
+
// collect the trailing object values, stopping when a non-object is discovered
|
|
548
|
+
for (let i = propObjs.length - 1; i >= 0; i -= 1) {
|
|
549
|
+
let val = propObjs[i][name];
|
|
550
|
+
if (typeof val === 'object' && val) { // non-null object
|
|
551
|
+
complexObjs.unshift(val);
|
|
552
|
+
}
|
|
553
|
+
else if (val !== undefined) {
|
|
554
|
+
dest[name] = val; // if there were no objects, this value will be used
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
503
557
|
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
558
|
+
// if the trailing values were objects, use the merged value
|
|
559
|
+
if (complexObjs.length) {
|
|
560
|
+
dest[name] = mergeProps(complexObjs);
|
|
507
561
|
}
|
|
508
562
|
}
|
|
509
|
-
// if the trailing values were objects, use the merged value
|
|
510
|
-
if (complexObjs.length) {
|
|
511
|
-
dest[name] = mergeProps(complexObjs);
|
|
512
|
-
}
|
|
513
563
|
}
|
|
514
564
|
}
|
|
515
565
|
// copy values into the destination, going from last to first
|
|
@@ -647,6 +697,38 @@ function collectFromHash(hash, startIndex = 0, endIndex, step = 1) {
|
|
|
647
697
|
return res;
|
|
648
698
|
}
|
|
649
699
|
|
|
700
|
+
// TODO: new util arrayify?
|
|
701
|
+
function removeExact(array, exactVal) {
|
|
702
|
+
let removeCnt = 0;
|
|
703
|
+
let i = 0;
|
|
704
|
+
while (i < array.length) {
|
|
705
|
+
if (array[i] === exactVal) {
|
|
706
|
+
array.splice(i, 1);
|
|
707
|
+
removeCnt += 1;
|
|
708
|
+
}
|
|
709
|
+
else {
|
|
710
|
+
i += 1;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return removeCnt;
|
|
714
|
+
}
|
|
715
|
+
function isArraysEqual(a0, a1, equalityFunc) {
|
|
716
|
+
if (a0 === a1) {
|
|
717
|
+
return true;
|
|
718
|
+
}
|
|
719
|
+
let len = a0.length;
|
|
720
|
+
let i;
|
|
721
|
+
if (len !== a1.length) { // not array? or not same length?
|
|
722
|
+
return false;
|
|
723
|
+
}
|
|
724
|
+
for (i = 0; i < len; i += 1) {
|
|
725
|
+
if (!(equalityFunc ? equalityFunc(a0[i], a1[i]) : a0[i] === a1[i])) {
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return true;
|
|
730
|
+
}
|
|
731
|
+
|
|
650
732
|
const DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
|
651
733
|
// Adding
|
|
652
734
|
function addWeeks(m, n) {
|
|
@@ -837,6 +919,9 @@ function buildIsoString(marker, timeZoneOffset, stripZeroTime = false) {
|
|
|
837
919
|
function formatDayString(marker) {
|
|
838
920
|
return marker.toISOString().replace(/T.*$/, '');
|
|
839
921
|
}
|
|
922
|
+
function formatIsoMonthStr(marker) {
|
|
923
|
+
return marker.toISOString().match(/^\d{4}-\d{2}/)[0];
|
|
924
|
+
}
|
|
840
925
|
// TODO: use Date::toISOString and use everything after the T?
|
|
841
926
|
function formatIsoTimeString(marker) {
|
|
842
927
|
return padStart(marker.getUTCHours(), 2) + ':' +
|
|
@@ -854,38 +939,6 @@ function formatTimeZoneOffset(minutes, doIso = false) {
|
|
|
854
939
|
return `GMT${sign}${hours}${mins ? `:${padStart(mins, 2)}` : ''}`;
|
|
855
940
|
}
|
|
856
941
|
|
|
857
|
-
// TODO: new util arrayify?
|
|
858
|
-
function removeExact(array, exactVal) {
|
|
859
|
-
let removeCnt = 0;
|
|
860
|
-
let i = 0;
|
|
861
|
-
while (i < array.length) {
|
|
862
|
-
if (array[i] === exactVal) {
|
|
863
|
-
array.splice(i, 1);
|
|
864
|
-
removeCnt += 1;
|
|
865
|
-
}
|
|
866
|
-
else {
|
|
867
|
-
i += 1;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
return removeCnt;
|
|
871
|
-
}
|
|
872
|
-
function isArraysEqual(a0, a1, equalityFunc) {
|
|
873
|
-
if (a0 === a1) {
|
|
874
|
-
return true;
|
|
875
|
-
}
|
|
876
|
-
let len = a0.length;
|
|
877
|
-
let i;
|
|
878
|
-
if (len !== a1.length) { // not array? or not same length?
|
|
879
|
-
return false;
|
|
880
|
-
}
|
|
881
|
-
for (i = 0; i < len; i += 1) {
|
|
882
|
-
if (!(equalityFunc ? equalityFunc(a0[i], a1[i]) : a0[i] === a1[i])) {
|
|
883
|
-
return false;
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
return true;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
942
|
function memoize(workerFunc, resEquality, teardownFunc) {
|
|
890
943
|
let currentArgs;
|
|
891
944
|
let currentRes;
|
|
@@ -1479,7 +1532,6 @@ const BASE_OPTION_REFINERS = {
|
|
|
1479
1532
|
dateAlignment: String,
|
|
1480
1533
|
dateIncrement: createDuration,
|
|
1481
1534
|
hiddenDays: identity,
|
|
1482
|
-
monthMode: Boolean,
|
|
1483
1535
|
fixedWeekCount: Boolean,
|
|
1484
1536
|
validRange: identity,
|
|
1485
1537
|
visibleRange: identity,
|
|
@@ -1497,6 +1549,7 @@ const BASE_OPTION_REFINERS = {
|
|
|
1497
1549
|
moreLinkContent: identity,
|
|
1498
1550
|
moreLinkDidMount: identity,
|
|
1499
1551
|
moreLinkWillUnmount: identity,
|
|
1552
|
+
monthStartFormat: createFormatter,
|
|
1500
1553
|
// for connectors
|
|
1501
1554
|
// (can't be part of plugin system b/c must be provided at runtime)
|
|
1502
1555
|
handleCustomRendering: identity,
|
|
@@ -1556,6 +1609,7 @@ const BASE_OPTION_DEFAULTS = {
|
|
|
1556
1609
|
eventMinHeight: 15,
|
|
1557
1610
|
eventMinWidth: 30,
|
|
1558
1611
|
eventShortHeight: 30,
|
|
1612
|
+
monthStartFormat: { month: 'long', day: 'numeric' },
|
|
1559
1613
|
};
|
|
1560
1614
|
// calendar listeners
|
|
1561
1615
|
// ------------------
|
|
@@ -1599,6 +1653,10 @@ const COMPLEX_OPTION_COMPARATORS = {
|
|
|
1599
1653
|
buttonHints: isMaybeObjectsEqual,
|
|
1600
1654
|
buttonIcons: isMaybeObjectsEqual,
|
|
1601
1655
|
dateIncrement: isMaybeObjectsEqual,
|
|
1656
|
+
plugins: isMaybeArraysEqual,
|
|
1657
|
+
events: isMaybeArraysEqual,
|
|
1658
|
+
eventSources: isMaybeArraysEqual,
|
|
1659
|
+
['resources']: isMaybeArraysEqual,
|
|
1602
1660
|
};
|
|
1603
1661
|
function isMaybeObjectsEqual(a, b) {
|
|
1604
1662
|
if (typeof a === 'object' && typeof b === 'object' && a && b) { // both non-null objects
|
|
@@ -1606,6 +1664,12 @@ function isMaybeObjectsEqual(a, b) {
|
|
|
1606
1664
|
}
|
|
1607
1665
|
return a === b;
|
|
1608
1666
|
}
|
|
1667
|
+
function isMaybeArraysEqual(a, b) {
|
|
1668
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
1669
|
+
return isArraysEqual(a, b);
|
|
1670
|
+
}
|
|
1671
|
+
return a === b;
|
|
1672
|
+
}
|
|
1609
1673
|
// view-specific options
|
|
1610
1674
|
// ---------------------
|
|
1611
1675
|
const VIEW_OPTION_REFINERS = {
|
|
@@ -1721,11 +1785,11 @@ function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurr
|
|
|
1721
1785
|
return markers;
|
|
1722
1786
|
}
|
|
1723
1787
|
|
|
1724
|
-
function parseEvents(rawEvents, eventSource, context, allowOpenRange) {
|
|
1788
|
+
function parseEvents(rawEvents, eventSource, context, allowOpenRange, defIdMap, instanceIdMap) {
|
|
1725
1789
|
let eventStore = createEmptyEventStore();
|
|
1726
1790
|
let eventRefiners = buildEventRefiners(context);
|
|
1727
1791
|
for (let rawEvent of rawEvents) {
|
|
1728
|
-
let tuple = parseEvent(rawEvent, eventSource, context, allowOpenRange, eventRefiners);
|
|
1792
|
+
let tuple = parseEvent(rawEvent, eventSource, context, allowOpenRange, eventRefiners, defIdMap, instanceIdMap);
|
|
1729
1793
|
if (tuple) {
|
|
1730
1794
|
eventTupleToStore(tuple, eventStore);
|
|
1731
1795
|
}
|
|
@@ -1897,12 +1961,12 @@ const EVENT_DATE_REFINERS = {
|
|
|
1897
1961
|
allDay: Boolean,
|
|
1898
1962
|
};
|
|
1899
1963
|
const EVENT_REFINERS = Object.assign(Object.assign(Object.assign({}, EVENT_NON_DATE_REFINERS), EVENT_DATE_REFINERS), { extendedProps: identity });
|
|
1900
|
-
function parseEvent(raw, eventSource, context, allowOpenRange, refiners = buildEventRefiners(context)) {
|
|
1964
|
+
function parseEvent(raw, eventSource, context, allowOpenRange, refiners = buildEventRefiners(context), defIdMap, instanceIdMap) {
|
|
1901
1965
|
let { refined, extra } = refineEventDef(raw, context, refiners);
|
|
1902
1966
|
let defaultAllDay = computeIsDefaultAllDay(eventSource, context);
|
|
1903
1967
|
let recurringRes = parseRecurring(refined, defaultAllDay, context.dateEnv, context.pluginHooks.recurringTypes);
|
|
1904
1968
|
if (recurringRes) {
|
|
1905
|
-
let def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', recurringRes.allDay, Boolean(recurringRes.duration), context);
|
|
1969
|
+
let def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', recurringRes.allDay, Boolean(recurringRes.duration), context, defIdMap);
|
|
1906
1970
|
def.recurringDef = {
|
|
1907
1971
|
typeId: recurringRes.typeId,
|
|
1908
1972
|
typeData: recurringRes.typeData,
|
|
@@ -1912,8 +1976,11 @@ function parseEvent(raw, eventSource, context, allowOpenRange, refiners = buildE
|
|
|
1912
1976
|
}
|
|
1913
1977
|
let singleRes = parseSingle(refined, defaultAllDay, context, allowOpenRange);
|
|
1914
1978
|
if (singleRes) {
|
|
1915
|
-
let def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', singleRes.allDay, singleRes.hasEnd, context);
|
|
1979
|
+
let def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', singleRes.allDay, singleRes.hasEnd, context, defIdMap);
|
|
1916
1980
|
let instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo);
|
|
1981
|
+
if (instanceIdMap && def.publicId && instanceIdMap[def.publicId]) {
|
|
1982
|
+
instance.instanceId = instanceIdMap[def.publicId];
|
|
1983
|
+
}
|
|
1917
1984
|
return { def, instance };
|
|
1918
1985
|
}
|
|
1919
1986
|
return null;
|
|
@@ -1928,14 +1995,14 @@ function buildEventRefiners(context) {
|
|
|
1928
1995
|
Will NOT populate extendedProps with the leftover properties.
|
|
1929
1996
|
Will NOT populate date-related props.
|
|
1930
1997
|
*/
|
|
1931
|
-
function parseEventDef(refined, extra, sourceId, allDay, hasEnd, context) {
|
|
1998
|
+
function parseEventDef(refined, extra, sourceId, allDay, hasEnd, context, defIdMap) {
|
|
1932
1999
|
let def = {
|
|
1933
2000
|
title: refined.title || '',
|
|
1934
2001
|
groupId: refined.groupId || '',
|
|
1935
2002
|
publicId: refined.id || '',
|
|
1936
2003
|
url: refined.url || '',
|
|
1937
2004
|
recurringDef: null,
|
|
1938
|
-
defId: guid(),
|
|
2005
|
+
defId: ((defIdMap && refined.id) ? defIdMap[refined.id] : '') || guid(),
|
|
1939
2006
|
sourceId,
|
|
1940
2007
|
allDay,
|
|
1941
2008
|
hasEnd,
|
|
@@ -2942,59 +3009,6 @@ Theme.prototype.iconClasses = {};
|
|
|
2942
3009
|
Theme.prototype.baseIconClass = '';
|
|
2943
3010
|
Theme.prototype.iconOverridePrefix = '';
|
|
2944
3011
|
|
|
2945
|
-
/*
|
|
2946
|
-
NOTE: this can be a public API, especially createElement for hooks.
|
|
2947
|
-
See examples/typescript-scheduler/src/index.ts
|
|
2948
|
-
*/
|
|
2949
|
-
function flushSync(runBeforeFlush) {
|
|
2950
|
-
runBeforeFlush();
|
|
2951
|
-
let oldDebounceRendering = preact__namespace.options.debounceRendering; // orig
|
|
2952
|
-
let callbackQ = [];
|
|
2953
|
-
function execCallbackSync(callback) {
|
|
2954
|
-
callbackQ.push(callback);
|
|
2955
|
-
}
|
|
2956
|
-
preact__namespace.options.debounceRendering = execCallbackSync;
|
|
2957
|
-
preact__namespace.render(preact__namespace.createElement(FakeComponent, {}), document.createElement('div'));
|
|
2958
|
-
while (callbackQ.length) {
|
|
2959
|
-
callbackQ.shift()();
|
|
2960
|
-
}
|
|
2961
|
-
preact__namespace.options.debounceRendering = oldDebounceRendering;
|
|
2962
|
-
}
|
|
2963
|
-
class FakeComponent extends preact__namespace.Component {
|
|
2964
|
-
render() { return preact__namespace.createElement('div', {}); }
|
|
2965
|
-
componentDidMount() { this.setState({}); }
|
|
2966
|
-
}
|
|
2967
|
-
// TODO: use preact/compat instead?
|
|
2968
|
-
function createContext(defaultValue) {
|
|
2969
|
-
let ContextType = preact__namespace.createContext(defaultValue);
|
|
2970
|
-
let origProvider = ContextType.Provider;
|
|
2971
|
-
ContextType.Provider = function () {
|
|
2972
|
-
let isNew = !this.getChildContext;
|
|
2973
|
-
let children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
|
2974
|
-
if (isNew) {
|
|
2975
|
-
let subs = [];
|
|
2976
|
-
this.shouldComponentUpdate = (_props) => {
|
|
2977
|
-
if (this.props.value !== _props.value) {
|
|
2978
|
-
subs.forEach((c) => {
|
|
2979
|
-
c.context = _props.value;
|
|
2980
|
-
c.forceUpdate();
|
|
2981
|
-
});
|
|
2982
|
-
}
|
|
2983
|
-
};
|
|
2984
|
-
this.sub = (c) => {
|
|
2985
|
-
subs.push(c);
|
|
2986
|
-
let old = c.componentWillUnmount;
|
|
2987
|
-
c.componentWillUnmount = () => {
|
|
2988
|
-
subs.splice(subs.indexOf(c), 1);
|
|
2989
|
-
old && old.call(c);
|
|
2990
|
-
};
|
|
2991
|
-
};
|
|
2992
|
-
}
|
|
2993
|
-
return children;
|
|
2994
|
-
};
|
|
2995
|
-
return ContextType;
|
|
2996
|
-
}
|
|
2997
|
-
|
|
2998
3012
|
class ScrollResponder {
|
|
2999
3013
|
constructor(execFunc, emitter, scrollTime, scrollTimeReset) {
|
|
3000
3014
|
this.execFunc = execFunc;
|
|
@@ -3217,7 +3231,12 @@ class DateProfileGenerator {
|
|
|
3217
3231
|
// it's invalid if the originally requested date is not contained,
|
|
3218
3232
|
// or if the range is completely outside of the valid range.
|
|
3219
3233
|
isValid = rangesIntersect(currentInfo.range, validRange);
|
|
3234
|
+
// HACK: constrain to render-range so `currentDate` is more useful to view rendering
|
|
3235
|
+
if (!rangeContainsMarker(renderRange, currentDate)) {
|
|
3236
|
+
currentDate = renderRange.start;
|
|
3237
|
+
}
|
|
3220
3238
|
return {
|
|
3239
|
+
currentDate,
|
|
3221
3240
|
// constraint for where prev/next operations can go and where events can be dragged/resized to.
|
|
3222
3241
|
// an object with optional start and end properties.
|
|
3223
3242
|
validRange,
|
|
@@ -3903,7 +3922,9 @@ class EventImpl {
|
|
|
3903
3922
|
let def = this._def;
|
|
3904
3923
|
let { ui } = def;
|
|
3905
3924
|
let { startStr, endStr } = this;
|
|
3906
|
-
let res = {
|
|
3925
|
+
let res = {
|
|
3926
|
+
allDay: def.allDay,
|
|
3927
|
+
};
|
|
3907
3928
|
if (def.title) {
|
|
3908
3929
|
res.title = def.title;
|
|
3909
3930
|
}
|
|
@@ -5078,8 +5099,8 @@ class ContentInjector extends BaseComponent {
|
|
|
5078
5099
|
constructor() {
|
|
5079
5100
|
super(...arguments);
|
|
5080
5101
|
this.id = guid();
|
|
5081
|
-
this.currentDomNodes = [];
|
|
5082
5102
|
this.queuedDomNodes = [];
|
|
5103
|
+
this.currentDomNodes = [];
|
|
5083
5104
|
this.handleEl = (el) => {
|
|
5084
5105
|
if (this.props.elRef) {
|
|
5085
5106
|
setRef(this.props.elRef, el);
|
|
@@ -5089,34 +5110,45 @@ class ContentInjector extends BaseComponent {
|
|
|
5089
5110
|
render() {
|
|
5090
5111
|
const { props, context } = this;
|
|
5091
5112
|
const { options } = context;
|
|
5092
|
-
const {
|
|
5113
|
+
const { customGenerator, defaultGenerator, renderProps } = props;
|
|
5093
5114
|
const attrs = buildElAttrs(props);
|
|
5115
|
+
let useDefault = false;
|
|
5094
5116
|
let innerContent;
|
|
5095
5117
|
let queuedDomNodes = [];
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5118
|
+
let currentGeneratorMeta;
|
|
5119
|
+
if (customGenerator != null) {
|
|
5120
|
+
const customGeneratorRes = typeof customGenerator === 'function' ?
|
|
5121
|
+
customGenerator(renderProps, preact.createElement) :
|
|
5122
|
+
customGenerator;
|
|
5123
|
+
if (customGeneratorRes === true) {
|
|
5124
|
+
useDefault = true;
|
|
5099
5125
|
}
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
generator(renderProps, preact.createElement) :
|
|
5104
|
-
generator;
|
|
5105
|
-
if (typeof customContent === 'string' ||
|
|
5106
|
-
preact.isValidElement(customContent) ||
|
|
5107
|
-
Array.isArray(customContent)) {
|
|
5108
|
-
innerContent = customContent;
|
|
5109
|
-
}
|
|
5110
|
-
else if (typeof customContent === 'object') {
|
|
5111
|
-
if ('html' in customContent) {
|
|
5112
|
-
attrs.dangerouslySetInnerHTML = { __html: customContent.html };
|
|
5126
|
+
else {
|
|
5127
|
+
if (options.handleCustomRendering) { // non-Preact (likely React)
|
|
5128
|
+
currentGeneratorMeta = customGeneratorRes;
|
|
5113
5129
|
}
|
|
5114
|
-
else
|
|
5115
|
-
|
|
5130
|
+
else { // preact or { html, domNodes }
|
|
5131
|
+
const isObject = typeof customGeneratorRes === 'object';
|
|
5132
|
+
if (isObject && ('html' in customGeneratorRes)) {
|
|
5133
|
+
attrs.dangerouslySetInnerHTML = { __html: customGeneratorRes.html };
|
|
5134
|
+
}
|
|
5135
|
+
else if (isObject && ('domNodes' in customGeneratorRes)) {
|
|
5136
|
+
queuedDomNodes = Array.prototype.slice.call(customGeneratorRes.domNodes);
|
|
5137
|
+
}
|
|
5138
|
+
else {
|
|
5139
|
+
innerContent = customGeneratorRes;
|
|
5140
|
+
}
|
|
5116
5141
|
}
|
|
5117
5142
|
}
|
|
5118
5143
|
}
|
|
5144
|
+
else {
|
|
5145
|
+
useDefault = !hasCustomRenderingHandler(props.generatorName, options);
|
|
5146
|
+
}
|
|
5147
|
+
if (useDefault && defaultGenerator) {
|
|
5148
|
+
innerContent = defaultGenerator(renderProps);
|
|
5149
|
+
}
|
|
5119
5150
|
this.queuedDomNodes = queuedDomNodes;
|
|
5151
|
+
this.currentGeneratorMeta = currentGeneratorMeta;
|
|
5120
5152
|
return preact.createElement(props.elTag, attrs, innerContent);
|
|
5121
5153
|
}
|
|
5122
5154
|
componentDidMount() {
|
|
@@ -5131,12 +5163,14 @@ class ContentInjector extends BaseComponent {
|
|
|
5131
5163
|
this.triggerCustomRendering(false); // TODO: different API for removal?
|
|
5132
5164
|
}
|
|
5133
5165
|
triggerCustomRendering(isActive) {
|
|
5166
|
+
var _a;
|
|
5134
5167
|
const { props, context } = this;
|
|
5135
5168
|
const { handleCustomRendering, customRenderingMetaMap } = context.options;
|
|
5136
5169
|
if (handleCustomRendering) {
|
|
5137
|
-
const
|
|
5138
|
-
if (
|
|
5139
|
-
handleCustomRendering(Object.assign({ id: this.id, isActive, containerEl: this.base, reportNewContainerEl: this.handleEl,
|
|
5170
|
+
const generatorMeta = (_a = this.currentGeneratorMeta) !== null && _a !== void 0 ? _a : customRenderingMetaMap === null || customRenderingMetaMap === void 0 ? void 0 : customRenderingMetaMap[props.generatorName];
|
|
5171
|
+
if (generatorMeta) {
|
|
5172
|
+
handleCustomRendering(Object.assign({ id: this.id, isActive, containerEl: this.base, reportNewContainerEl: this.handleEl, // for customRenderingReplacesEl
|
|
5173
|
+
generatorMeta }, props));
|
|
5140
5174
|
}
|
|
5141
5175
|
}
|
|
5142
5176
|
}
|
|
@@ -5159,6 +5193,9 @@ ContentInjector.addPropsEquality({
|
|
|
5159
5193
|
renderProps: isPropsEqual,
|
|
5160
5194
|
});
|
|
5161
5195
|
// Util
|
|
5196
|
+
/*
|
|
5197
|
+
Does UI-framework provide custom way of rendering?
|
|
5198
|
+
*/
|
|
5162
5199
|
function hasCustomRenderingHandler(generatorName, options) {
|
|
5163
5200
|
var _a;
|
|
5164
5201
|
return Boolean(options.handleCustomRendering &&
|
|
@@ -5216,7 +5253,7 @@ class ContentContainer extends preact.Component {
|
|
|
5216
5253
|
ContentContainer.contextType = RenderId;
|
|
5217
5254
|
function InnerContentInjector(containerComponent, props) {
|
|
5218
5255
|
const parentProps = containerComponent.props;
|
|
5219
|
-
return preact.createElement((ContentInjector), Object.assign({ renderProps: parentProps.renderProps, generatorName: parentProps.generatorName,
|
|
5256
|
+
return preact.createElement((ContentInjector), Object.assign({ renderProps: parentProps.renderProps, generatorName: parentProps.generatorName, customGenerator: parentProps.customGenerator, defaultGenerator: parentProps.defaultGenerator, renderId: containerComponent.context }, props));
|
|
5220
5257
|
}
|
|
5221
5258
|
// Utils
|
|
5222
5259
|
function generateClassNames(classNameGenerator, renderProps) {
|
|
@@ -5240,7 +5277,7 @@ class TableDateCell extends BaseComponent {
|
|
|
5240
5277
|
? buildNavLinkAttrs(this.context, date)
|
|
5241
5278
|
: {};
|
|
5242
5279
|
let renderProps = Object.assign(Object.assign(Object.assign({ date: dateEnv.toDate(date), view: viewApi }, props.extraRenderProps), { text }), dayMeta);
|
|
5243
|
-
return (preact.createElement(ContentContainer, { elTag: "th", elClasses: classNames, elAttrs: Object.assign({ role: 'columnheader', colSpan: props.colSpan, 'data-date': !dayMeta.isDisabled ? formatDayString(date) : undefined }, props.extraDataAttrs), renderProps: renderProps, generatorName: "dayHeaderContent",
|
|
5280
|
+
return (preact.createElement(ContentContainer, { elTag: "th", elClasses: classNames, elAttrs: Object.assign({ role: 'columnheader', colSpan: props.colSpan, 'data-date': !dayMeta.isDisabled ? formatDayString(date) : undefined }, props.extraDataAttrs), renderProps: renderProps, generatorName: "dayHeaderContent", customGenerator: options.dayHeaderContent, defaultGenerator: renderInner$1, classNameGenerator: options.dayHeaderClassNames, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, (InnerContainer) => (preact.createElement("div", { className: "fc-scrollgrid-sync-inner" }, !dayMeta.isDisabled && (preact.createElement(InnerContainer, { elTag: "a", elAttrs: navLinkAttrs, elClasses: [
|
|
5244
5281
|
'fc-col-header-cell-cushion',
|
|
5245
5282
|
props.isSticky && 'fc-sticky',
|
|
5246
5283
|
] }))))));
|
|
@@ -5268,7 +5305,7 @@ class TableDowCell extends BaseComponent {
|
|
|
5268
5305
|
CLASS_NAME,
|
|
5269
5306
|
...getDayClassNames(dateMeta, theme),
|
|
5270
5307
|
...(props.extraClassNames || []),
|
|
5271
|
-
], elAttrs: Object.assign({ role: 'columnheader', colSpan: props.colSpan }, props.extraDataAttrs), renderProps: renderProps, generatorName: "dayHeaderContent",
|
|
5308
|
+
], elAttrs: Object.assign({ role: 'columnheader', colSpan: props.colSpan }, props.extraDataAttrs), renderProps: renderProps, generatorName: "dayHeaderContent", customGenerator: options.dayHeaderContent, defaultGenerator: renderInner$1, classNameGenerator: options.dayHeaderClassNames, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, (InnerContent) => (preact.createElement("div", { className: "fc-scrollgrid-sync-inner" },
|
|
5272
5309
|
preact.createElement(InnerContent, { elTag: "a", elClasses: [
|
|
5273
5310
|
'fc-col-header-cell-cushion',
|
|
5274
5311
|
props.isSticky && 'fc-sticky',
|
|
@@ -5501,7 +5538,7 @@ class Slicer {
|
|
|
5501
5538
|
let { eventUiBases } = props;
|
|
5502
5539
|
let eventSegs = this.sliceEventStore(props.eventStore, eventUiBases, dateProfile, nextDayThreshold, ...extraArgs);
|
|
5503
5540
|
return {
|
|
5504
|
-
dateSelectionSegs: this.sliceDateSelection(props.dateSelection, eventUiBases, context, ...extraArgs),
|
|
5541
|
+
dateSelectionSegs: this.sliceDateSelection(props.dateSelection, dateProfile, nextDayThreshold, eventUiBases, context, ...extraArgs),
|
|
5505
5542
|
businessHourSegs: this.sliceBusinessHours(props.businessHours, dateProfile, nextDayThreshold, context, ...extraArgs),
|
|
5506
5543
|
fgEventSegs: eventSegs.fg,
|
|
5507
5544
|
bgEventSegs: eventSegs.bg,
|
|
@@ -5511,9 +5548,9 @@ class Slicer {
|
|
|
5511
5548
|
}; // TODO: give interactionSegs?
|
|
5512
5549
|
}
|
|
5513
5550
|
sliceNowDate(// does not memoize
|
|
5514
|
-
date, context, ...extraArgs) {
|
|
5551
|
+
date, dateProfile, nextDayThreshold, context, ...extraArgs) {
|
|
5515
5552
|
return this._sliceDateSpan({ range: { start: date, end: addMs(date, 1) }, allDay: false }, // add 1 ms, protect against null range
|
|
5516
|
-
{}, context, ...extraArgs);
|
|
5553
|
+
dateProfile, nextDayThreshold, {}, context, ...extraArgs);
|
|
5517
5554
|
}
|
|
5518
5555
|
_sliceBusinessHours(businessHours, dateProfile, nextDayThreshold, context, ...extraArgs) {
|
|
5519
5556
|
if (!businessHours) {
|
|
@@ -5542,16 +5579,22 @@ class Slicer {
|
|
|
5542
5579
|
isEvent: interaction.isEvent,
|
|
5543
5580
|
};
|
|
5544
5581
|
}
|
|
5545
|
-
_sliceDateSpan(dateSpan, eventUiBases, context, ...extraArgs) {
|
|
5582
|
+
_sliceDateSpan(dateSpan, dateProfile, nextDayThreshold, eventUiBases, context, ...extraArgs) {
|
|
5546
5583
|
if (!dateSpan) {
|
|
5547
5584
|
return [];
|
|
5548
5585
|
}
|
|
5549
|
-
let
|
|
5550
|
-
let
|
|
5551
|
-
|
|
5552
|
-
|
|
5586
|
+
let activeRange = computeActiveRange(dateProfile, Boolean(nextDayThreshold));
|
|
5587
|
+
let activeDateSpanRange = intersectRanges(dateSpan.range, activeRange);
|
|
5588
|
+
if (activeDateSpanRange) {
|
|
5589
|
+
dateSpan = Object.assign(Object.assign({}, dateSpan), { range: activeDateSpanRange });
|
|
5590
|
+
let eventRange = fabricateEventRange(dateSpan, eventUiBases, context);
|
|
5591
|
+
let segs = this.sliceRange(dateSpan.range, ...extraArgs);
|
|
5592
|
+
for (let seg of segs) {
|
|
5593
|
+
seg.eventRange = eventRange;
|
|
5594
|
+
}
|
|
5595
|
+
return segs;
|
|
5553
5596
|
}
|
|
5554
|
-
return
|
|
5597
|
+
return [];
|
|
5555
5598
|
}
|
|
5556
5599
|
/*
|
|
5557
5600
|
"complete" seg means it has component and eventRange
|
|
@@ -5604,6 +5647,8 @@ function reduceEventStore(eventStore, action, eventSources, dateProfile, context
|
|
|
5604
5647
|
switch (action.type) {
|
|
5605
5648
|
case 'RECEIVE_EVENTS': // raw
|
|
5606
5649
|
return receiveRawEvents(eventStore, eventSources[action.sourceId], action.fetchId, action.fetchRange, action.rawEvents, context);
|
|
5650
|
+
case 'RESET_RAW_EVENTS':
|
|
5651
|
+
return resetRawEvents(eventStore, eventSources[action.sourceId], action.rawEvents, context);
|
|
5607
5652
|
case 'ADD_EVENTS': // already parsed, but not expanded
|
|
5608
5653
|
return addEvent(eventStore, action.eventStore, // new ones
|
|
5609
5654
|
dateProfile ? dateProfile.activeRange : null, context);
|
|
@@ -5644,6 +5689,14 @@ function receiveRawEvents(eventStore, eventSource, fetchId, fetchRange, rawEvent
|
|
|
5644
5689
|
}
|
|
5645
5690
|
return eventStore;
|
|
5646
5691
|
}
|
|
5692
|
+
function resetRawEvents(existingEventStore, eventSource, rawEvents, context) {
|
|
5693
|
+
const { defIdMap, instanceIdMap } = buildPublicIdMaps(existingEventStore);
|
|
5694
|
+
let newEventStore = parseEvents(transformRawEvents(rawEvents, eventSource, context), eventSource, context, false, defIdMap, instanceIdMap);
|
|
5695
|
+
if (eventSource.fetchRange) {
|
|
5696
|
+
newEventStore = expandRecurring(newEventStore, eventSource.fetchRange, context);
|
|
5697
|
+
}
|
|
5698
|
+
return newEventStore;
|
|
5699
|
+
}
|
|
5647
5700
|
function transformRawEvents(rawEvents, eventSource, context) {
|
|
5648
5701
|
let calEachTransform = context.options.eventDataTransform;
|
|
5649
5702
|
let sourceEachTransform = eventSource ? eventSource.eventDataTransform : null;
|
|
@@ -5704,6 +5757,27 @@ function excludeInstances(eventStore, removals) {
|
|
|
5704
5757
|
instances: filterHash(eventStore.instances, (instance) => !removals[instance.instanceId]),
|
|
5705
5758
|
};
|
|
5706
5759
|
}
|
|
5760
|
+
function buildPublicIdMaps(eventStore) {
|
|
5761
|
+
const { defs, instances } = eventStore;
|
|
5762
|
+
const defIdMap = {};
|
|
5763
|
+
const instanceIdMap = {};
|
|
5764
|
+
for (let defId in defs) {
|
|
5765
|
+
const def = defs[defId];
|
|
5766
|
+
const { publicId } = def;
|
|
5767
|
+
if (publicId) {
|
|
5768
|
+
defIdMap[publicId] = defId;
|
|
5769
|
+
}
|
|
5770
|
+
}
|
|
5771
|
+
for (let instanceId in instances) {
|
|
5772
|
+
const instance = instances[instanceId];
|
|
5773
|
+
const def = defs[instance.defId];
|
|
5774
|
+
const { publicId } = def;
|
|
5775
|
+
if (publicId) {
|
|
5776
|
+
instanceIdMap[publicId] = instanceId;
|
|
5777
|
+
}
|
|
5778
|
+
}
|
|
5779
|
+
return { defIdMap, instanceIdMap };
|
|
5780
|
+
}
|
|
5707
5781
|
|
|
5708
5782
|
// high-level segmenting-aware tester functions
|
|
5709
5783
|
// ------------------------------------------------------------------------------------------------------------------------
|
|
@@ -6456,7 +6530,7 @@ class EventContainer extends BaseComponent {
|
|
|
6456
6530
|
...getEventClassNames(renderProps),
|
|
6457
6531
|
...seg.eventRange.ui.classNames,
|
|
6458
6532
|
...(props.elClasses || []),
|
|
6459
|
-
], renderProps: renderProps, generatorName: "eventContent",
|
|
6533
|
+
], renderProps: renderProps, generatorName: "eventContent", customGenerator: options.eventContent, defaultGenerator: props.defaultGenerator, classNameGenerator: options.eventClassNames, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount })));
|
|
6460
6534
|
}
|
|
6461
6535
|
componentDidUpdate(prevProps) {
|
|
6462
6536
|
if (this.el && this.props.seg !== prevProps.seg) {
|
|
@@ -6497,7 +6571,7 @@ const NowIndicatorContainer = (props) => (preact.createElement(ViewContextType.C
|
|
|
6497
6571
|
date: context.dateEnv.toDate(props.date),
|
|
6498
6572
|
view: context.viewApi,
|
|
6499
6573
|
};
|
|
6500
|
-
return (preact.createElement(ContentContainer, Object.assign({}, props /* includes children */, { elTag: props.elTag || 'div', renderProps: renderProps, generatorName: "nowIndicatorContent",
|
|
6574
|
+
return (preact.createElement(ContentContainer, Object.assign({}, props /* includes children */, { elTag: props.elTag || 'div', renderProps: renderProps, generatorName: "nowIndicatorContent", customGenerator: options.nowIndicatorContent, classNameGenerator: options.nowIndicatorClassNames, didMount: options.nowIndicatorDidMount, willUnmount: options.nowIndicatorWillUnmount })));
|
|
6501
6575
|
}));
|
|
6502
6576
|
|
|
6503
6577
|
const DAY_NUM_FORMAT = createFormatter({ day: 'numeric' });
|
|
@@ -6513,15 +6587,17 @@ class DayCellContainer extends BaseComponent {
|
|
|
6513
6587
|
date: props.date,
|
|
6514
6588
|
dateProfile: props.dateProfile,
|
|
6515
6589
|
todayRange: props.todayRange,
|
|
6590
|
+
isMonthStart: props.isMonthStart || false,
|
|
6516
6591
|
showDayNumber: props.showDayNumber,
|
|
6517
6592
|
extraRenderProps: props.extraRenderProps,
|
|
6518
6593
|
viewApi: context.viewApi,
|
|
6519
6594
|
dateEnv: context.dateEnv,
|
|
6595
|
+
monthStartFormat: options.monthStartFormat,
|
|
6520
6596
|
});
|
|
6521
6597
|
return (preact.createElement(ContentContainer, Object.assign({}, props /* includes children */, { elClasses: [
|
|
6522
6598
|
...getDayClassNames(renderProps, context.theme),
|
|
6523
6599
|
...(props.elClasses || []),
|
|
6524
|
-
], elAttrs: Object.assign(Object.assign({}, props.elAttrs), (renderProps.isDisabled ? {} : { 'data-date': formatDayString(props.date) })), renderProps: renderProps, generatorName: "dayCellContent",
|
|
6600
|
+
], elAttrs: Object.assign(Object.assign({}, props.elAttrs), (renderProps.isDisabled ? {} : { 'data-date': formatDayString(props.date) })), renderProps: renderProps, generatorName: "dayCellContent", customGenerator: options.dayCellContent, defaultGenerator: props.defaultGenerator, classNameGenerator:
|
|
6525
6601
|
// don't use custom classNames if disabled
|
|
6526
6602
|
renderProps.isDisabled ? undefined : options.dayCellClassNames, didMount: options.dayCellDidMount, willUnmount: options.dayCellWillUnmount })));
|
|
6527
6603
|
}
|
|
@@ -6530,9 +6606,11 @@ function hasCustomDayCellContent(options) {
|
|
|
6530
6606
|
return Boolean(options.dayCellContent || hasCustomRenderingHandler('dayCellContent', options));
|
|
6531
6607
|
}
|
|
6532
6608
|
function refineRenderProps(raw) {
|
|
6533
|
-
let { date, dateEnv } = raw;
|
|
6534
|
-
let dayMeta = getDateMeta(date, raw.todayRange, null,
|
|
6535
|
-
|
|
6609
|
+
let { date, dateEnv, dateProfile, isMonthStart } = raw;
|
|
6610
|
+
let dayMeta = getDateMeta(date, raw.todayRange, null, dateProfile);
|
|
6611
|
+
let dayNumberText = raw.showDayNumber ? (dateEnv.format(date, isMonthStart ? raw.monthStartFormat : DAY_NUM_FORMAT)) : '';
|
|
6612
|
+
return Object.assign(Object.assign(Object.assign({ date: dateEnv.toDate(date), view: raw.viewApi }, dayMeta), { isMonthStart,
|
|
6613
|
+
dayNumberText }), raw.extraRenderProps);
|
|
6536
6614
|
}
|
|
6537
6615
|
|
|
6538
6616
|
class BgEvent extends BaseComponent {
|
|
@@ -6558,7 +6636,7 @@ const WeekNumberContainer = (props) => (preact.createElement(ViewContextType.Con
|
|
|
6558
6636
|
let text = dateEnv.format(date, format);
|
|
6559
6637
|
let renderProps = { num, text, date };
|
|
6560
6638
|
return (preact.createElement(ContentContainer // why isn't WeekNumberContentArg being auto-detected?
|
|
6561
|
-
, Object.assign({}, props /* includes children */, { renderProps: renderProps, generatorName: "weekNumberContent",
|
|
6639
|
+
, Object.assign({}, props /* includes children */, { renderProps: renderProps, generatorName: "weekNumberContent", customGenerator: options.weekNumberContent, defaultGenerator: renderInner, classNameGenerator: options.weekNumberClassNames, didMount: options.weekNumberDidMount, willUnmount: options.weekNumberWillUnmount })));
|
|
6562
6640
|
}));
|
|
6563
6641
|
function renderInner(innerProps) {
|
|
6564
6642
|
return innerProps.text;
|
|
@@ -6762,7 +6840,7 @@ class MoreLinkContainer extends BaseComponent {
|
|
|
6762
6840
|
Boolean(props.moreCnt) && (preact.createElement(ContentContainer, { elTag: props.elTag || 'a', elRef: this.handleLinkEl, elClasses: [
|
|
6763
6841
|
...(props.elClasses || []),
|
|
6764
6842
|
'fc-more-link',
|
|
6765
|
-
], elStyle: props.elStyle, elAttrs: Object.assign(Object.assign(Object.assign({}, props.elAttrs), createAriaClickAttrs(this.handleClick)), { title: hint, 'aria-expanded': state.isPopoverOpen, 'aria-controls': state.isPopoverOpen ? state.popoverId : '' }), renderProps: renderProps, generatorName: "moreLinkContent",
|
|
6843
|
+
], elStyle: props.elStyle, elAttrs: Object.assign(Object.assign(Object.assign({}, props.elAttrs), createAriaClickAttrs(this.handleClick)), { title: hint, 'aria-expanded': state.isPopoverOpen, 'aria-controls': state.isPopoverOpen ? state.popoverId : '' }), renderProps: renderProps, generatorName: "moreLinkContent", customGenerator: options.moreLinkContent, defaultGenerator: props.defaultGenerator || renderMoreLinkInner, classNameGenerator: options.moreLinkClassNames, didMount: options.moreLinkDidMount, willUnmount: options.moreLinkWillUnmount }, props.children)),
|
|
6766
6844
|
state.isPopoverOpen && (preact.createElement(MorePopover, { id: state.popoverId, startDate: range.start, endDate: range.end, dateProfile: props.dateProfile, todayRange: props.todayRange, extraDateSpan: props.extraDateSpan, parentEl: this.parentEl, alignmentEl: props.alignmentElRef ?
|
|
6767
6845
|
props.alignmentElRef.current :
|
|
6768
6846
|
this.linkEl, alignGridTop: props.alignGridTop, onClose: this.handlePopoverClose }, props.popoverContent()))));
|
|
@@ -6817,7 +6895,7 @@ class ViewContainer extends BaseComponent {
|
|
|
6817
6895
|
return (preact.createElement(ContentContainer, Object.assign({}, props, { elTag: props.elTag || 'div', elClasses: [
|
|
6818
6896
|
...buildViewClassNames(props.viewSpec),
|
|
6819
6897
|
...(props.elClasses || []),
|
|
6820
|
-
], renderProps: renderProps, classNameGenerator: options.viewClassNames, generatorName: undefined,
|
|
6898
|
+
], renderProps: renderProps, classNameGenerator: options.viewClassNames, generatorName: undefined, didMount: options.viewDidMount, willUnmount: options.viewWillUnmount }), () => props.children));
|
|
6821
6899
|
}
|
|
6822
6900
|
}
|
|
6823
6901
|
function buildViewClassNames(viewSpec) {
|
|
@@ -6827,20 +6905,60 @@ function buildViewClassNames(viewSpec) {
|
|
|
6827
6905
|
];
|
|
6828
6906
|
}
|
|
6829
6907
|
|
|
6908
|
+
const injectedStyleEls = [];
|
|
6909
|
+
const rootHasStyles = new WeakMap();
|
|
6910
|
+
if (typeof document !== 'undefined') {
|
|
6911
|
+
rootHasStyles.set(document, true);
|
|
6912
|
+
}
|
|
6913
|
+
/*
|
|
6914
|
+
Called from top-level core/plugin code
|
|
6915
|
+
*/
|
|
6830
6916
|
function injectStyles(css) {
|
|
6831
|
-
if (
|
|
6832
|
-
|
|
6917
|
+
if (css && typeof document !== 'undefined') {
|
|
6918
|
+
injectedStyleEls.push(injectStylesInParent(document.head, css));
|
|
6919
|
+
}
|
|
6920
|
+
}
|
|
6921
|
+
/*
|
|
6922
|
+
Called during calendar initialization
|
|
6923
|
+
*/
|
|
6924
|
+
function ensureElHasStyles(calendarEl) {
|
|
6925
|
+
const root = calendarEl.getRootNode();
|
|
6926
|
+
if (!rootHasStyles.get(root)) {
|
|
6927
|
+
rootHasStyles.set(root, true);
|
|
6928
|
+
for (const injectedStyleEl of injectedStyleEls) {
|
|
6929
|
+
injectStylesInParent(root, injectedStyleEl.innerText);
|
|
6930
|
+
}
|
|
6833
6931
|
}
|
|
6834
|
-
|
|
6932
|
+
}
|
|
6933
|
+
function injectStylesInParent(parentEl, css) {
|
|
6835
6934
|
const style = document.createElement('style');
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
style.styleSheet.cssText = css;
|
|
6935
|
+
const nonce = getNonceValue();
|
|
6936
|
+
if (nonce) {
|
|
6937
|
+
style.nonce = nonce;
|
|
6840
6938
|
}
|
|
6841
|
-
|
|
6842
|
-
|
|
6939
|
+
style.innerText = css;
|
|
6940
|
+
parentEl.appendChild(style);
|
|
6941
|
+
return style;
|
|
6942
|
+
}
|
|
6943
|
+
// nonce
|
|
6944
|
+
// -------------------------------------------------------------------------------------------------
|
|
6945
|
+
let queriedNonceValue;
|
|
6946
|
+
function getNonceValue() {
|
|
6947
|
+
if (queriedNonceValue === undefined) {
|
|
6948
|
+
queriedNonceValue = queryNonceValue();
|
|
6843
6949
|
}
|
|
6950
|
+
return queriedNonceValue;
|
|
6951
|
+
}
|
|
6952
|
+
function queryNonceValue() {
|
|
6953
|
+
const metaWithNonce = document.querySelector('meta[name="csp-nonce"]');
|
|
6954
|
+
if (metaWithNonce && metaWithNonce.hasAttribute('content')) {
|
|
6955
|
+
return metaWithNonce.getAttribute('content');
|
|
6956
|
+
}
|
|
6957
|
+
const elWithNonce = document.querySelector('script[nonce]');
|
|
6958
|
+
if (elWithNonce) {
|
|
6959
|
+
return elWithNonce.nonce || '';
|
|
6960
|
+
}
|
|
6961
|
+
return '';
|
|
6844
6962
|
}
|
|
6845
6963
|
|
|
6846
6964
|
const EVENT_SOURCE_REFINERS = {
|
|
@@ -7431,6 +7549,7 @@ exports.disableCursor = disableCursor;
|
|
|
7431
7549
|
exports.elementClosest = elementClosest;
|
|
7432
7550
|
exports.elementMatches = elementMatches;
|
|
7433
7551
|
exports.enableCursor = enableCursor;
|
|
7552
|
+
exports.ensureElHasStyles = ensureElHasStyles;
|
|
7434
7553
|
exports.eventTupleToStore = eventTupleToStore;
|
|
7435
7554
|
exports.filterHash = filterHash;
|
|
7436
7555
|
exports.findDirectChildren = findDirectChildren;
|
|
@@ -7438,6 +7557,7 @@ exports.findElements = findElements;
|
|
|
7438
7557
|
exports.flexibleCompare = flexibleCompare;
|
|
7439
7558
|
exports.flushSync = flushSync;
|
|
7440
7559
|
exports.formatDayString = formatDayString;
|
|
7560
|
+
exports.formatIsoMonthStr = formatIsoMonthStr;
|
|
7441
7561
|
exports.formatIsoTimeString = formatIsoTimeString;
|
|
7442
7562
|
exports.formatWithOrdinals = formatWithOrdinals;
|
|
7443
7563
|
exports.getAllowYScrolling = getAllowYScrolling;
|
|
@@ -7446,7 +7566,6 @@ exports.getClippingParents = getClippingParents;
|
|
|
7446
7566
|
exports.getDateMeta = getDateMeta;
|
|
7447
7567
|
exports.getDayClassNames = getDayClassNames;
|
|
7448
7568
|
exports.getDefaultEventEnd = getDefaultEventEnd;
|
|
7449
|
-
exports.getElRoot = getElRoot;
|
|
7450
7569
|
exports.getElSeg = getElSeg;
|
|
7451
7570
|
exports.getEntrySpanEnd = getEntrySpanEnd;
|
|
7452
7571
|
exports.getEventTargetViaRoot = getEventTargetViaRoot;
|