@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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar v5.11.2
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
- var Calendar = /** @class */ (function (_super) {
15
- tslib.__extends(Calendar, _super);
16
- function Calendar(el, optionOverrides) {
17
- if (optionOverrides === void 0) { optionOverrides = {}; }
18
- var _this = _super.call(this) || this;
19
- _this.isRendering = false;
20
- _this.isRendered = false;
21
- _this.currentClassNames = [];
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
- _this.renderRunner.tryDrain();
25
+ this.renderRunner.tryDrain();
29
26
  }
30
27
  };
31
- _this.handleData = function (data) {
32
- _this.currentData = data;
33
- _this.renderRunner.request(data.calendarOptions.rerenderDelay);
28
+ this.handleData = (data) => {
29
+ this.currentData = data;
30
+ this.renderRunner.request(data.calendarOptions.rerenderDelay);
34
31
  };
35
- _this.handleRenderRequest = function () {
36
- if (_this.isRendering) {
37
- _this.isRendered = true;
38
- var currentData_1 = _this.currentData;
39
- common.flushSync(function () {
40
- common.render(common.createElement(common.CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {
41
- _this.setClassNames(classNames);
42
- _this.setHeight(height);
43
- return (common.createElement(common.CustomContentRenderContext.Provider, { value: _this.customContentRenderId },
44
- common.createElement(common.CalendarContent, tslib.__assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));
45
- }), _this.el);
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 (_this.isRendered) {
49
- _this.isRendered = false;
50
- common.unmountComponentAtNode(_this.el);
51
- _this.setClassNames([]);
52
- _this.setHeight('');
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
- _this.el = el;
56
- _this.renderRunner = new common.DelayedRunner(_this.handleRenderRequest);
52
+ this.el = el;
53
+ this.renderRunner = new common.DelayedRunner(this.handleRenderRequest);
57
54
  new common.CalendarDataManager({
58
- optionOverrides: optionOverrides,
59
- calendarApi: _this,
60
- onAction: _this.handleAction,
61
- onData: _this.handleData,
55
+ optionOverrides,
56
+ calendarApi: this,
57
+ onAction: this.handleAction,
58
+ onData: this.handleData,
62
59
  });
63
- return _this;
64
60
  }
65
- Object.defineProperty(Calendar.prototype, "view", {
66
- get: function () { return this.currentData.viewApi; } // for public API
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
- Calendar.prototype.destroy = function () {
74
+ }
75
+ destroy() {
85
76
  if (this.isRendering) {
86
77
  this.isRendering = false;
87
78
  this.renderRunner.request();
88
79
  }
89
- };
90
- Calendar.prototype.updateSize = function () {
91
- var _this = this;
92
- common.flushSync(function () {
93
- _super.prototype.updateSize.call(_this);
80
+ }
81
+ updateSize() {
82
+ common.flushSync(() => {
83
+ super.updateSize();
94
84
  });
95
- };
96
- Calendar.prototype.batchRendering = function (func) {
85
+ }
86
+ batchRendering(func) {
97
87
  this.renderRunner.pause('batchRendering');
98
88
  func();
99
89
  this.renderRunner.resume('batchRendering');
100
- };
101
- Calendar.prototype.pauseRendering = function () {
90
+ }
91
+ pauseRendering() {
102
92
  this.renderRunner.pause('pauseRendering');
103
- };
104
- Calendar.prototype.resumeRendering = function () {
93
+ }
94
+ resumeRendering() {
105
95
  this.renderRunner.resume('pauseRendering', true);
106
- };
107
- Calendar.prototype.resetOptions = function (optionOverrides, append) {
96
+ }
97
+ resetOptions(optionOverrides, append) {
108
98
  this.currentDataManager.resetOptions(optionOverrides, append);
109
- };
110
- Calendar.prototype.setClassNames = function (classNames) {
99
+ }
100
+ setClassNames(classNames) {
111
101
  if (!common.isArraysEqual(classNames, this.currentClassNames)) {
112
- var classList = this.el.classList;
113
- for (var _i = 0, _a = this.currentClassNames; _i < _a.length; _i++) {
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 (var _b = 0, classNames_1 = classNames; _b < classNames_1.length; _b++) {
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
- Calendar.prototype.setHeight = function (height) {
111
+ }
112
+ setHeight(height) {
125
113
  common.applyStyleProp(this.el, 'height', height);
126
- };
127
- return Calendar;
128
- }(common.CalendarApi));
114
+ }
115
+ }
129
116
 
130
117
  exports.Calendar = Calendar;
131
118
  Object.keys(common).forEach(function (k) {