@fullcalendar/core 5.10.1 → 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 +64 -74
- package/main.global.js +2813 -3225
- package/main.global.min.js +3 -3
- package/main.js +65 -75
- package/main.js.map +1 -1
- package/package.json +3 -3
- package/vdom.cjs.js +25 -31
- package/vdom.d.ts +1 -1
- package/vdom.js +25 -31
package/main.cjs.js
CHANGED
|
@@ -1,74 +1,66 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar
|
|
2
|
+
FullCalendar v6.0.0-beta.1
|
|
3
3
|
Docs & License: https://fullcalendar.io/
|
|
4
|
-
(c)
|
|
4
|
+
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
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.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
common.createElement(common.
|
|
44
|
-
|
|
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);
|
|
43
|
+
});
|
|
45
44
|
}
|
|
46
|
-
else if (
|
|
47
|
-
|
|
48
|
-
common.unmountComponentAtNode(
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
else if (this.isRendered) {
|
|
46
|
+
this.isRendered = false;
|
|
47
|
+
common.unmountComponentAtNode(this.el);
|
|
48
|
+
this.setClassNames([]);
|
|
49
|
+
this.setHeight('');
|
|
51
50
|
}
|
|
52
|
-
common.flushToDom();
|
|
53
51
|
};
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
this.el = el;
|
|
53
|
+
this.renderRunner = new common.DelayedRunner(this.handleRenderRequest);
|
|
56
54
|
new common.CalendarDataManager({
|
|
57
|
-
optionOverrides
|
|
58
|
-
calendarApi:
|
|
59
|
-
onAction:
|
|
60
|
-
onData:
|
|
55
|
+
optionOverrides,
|
|
56
|
+
calendarApi: this,
|
|
57
|
+
onAction: this.handleAction,
|
|
58
|
+
onData: this.handleData,
|
|
61
59
|
});
|
|
62
|
-
return _this;
|
|
63
60
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
enumerable: false,
|
|
68
|
-
configurable: true
|
|
69
|
-
});
|
|
70
|
-
Calendar.prototype.render = function () {
|
|
71
|
-
var wasRendering = this.isRendering;
|
|
61
|
+
get view() { return this.currentData.viewApi; } // for public API
|
|
62
|
+
render() {
|
|
63
|
+
let wasRendering = this.isRendering;
|
|
72
64
|
if (!wasRendering) {
|
|
73
65
|
this.isRendering = true;
|
|
74
66
|
}
|
|
@@ -79,50 +71,48 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
79
71
|
if (wasRendering) {
|
|
80
72
|
this.updateSize();
|
|
81
73
|
}
|
|
82
|
-
}
|
|
83
|
-
|
|
74
|
+
}
|
|
75
|
+
destroy() {
|
|
84
76
|
if (this.isRendering) {
|
|
85
77
|
this.isRendering = false;
|
|
86
78
|
this.renderRunner.request();
|
|
87
79
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
80
|
+
}
|
|
81
|
+
updateSize() {
|
|
82
|
+
common.flushSync(() => {
|
|
83
|
+
super.updateSize();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
batchRendering(func) {
|
|
94
87
|
this.renderRunner.pause('batchRendering');
|
|
95
88
|
func();
|
|
96
89
|
this.renderRunner.resume('batchRendering');
|
|
97
|
-
}
|
|
98
|
-
|
|
90
|
+
}
|
|
91
|
+
pauseRendering() {
|
|
99
92
|
this.renderRunner.pause('pauseRendering');
|
|
100
|
-
}
|
|
101
|
-
|
|
93
|
+
}
|
|
94
|
+
resumeRendering() {
|
|
102
95
|
this.renderRunner.resume('pauseRendering', true);
|
|
103
|
-
}
|
|
104
|
-
|
|
96
|
+
}
|
|
97
|
+
resetOptions(optionOverrides, append) {
|
|
105
98
|
this.currentDataManager.resetOptions(optionOverrides, append);
|
|
106
|
-
}
|
|
107
|
-
|
|
99
|
+
}
|
|
100
|
+
setClassNames(classNames) {
|
|
108
101
|
if (!common.isArraysEqual(classNames, this.currentClassNames)) {
|
|
109
|
-
|
|
110
|
-
for (
|
|
111
|
-
var className = _a[_i];
|
|
102
|
+
let { classList } = this.el;
|
|
103
|
+
for (let className of this.currentClassNames) {
|
|
112
104
|
classList.remove(className);
|
|
113
105
|
}
|
|
114
|
-
for (
|
|
115
|
-
var className = classNames_1[_b];
|
|
106
|
+
for (let className of classNames) {
|
|
116
107
|
classList.add(className);
|
|
117
108
|
}
|
|
118
109
|
this.currentClassNames = classNames;
|
|
119
110
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
111
|
+
}
|
|
112
|
+
setHeight(height) {
|
|
122
113
|
common.applyStyleProp(this.el, 'height', height);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
}(common.CalendarApi));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
126
116
|
|
|
127
117
|
exports.Calendar = Calendar;
|
|
128
118
|
Object.keys(common).forEach(function (k) {
|