@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.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
*/
|
|
@@ -8,68 +8,59 @@ Docs & License: https://fullcalendar.io/
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
10
|
require('./vdom.cjs');
|
|
11
|
-
var tslib = require('tslib');
|
|
12
11
|
var common = require('@fullcalendar/common');
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_this.customContentRenderId = 0; // will affect custom generated classNames?
|
|
23
|
-
_this.handleAction = function (action) {
|
|
13
|
+
class Calendar extends common.CalendarApi {
|
|
14
|
+
constructor(el, optionOverrides = {}) {
|
|
15
|
+
super();
|
|
16
|
+
this.isRendering = false;
|
|
17
|
+
this.isRendered = false;
|
|
18
|
+
this.currentClassNames = [];
|
|
19
|
+
this.customContentRenderId = 0; // will affect custom generated classNames?
|
|
20
|
+
this.handleAction = (action) => {
|
|
24
21
|
// actions we know we want to render immediately
|
|
25
22
|
switch (action.type) {
|
|
26
23
|
case 'SET_EVENT_DRAG':
|
|
27
24
|
case 'SET_EVENT_RESIZE':
|
|
28
|
-
|
|
25
|
+
this.renderRunner.tryDrain();
|
|
29
26
|
}
|
|
30
27
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
this.handleData = (data) => {
|
|
29
|
+
this.currentData = data;
|
|
30
|
+
this.renderRunner.request(data.calendarOptions.rerenderDelay);
|
|
34
31
|
};
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
common.flushSync(
|
|
40
|
-
common.render(common.createElement(common.CalendarRoot, { options:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return (common.createElement(common.CustomContentRenderContext.Provider, { value:
|
|
44
|
-
common.createElement(common.CalendarContent,
|
|
45
|
-
}),
|
|
32
|
+
this.handleRenderRequest = () => {
|
|
33
|
+
if (this.isRendering) {
|
|
34
|
+
this.isRendered = true;
|
|
35
|
+
let { currentData } = this;
|
|
36
|
+
common.flushSync(() => {
|
|
37
|
+
common.render(common.createElement(common.CalendarRoot, { options: currentData.calendarOptions, theme: currentData.theme, emitter: currentData.emitter }, (classNames, height, isHeightAuto, forPrint) => {
|
|
38
|
+
this.setClassNames(classNames);
|
|
39
|
+
this.setHeight(height);
|
|
40
|
+
return (common.createElement(common.CustomContentRenderContext.Provider, { value: this.customContentRenderId },
|
|
41
|
+
common.createElement(common.CalendarContent, Object.assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData))));
|
|
42
|
+
}), this.el);
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
|
-
else if (
|
|
49
|
-
|
|
50
|
-
common.unmountComponentAtNode(
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
else if (this.isRendered) {
|
|
46
|
+
this.isRendered = false;
|
|
47
|
+
common.unmountComponentAtNode(this.el);
|
|
48
|
+
this.setClassNames([]);
|
|
49
|
+
this.setHeight('');
|
|
53
50
|
}
|
|
54
51
|
};
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
this.el = el;
|
|
53
|
+
this.renderRunner = new common.DelayedRunner(this.handleRenderRequest);
|
|
57
54
|
new common.CalendarDataManager({
|
|
58
|
-
optionOverrides
|
|
59
|
-
calendarApi:
|
|
60
|
-
onAction:
|
|
61
|
-
onData:
|
|
55
|
+
optionOverrides,
|
|
56
|
+
calendarApi: this,
|
|
57
|
+
onAction: this.handleAction,
|
|
58
|
+
onData: this.handleData,
|
|
62
59
|
});
|
|
63
|
-
return _this;
|
|
64
60
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
enumerable: false,
|
|
69
|
-
configurable: true
|
|
70
|
-
});
|
|
71
|
-
Calendar.prototype.render = function () {
|
|
72
|
-
var wasRendering = this.isRendering;
|
|
61
|
+
get view() { return this.currentData.viewApi; } // for public API
|
|
62
|
+
render() {
|
|
63
|
+
let wasRendering = this.isRendering;
|
|
73
64
|
if (!wasRendering) {
|
|
74
65
|
this.isRendering = true;
|
|
75
66
|
}
|
|
@@ -80,52 +71,48 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
80
71
|
if (wasRendering) {
|
|
81
72
|
this.updateSize();
|
|
82
73
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
74
|
+
}
|
|
75
|
+
destroy() {
|
|
85
76
|
if (this.isRendering) {
|
|
86
77
|
this.isRendering = false;
|
|
87
78
|
this.renderRunner.request();
|
|
88
79
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
_super.prototype.updateSize.call(_this);
|
|
80
|
+
}
|
|
81
|
+
updateSize() {
|
|
82
|
+
common.flushSync(() => {
|
|
83
|
+
super.updateSize();
|
|
94
84
|
});
|
|
95
|
-
}
|
|
96
|
-
|
|
85
|
+
}
|
|
86
|
+
batchRendering(func) {
|
|
97
87
|
this.renderRunner.pause('batchRendering');
|
|
98
88
|
func();
|
|
99
89
|
this.renderRunner.resume('batchRendering');
|
|
100
|
-
}
|
|
101
|
-
|
|
90
|
+
}
|
|
91
|
+
pauseRendering() {
|
|
102
92
|
this.renderRunner.pause('pauseRendering');
|
|
103
|
-
}
|
|
104
|
-
|
|
93
|
+
}
|
|
94
|
+
resumeRendering() {
|
|
105
95
|
this.renderRunner.resume('pauseRendering', true);
|
|
106
|
-
}
|
|
107
|
-
|
|
96
|
+
}
|
|
97
|
+
resetOptions(optionOverrides, append) {
|
|
108
98
|
this.currentDataManager.resetOptions(optionOverrides, append);
|
|
109
|
-
}
|
|
110
|
-
|
|
99
|
+
}
|
|
100
|
+
setClassNames(classNames) {
|
|
111
101
|
if (!common.isArraysEqual(classNames, this.currentClassNames)) {
|
|
112
|
-
|
|
113
|
-
for (
|
|
114
|
-
var className = _a[_i];
|
|
102
|
+
let { classList } = this.el;
|
|
103
|
+
for (let className of this.currentClassNames) {
|
|
115
104
|
classList.remove(className);
|
|
116
105
|
}
|
|
117
|
-
for (
|
|
118
|
-
var className = classNames_1[_b];
|
|
106
|
+
for (let className of classNames) {
|
|
119
107
|
classList.add(className);
|
|
120
108
|
}
|
|
121
109
|
this.currentClassNames = classNames;
|
|
122
110
|
}
|
|
123
|
-
}
|
|
124
|
-
|
|
111
|
+
}
|
|
112
|
+
setHeight(height) {
|
|
125
113
|
common.applyStyleProp(this.el, 'height', height);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
}(common.CalendarApi));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
129
116
|
|
|
130
117
|
exports.Calendar = Calendar;
|
|
131
118
|
Object.keys(common).forEach(function (k) {
|