@fullcalendar/core 5.11.2 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.cjs.js +61 -74
- package/main.global.js +2783 -3212
- package/main.global.min.js +2 -2
- package/main.js +62 -75
- package/main.js.map +1 -1
- package/package.json +3 -3
- package/vdom.cjs.js +23 -30
- package/vdom.js +23 -30
package/main.js
CHANGED
|
@@ -1,72 +1,63 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar
|
|
2
|
+
FullCalendar v6.0.0-beta.1
|
|
3
3
|
Docs & License: https://fullcalendar.io/
|
|
4
4
|
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
6
6
|
import './vdom.js';
|
|
7
|
-
import {
|
|
8
|
-
import { flushSync, render, createElement, CalendarRoot, CustomContentRenderContext, CalendarContent, unmountComponentAtNode, DelayedRunner, CalendarDataManager, isArraysEqual, applyStyleProp, CalendarApi } from '@fullcalendar/common';
|
|
7
|
+
import { CalendarApi, flushSync, render, createElement, CalendarRoot, CustomContentRenderContext, CalendarContent, unmountComponentAtNode, DelayedRunner, CalendarDataManager, isArraysEqual, applyStyleProp } from '@fullcalendar/common';
|
|
9
8
|
export * from '@fullcalendar/common';
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_this.customContentRenderId = 0; // will affect custom generated classNames?
|
|
20
|
-
_this.handleAction = function (action) {
|
|
10
|
+
class Calendar extends CalendarApi {
|
|
11
|
+
constructor(el, optionOverrides = {}) {
|
|
12
|
+
super();
|
|
13
|
+
this.isRendering = false;
|
|
14
|
+
this.isRendered = false;
|
|
15
|
+
this.currentClassNames = [];
|
|
16
|
+
this.customContentRenderId = 0; // will affect custom generated classNames?
|
|
17
|
+
this.handleAction = (action) => {
|
|
21
18
|
// actions we know we want to render immediately
|
|
22
19
|
switch (action.type) {
|
|
23
20
|
case 'SET_EVENT_DRAG':
|
|
24
21
|
case 'SET_EVENT_RESIZE':
|
|
25
|
-
|
|
22
|
+
this.renderRunner.tryDrain();
|
|
26
23
|
}
|
|
27
24
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
this.handleData = (data) => {
|
|
26
|
+
this.currentData = data;
|
|
27
|
+
this.renderRunner.request(data.calendarOptions.rerenderDelay);
|
|
31
28
|
};
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
flushSync(
|
|
37
|
-
render(createElement(CalendarRoot, { options:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return (createElement(CustomContentRenderContext.Provider, { value:
|
|
41
|
-
createElement(CalendarContent,
|
|
42
|
-
}),
|
|
29
|
+
this.handleRenderRequest = () => {
|
|
30
|
+
if (this.isRendering) {
|
|
31
|
+
this.isRendered = true;
|
|
32
|
+
let { currentData } = this;
|
|
33
|
+
flushSync(() => {
|
|
34
|
+
render(createElement(CalendarRoot, { options: currentData.calendarOptions, theme: currentData.theme, emitter: currentData.emitter }, (classNames, height, isHeightAuto, forPrint) => {
|
|
35
|
+
this.setClassNames(classNames);
|
|
36
|
+
this.setHeight(height);
|
|
37
|
+
return (createElement(CustomContentRenderContext.Provider, { value: this.customContentRenderId },
|
|
38
|
+
createElement(CalendarContent, Object.assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData))));
|
|
39
|
+
}), this.el);
|
|
43
40
|
});
|
|
44
41
|
}
|
|
45
|
-
else if (
|
|
46
|
-
|
|
47
|
-
unmountComponentAtNode(
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
else if (this.isRendered) {
|
|
43
|
+
this.isRendered = false;
|
|
44
|
+
unmountComponentAtNode(this.el);
|
|
45
|
+
this.setClassNames([]);
|
|
46
|
+
this.setHeight('');
|
|
50
47
|
}
|
|
51
48
|
};
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
this.el = el;
|
|
50
|
+
this.renderRunner = new DelayedRunner(this.handleRenderRequest);
|
|
54
51
|
new CalendarDataManager({
|
|
55
|
-
optionOverrides
|
|
56
|
-
calendarApi:
|
|
57
|
-
onAction:
|
|
58
|
-
onData:
|
|
52
|
+
optionOverrides,
|
|
53
|
+
calendarApi: this,
|
|
54
|
+
onAction: this.handleAction,
|
|
55
|
+
onData: this.handleData,
|
|
59
56
|
});
|
|
60
|
-
return _this;
|
|
61
57
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
enumerable: false,
|
|
66
|
-
configurable: true
|
|
67
|
-
});
|
|
68
|
-
Calendar.prototype.render = function () {
|
|
69
|
-
var wasRendering = this.isRendering;
|
|
58
|
+
get view() { return this.currentData.viewApi; } // for public API
|
|
59
|
+
render() {
|
|
60
|
+
let wasRendering = this.isRendering;
|
|
70
61
|
if (!wasRendering) {
|
|
71
62
|
this.isRendering = true;
|
|
72
63
|
}
|
|
@@ -77,52 +68,48 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
77
68
|
if (wasRendering) {
|
|
78
69
|
this.updateSize();
|
|
79
70
|
}
|
|
80
|
-
}
|
|
81
|
-
|
|
71
|
+
}
|
|
72
|
+
destroy() {
|
|
82
73
|
if (this.isRendering) {
|
|
83
74
|
this.isRendering = false;
|
|
84
75
|
this.renderRunner.request();
|
|
85
76
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_super.prototype.updateSize.call(_this);
|
|
77
|
+
}
|
|
78
|
+
updateSize() {
|
|
79
|
+
flushSync(() => {
|
|
80
|
+
super.updateSize();
|
|
91
81
|
});
|
|
92
|
-
}
|
|
93
|
-
|
|
82
|
+
}
|
|
83
|
+
batchRendering(func) {
|
|
94
84
|
this.renderRunner.pause('batchRendering');
|
|
95
85
|
func();
|
|
96
86
|
this.renderRunner.resume('batchRendering');
|
|
97
|
-
}
|
|
98
|
-
|
|
87
|
+
}
|
|
88
|
+
pauseRendering() {
|
|
99
89
|
this.renderRunner.pause('pauseRendering');
|
|
100
|
-
}
|
|
101
|
-
|
|
90
|
+
}
|
|
91
|
+
resumeRendering() {
|
|
102
92
|
this.renderRunner.resume('pauseRendering', true);
|
|
103
|
-
}
|
|
104
|
-
|
|
93
|
+
}
|
|
94
|
+
resetOptions(optionOverrides, append) {
|
|
105
95
|
this.currentDataManager.resetOptions(optionOverrides, append);
|
|
106
|
-
}
|
|
107
|
-
|
|
96
|
+
}
|
|
97
|
+
setClassNames(classNames) {
|
|
108
98
|
if (!isArraysEqual(classNames, this.currentClassNames)) {
|
|
109
|
-
|
|
110
|
-
for (
|
|
111
|
-
var className = _a[_i];
|
|
99
|
+
let { classList } = this.el;
|
|
100
|
+
for (let className of this.currentClassNames) {
|
|
112
101
|
classList.remove(className);
|
|
113
102
|
}
|
|
114
|
-
for (
|
|
115
|
-
var className = classNames_1[_b];
|
|
103
|
+
for (let className of classNames) {
|
|
116
104
|
classList.add(className);
|
|
117
105
|
}
|
|
118
106
|
this.currentClassNames = classNames;
|
|
119
107
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
108
|
+
}
|
|
109
|
+
setHeight(height) {
|
|
122
110
|
applyStyleProp(this.el, 'height', height);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
}(CalendarApi));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
126
113
|
|
|
127
114
|
export { Calendar };
|
|
128
115
|
//# sourceMappingURL=main.js.map
|
package/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["src/Calendar.tsx"],"sourcesContent":["import {\n CalendarOptions, Action, CalendarContent, render, createElement, DelayedRunner, CssDimValue, applyStyleProp,\n CalendarApi, CalendarRoot, isArraysEqual, CalendarDataManager, CalendarData,\n CustomContentRenderContext, flushSync, unmountComponentAtNode,\n} from '@fullcalendar/common'\n\nexport class Calendar extends CalendarApi {\n currentData: CalendarData\n renderRunner: DelayedRunner\n el: HTMLElement\n isRendering = false\n isRendered = false\n currentClassNames: string[] = []\n customContentRenderId = 0 // will affect custom generated classNames?\n\n get view() { return this.currentData.viewApi } // for public API\n\n constructor(el: HTMLElement, optionOverrides: CalendarOptions = {}) {\n super()\n\n this.el = el\n this.renderRunner = new DelayedRunner(this.handleRenderRequest)\n\n new CalendarDataManager({ // eslint-disable-line no-new\n optionOverrides,\n calendarApi: this,\n onAction: this.handleAction,\n onData: this.handleData,\n })\n }\n\n handleAction = (action: Action) => {\n // actions we know we want to render immediately\n switch (action.type) {\n case 'SET_EVENT_DRAG':\n case 'SET_EVENT_RESIZE':\n this.renderRunner.tryDrain()\n }\n }\n\n handleData = (data: CalendarData) => {\n this.currentData = data\n this.renderRunner.request(data.calendarOptions.rerenderDelay)\n }\n\n handleRenderRequest = () => {\n if (this.isRendering) {\n this.isRendered = true\n let { currentData } = this\n\n flushSync(() => {\n render(\n <CalendarRoot options={currentData.calendarOptions} theme={currentData.theme} emitter={currentData.emitter}>\n {(classNames, height, isHeightAuto, forPrint) => {\n this.setClassNames(classNames)\n this.setHeight(height)\n\n return (\n <CustomContentRenderContext.Provider value={this.customContentRenderId}>\n <CalendarContent\n isHeightAuto={isHeightAuto}\n forPrint={forPrint}\n {...currentData}\n />\n </CustomContentRenderContext.Provider>\n )\n }}\n </CalendarRoot>,\n this.el,\n )\n })\n } else if (this.isRendered) {\n this.isRendered = false\n unmountComponentAtNode(this.el)\n this.setClassNames([])\n this.setHeight('')\n }\n }\n\n render() {\n let wasRendering = this.isRendering\n\n if (!wasRendering) {\n this.isRendering = true\n } else {\n this.customContentRenderId += 1\n }\n\n this.renderRunner.request()\n\n if (wasRendering) {\n this.updateSize()\n }\n }\n\n destroy() {\n if (this.isRendering) {\n this.isRendering = false\n this.renderRunner.request()\n }\n }\n\n updateSize() {\n flushSync(() => {\n super.updateSize()\n })\n }\n\n batchRendering(func) {\n this.renderRunner.pause('batchRendering')\n func()\n this.renderRunner.resume('batchRendering')\n }\n\n pauseRendering() { // available to plugins\n this.renderRunner.pause('pauseRendering')\n }\n\n resumeRendering() { // available to plugins\n this.renderRunner.resume('pauseRendering', true)\n }\n\n resetOptions(optionOverrides, append?) {\n this.currentDataManager.resetOptions(optionOverrides, append)\n }\n\n setClassNames(classNames: string[]) {\n if (!isArraysEqual(classNames, this.currentClassNames)) {\n let { classList } = this.el\n\n for (let className of this.currentClassNames) {\n classList.remove(className)\n }\n\n for (let className of classNames) {\n classList.add(className)\n }\n\n this.currentClassNames = classNames\n }\n }\n\n setHeight(height: CssDimValue) {\n applyStyleProp(this.el, 'height', height)\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.js","sources":["src/Calendar.tsx"],"sourcesContent":["import {\n CalendarOptions, Action, CalendarContent, render, createElement, DelayedRunner, CssDimValue, applyStyleProp,\n CalendarApi, CalendarRoot, isArraysEqual, CalendarDataManager, CalendarData,\n CustomContentRenderContext, flushSync, unmountComponentAtNode,\n} from '@fullcalendar/common'\n\nexport class Calendar extends CalendarApi {\n currentData: CalendarData\n renderRunner: DelayedRunner\n el: HTMLElement\n isRendering = false\n isRendered = false\n currentClassNames: string[] = []\n customContentRenderId = 0 // will affect custom generated classNames?\n\n get view() { return this.currentData.viewApi } // for public API\n\n constructor(el: HTMLElement, optionOverrides: CalendarOptions = {}) {\n super()\n\n this.el = el\n this.renderRunner = new DelayedRunner(this.handleRenderRequest)\n\n new CalendarDataManager({ // eslint-disable-line no-new\n optionOverrides,\n calendarApi: this,\n onAction: this.handleAction,\n onData: this.handleData,\n })\n }\n\n handleAction = (action: Action) => {\n // actions we know we want to render immediately\n switch (action.type) {\n case 'SET_EVENT_DRAG':\n case 'SET_EVENT_RESIZE':\n this.renderRunner.tryDrain()\n }\n }\n\n handleData = (data: CalendarData) => {\n this.currentData = data\n this.renderRunner.request(data.calendarOptions.rerenderDelay)\n }\n\n handleRenderRequest = () => {\n if (this.isRendering) {\n this.isRendered = true\n let { currentData } = this\n\n flushSync(() => {\n render(\n <CalendarRoot options={currentData.calendarOptions} theme={currentData.theme} emitter={currentData.emitter}>\n {(classNames, height, isHeightAuto, forPrint) => {\n this.setClassNames(classNames)\n this.setHeight(height)\n\n return (\n <CustomContentRenderContext.Provider value={this.customContentRenderId}>\n <CalendarContent\n isHeightAuto={isHeightAuto}\n forPrint={forPrint}\n {...currentData}\n />\n </CustomContentRenderContext.Provider>\n )\n }}\n </CalendarRoot>,\n this.el,\n )\n })\n } else if (this.isRendered) {\n this.isRendered = false\n unmountComponentAtNode(this.el)\n this.setClassNames([])\n this.setHeight('')\n }\n }\n\n render() {\n let wasRendering = this.isRendering\n\n if (!wasRendering) {\n this.isRendering = true\n } else {\n this.customContentRenderId += 1\n }\n\n this.renderRunner.request()\n\n if (wasRendering) {\n this.updateSize()\n }\n }\n\n destroy() {\n if (this.isRendering) {\n this.isRendering = false\n this.renderRunner.request()\n }\n }\n\n updateSize() {\n flushSync(() => {\n super.updateSize()\n })\n }\n\n batchRendering(func) {\n this.renderRunner.pause('batchRendering')\n func()\n this.renderRunner.resume('batchRendering')\n }\n\n pauseRendering() { // available to plugins\n this.renderRunner.pause('pauseRendering')\n }\n\n resumeRendering() { // available to plugins\n this.renderRunner.resume('pauseRendering', true)\n }\n\n resetOptions(optionOverrides, append?) {\n this.currentDataManager.resetOptions(optionOverrides, append)\n }\n\n setClassNames(classNames: string[]) {\n if (!isArraysEqual(classNames, this.currentClassNames)) {\n let { classList } = this.el\n\n for (let className of this.currentClassNames) {\n classList.remove(className)\n }\n\n for (let className of classNames) {\n classList.add(className)\n }\n\n this.currentClassNames = classNames\n }\n }\n\n setHeight(height: CssDimValue) {\n applyStyleProp(this.el, 'height', height)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;MAMa,QAAS,SAAQ,WAAW;IAWvC,YAAY,EAAe,EAAE,kBAAmC,EAAE;QAChE,KAAK,EAAE,CAAA;QART,gBAAW,GAAG,KAAK,CAAA;QACnB,eAAU,GAAG,KAAK,CAAA;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IAED,cAAc;QACZ,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;KAC1C;IAED,eAAe;QACb,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAA;KACjD;IAED,YAAY,CAAC,eAAe,EAAE,MAAO;QACnC,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;KAC9D;IAED,aAAa,CAAC,UAAoB;QAChC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,iBAAiB,CAAC,EAAE;YACtD,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,EAAE,CAAA;YAE3B,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC5C,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;aAC5B;YAED,KAAK,IAAI,SAAS,IAAI,UAAU,EAAE;gBAChC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;aACzB;YAED,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAA;SACpC;KACF;IAED,SAAS,CAAC,MAAmB;QAC3B,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;KAC1C;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullcalendar/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.1",
|
|
4
4
|
"title": "FullCalendar Core Package",
|
|
5
5
|
"description": "Provides core functionality, including the Calendar class",
|
|
6
6
|
"docs": "https://fullcalendar.io/docs/initialize-es6",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@fullcalendar/common": "
|
|
8
|
+
"@fullcalendar/common": "6.0.0-beta.1",
|
|
9
9
|
"preact": "^10.0.5",
|
|
10
10
|
"tslib": "^2.1.0"
|
|
11
11
|
},
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"url": "http://arshaw.com/"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@fullcalendar/core-preact": "
|
|
32
|
+
"@fullcalendar/core-preact": "6.0.0-beta.1"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/vdom.cjs.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib = require('tslib');
|
|
4
3
|
var preact = require('preact');
|
|
5
4
|
var preactCompat = require('preact/compat');
|
|
6
5
|
|
|
@@ -27,7 +26,7 @@ function _interopNamespace(e) {
|
|
|
27
26
|
var preact__namespace = /*#__PURE__*/_interopNamespace(preact);
|
|
28
27
|
var preactCompat__namespace = /*#__PURE__*/_interopNamespace(preactCompat);
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
let globalObj = typeof globalThis !== 'undefined' ? globalThis : window; // // TODO: streamline when killing IE11 support
|
|
31
30
|
if (globalObj.FullCalendarVDom) {
|
|
32
31
|
console.warn('FullCalendar VDOM already loaded');
|
|
33
32
|
}
|
|
@@ -38,10 +37,10 @@ else {
|
|
|
38
37
|
render: preact__namespace.render,
|
|
39
38
|
createRef: preact__namespace.createRef,
|
|
40
39
|
Fragment: preact__namespace.Fragment,
|
|
41
|
-
createContext
|
|
40
|
+
createContext,
|
|
42
41
|
createPortal: preactCompat__namespace.createPortal,
|
|
43
|
-
flushSync
|
|
44
|
-
unmountComponentAtNode
|
|
42
|
+
flushSync,
|
|
43
|
+
unmountComponentAtNode,
|
|
45
44
|
};
|
|
46
45
|
}
|
|
47
46
|
// HACKS...
|
|
@@ -49,8 +48,8 @@ else {
|
|
|
49
48
|
// TODO: link gh issues
|
|
50
49
|
function flushSync(runBeforeFlush) {
|
|
51
50
|
runBeforeFlush();
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
let oldDebounceRendering = preact__namespace.options.debounceRendering; // orig
|
|
52
|
+
let callbackQ = [];
|
|
54
53
|
function execCallbackSync(callback) {
|
|
55
54
|
callbackQ.push(callback);
|
|
56
55
|
}
|
|
@@ -61,37 +60,31 @@ function flushSync(runBeforeFlush) {
|
|
|
61
60
|
}
|
|
62
61
|
preact__namespace.options.debounceRendering = oldDebounceRendering;
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
FakeComponent.prototype.render = function () { return preact__namespace.createElement('div', {}); };
|
|
70
|
-
FakeComponent.prototype.componentDidMount = function () { this.setState({}); };
|
|
71
|
-
return FakeComponent;
|
|
72
|
-
}(preact__namespace.Component));
|
|
63
|
+
class FakeComponent extends preact__namespace.Component {
|
|
64
|
+
render() { return preact__namespace.createElement('div', {}); }
|
|
65
|
+
componentDidMount() { this.setState({}); }
|
|
66
|
+
}
|
|
73
67
|
function createContext(defaultValue) {
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
let ContextType = preact__namespace.createContext(defaultValue);
|
|
69
|
+
let origProvider = ContextType.Provider;
|
|
76
70
|
ContextType.Provider = function () {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
|
71
|
+
let isNew = !this.getChildContext;
|
|
72
|
+
let children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
|
80
73
|
if (isNew) {
|
|
81
|
-
|
|
82
|
-
this.shouldComponentUpdate =
|
|
83
|
-
if (
|
|
84
|
-
|
|
74
|
+
let subs = [];
|
|
75
|
+
this.shouldComponentUpdate = (_props) => {
|
|
76
|
+
if (this.props.value !== _props.value) {
|
|
77
|
+
subs.forEach((c) => {
|
|
85
78
|
c.context = _props.value;
|
|
86
79
|
c.forceUpdate();
|
|
87
80
|
});
|
|
88
81
|
}
|
|
89
82
|
};
|
|
90
|
-
this.sub =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
c.componentWillUnmount =
|
|
94
|
-
|
|
83
|
+
this.sub = (c) => {
|
|
84
|
+
subs.push(c);
|
|
85
|
+
let old = c.componentWillUnmount;
|
|
86
|
+
c.componentWillUnmount = () => {
|
|
87
|
+
subs.splice(subs.indexOf(c), 1);
|
|
95
88
|
old && old.call(c);
|
|
96
89
|
};
|
|
97
90
|
};
|
package/vdom.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { __extends } from 'tslib';
|
|
2
1
|
import * as preact from 'preact';
|
|
3
2
|
import * as preactCompat from 'preact/compat';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
let globalObj = typeof globalThis !== 'undefined' ? globalThis : window; // // TODO: streamline when killing IE11 support
|
|
6
5
|
if (globalObj.FullCalendarVDom) {
|
|
7
6
|
console.warn('FullCalendar VDOM already loaded');
|
|
8
7
|
}
|
|
@@ -13,10 +12,10 @@ else {
|
|
|
13
12
|
render: preact.render,
|
|
14
13
|
createRef: preact.createRef,
|
|
15
14
|
Fragment: preact.Fragment,
|
|
16
|
-
createContext
|
|
15
|
+
createContext,
|
|
17
16
|
createPortal: preactCompat.createPortal,
|
|
18
|
-
flushSync
|
|
19
|
-
unmountComponentAtNode
|
|
17
|
+
flushSync,
|
|
18
|
+
unmountComponentAtNode,
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
21
|
// HACKS...
|
|
@@ -24,8 +23,8 @@ else {
|
|
|
24
23
|
// TODO: link gh issues
|
|
25
24
|
function flushSync(runBeforeFlush) {
|
|
26
25
|
runBeforeFlush();
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
let oldDebounceRendering = preact.options.debounceRendering; // orig
|
|
27
|
+
let callbackQ = [];
|
|
29
28
|
function execCallbackSync(callback) {
|
|
30
29
|
callbackQ.push(callback);
|
|
31
30
|
}
|
|
@@ -36,37 +35,31 @@ function flushSync(runBeforeFlush) {
|
|
|
36
35
|
}
|
|
37
36
|
preact.options.debounceRendering = oldDebounceRendering;
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
FakeComponent.prototype.render = function () { return preact.createElement('div', {}); };
|
|
45
|
-
FakeComponent.prototype.componentDidMount = function () { this.setState({}); };
|
|
46
|
-
return FakeComponent;
|
|
47
|
-
}(preact.Component));
|
|
38
|
+
class FakeComponent extends preact.Component {
|
|
39
|
+
render() { return preact.createElement('div', {}); }
|
|
40
|
+
componentDidMount() { this.setState({}); }
|
|
41
|
+
}
|
|
48
42
|
function createContext(defaultValue) {
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
let ContextType = preact.createContext(defaultValue);
|
|
44
|
+
let origProvider = ContextType.Provider;
|
|
51
45
|
ContextType.Provider = function () {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
|
46
|
+
let isNew = !this.getChildContext;
|
|
47
|
+
let children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
|
55
48
|
if (isNew) {
|
|
56
|
-
|
|
57
|
-
this.shouldComponentUpdate =
|
|
58
|
-
if (
|
|
59
|
-
|
|
49
|
+
let subs = [];
|
|
50
|
+
this.shouldComponentUpdate = (_props) => {
|
|
51
|
+
if (this.props.value !== _props.value) {
|
|
52
|
+
subs.forEach((c) => {
|
|
60
53
|
c.context = _props.value;
|
|
61
54
|
c.forceUpdate();
|
|
62
55
|
});
|
|
63
56
|
}
|
|
64
57
|
};
|
|
65
|
-
this.sub =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
c.componentWillUnmount =
|
|
69
|
-
|
|
58
|
+
this.sub = (c) => {
|
|
59
|
+
subs.push(c);
|
|
60
|
+
let old = c.componentWillUnmount;
|
|
61
|
+
c.componentWillUnmount = () => {
|
|
62
|
+
subs.splice(subs.indexOf(c), 1);
|
|
70
63
|
old && old.call(c);
|
|
71
64
|
};
|
|
72
65
|
};
|