Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fullcalendar/core

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fullcalendar/core - npm Package Compare versions

Comparing version 5.11.2 to 6.0.0-beta.1

135

main.cjs.js
/*!
FullCalendar v5.11.2
FullCalendar v6.0.0-beta.1
Docs & License: https://fullcalendar.io/

@@ -11,15 +11,12 @@ (c) 2022 Adam Shaw

require('./vdom.cjs');
var tslib = require('tslib');
var common = require('@fullcalendar/common');
var Calendar = /** @class */ (function (_super) {
tslib.__extends(Calendar, _super);
function Calendar(el, optionOverrides) {
if (optionOverrides === void 0) { optionOverrides = {}; }
var _this = _super.call(this) || this;
_this.isRendering = false;
_this.isRendered = false;
_this.currentClassNames = [];
_this.customContentRenderId = 0; // will affect custom generated classNames?
_this.handleAction = function (action) {
class Calendar extends common.CalendarApi {
constructor(el, optionOverrides = {}) {
super();
this.isRendering = false;
this.isRendered = false;
this.currentClassNames = [];
this.customContentRenderId = 0; // will affect custom generated classNames?
this.handleAction = (action) => {
// actions we know we want to render immediately

@@ -29,47 +26,41 @@ switch (action.type) {

case 'SET_EVENT_RESIZE':
_this.renderRunner.tryDrain();
this.renderRunner.tryDrain();
}
};
_this.handleData = function (data) {
_this.currentData = data;
_this.renderRunner.request(data.calendarOptions.rerenderDelay);
this.handleData = (data) => {
this.currentData = data;
this.renderRunner.request(data.calendarOptions.rerenderDelay);
};
_this.handleRenderRequest = function () {
if (_this.isRendering) {
_this.isRendered = true;
var currentData_1 = _this.currentData;
common.flushSync(function () {
common.render(common.createElement(common.CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {
_this.setClassNames(classNames);
_this.setHeight(height);
return (common.createElement(common.CustomContentRenderContext.Provider, { value: _this.customContentRenderId },
common.createElement(common.CalendarContent, tslib.__assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));
}), _this.el);
this.handleRenderRequest = () => {
if (this.isRendering) {
this.isRendered = true;
let { currentData } = this;
common.flushSync(() => {
common.render(common.createElement(common.CalendarRoot, { options: currentData.calendarOptions, theme: currentData.theme, emitter: currentData.emitter }, (classNames, height, isHeightAuto, forPrint) => {
this.setClassNames(classNames);
this.setHeight(height);
return (common.createElement(common.CustomContentRenderContext.Provider, { value: this.customContentRenderId },
common.createElement(common.CalendarContent, Object.assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData))));
}), this.el);
});
}
else if (_this.isRendered) {
_this.isRendered = false;
common.unmountComponentAtNode(_this.el);
_this.setClassNames([]);
_this.setHeight('');
else if (this.isRendered) {
this.isRendered = false;
common.unmountComponentAtNode(this.el);
this.setClassNames([]);
this.setHeight('');
}
};
_this.el = el;
_this.renderRunner = new common.DelayedRunner(_this.handleRenderRequest);
this.el = el;
this.renderRunner = new common.DelayedRunner(this.handleRenderRequest);
new common.CalendarDataManager({
optionOverrides: optionOverrides,
calendarApi: _this,
onAction: _this.handleAction,
onData: _this.handleData,
optionOverrides,
calendarApi: this,
onAction: this.handleAction,
onData: this.handleData,
});
return _this;
}
Object.defineProperty(Calendar.prototype, "view", {
get: function () { return this.currentData.viewApi; } // for public API
,
enumerable: false,
configurable: true
});
Calendar.prototype.render = function () {
var wasRendering = this.isRendering;
get view() { return this.currentData.viewApi; } // for public API
render() {
let wasRendering = this.isRendering;
if (!wasRendering) {

@@ -85,4 +76,4 @@ this.isRendering = true;

}
};
Calendar.prototype.destroy = function () {
}
destroy() {
if (this.isRendering) {

@@ -92,32 +83,29 @@ this.isRendering = false;

}
};
Calendar.prototype.updateSize = function () {
var _this = this;
common.flushSync(function () {
_super.prototype.updateSize.call(_this);
}
updateSize() {
common.flushSync(() => {
super.updateSize();
});
};
Calendar.prototype.batchRendering = function (func) {
}
batchRendering(func) {
this.renderRunner.pause('batchRendering');
func();
this.renderRunner.resume('batchRendering');
};
Calendar.prototype.pauseRendering = function () {
}
pauseRendering() {
this.renderRunner.pause('pauseRendering');
};
Calendar.prototype.resumeRendering = function () {
}
resumeRendering() {
this.renderRunner.resume('pauseRendering', true);
};
Calendar.prototype.resetOptions = function (optionOverrides, append) {
}
resetOptions(optionOverrides, append) {
this.currentDataManager.resetOptions(optionOverrides, append);
};
Calendar.prototype.setClassNames = function (classNames) {
}
setClassNames(classNames) {
if (!common.isArraysEqual(classNames, this.currentClassNames)) {
var classList = this.el.classList;
for (var _i = 0, _a = this.currentClassNames; _i < _a.length; _i++) {
var className = _a[_i];
let { classList } = this.el;
for (let className of this.currentClassNames) {
classList.remove(className);
}
for (var _b = 0, classNames_1 = classNames; _b < classNames_1.length; _b++) {
var className = classNames_1[_b];
for (let className of classNames) {
classList.add(className);

@@ -127,8 +115,7 @@ }

}
};
Calendar.prototype.setHeight = function (height) {
}
setHeight(height) {
common.applyStyleProp(this.el, 'height', height);
};
return Calendar;
}(common.CalendarApi));
}
}

@@ -135,0 +122,0 @@ exports.Calendar = Calendar;

/*!
FullCalendar v5.11.2
FullCalendar v6.0.0-beta.1
Docs & License: https://fullcalendar.io/

@@ -7,16 +7,13 @@ (c) 2022 Adam Shaw

import './vdom.js';
import { __extends, __assign } from 'tslib';
import { flushSync, render, createElement, CalendarRoot, CustomContentRenderContext, CalendarContent, unmountComponentAtNode, DelayedRunner, CalendarDataManager, isArraysEqual, applyStyleProp, CalendarApi } from '@fullcalendar/common';
import { CalendarApi, flushSync, render, createElement, CalendarRoot, CustomContentRenderContext, CalendarContent, unmountComponentAtNode, DelayedRunner, CalendarDataManager, isArraysEqual, applyStyleProp } from '@fullcalendar/common';
export * from '@fullcalendar/common';
var Calendar = /** @class */ (function (_super) {
__extends(Calendar, _super);
function Calendar(el, optionOverrides) {
if (optionOverrides === void 0) { optionOverrides = {}; }
var _this = _super.call(this) || this;
_this.isRendering = false;
_this.isRendered = false;
_this.currentClassNames = [];
_this.customContentRenderId = 0; // will affect custom generated classNames?
_this.handleAction = function (action) {
class Calendar extends CalendarApi {
constructor(el, optionOverrides = {}) {
super();
this.isRendering = false;
this.isRendered = false;
this.currentClassNames = [];
this.customContentRenderId = 0; // will affect custom generated classNames?
this.handleAction = (action) => {
// actions we know we want to render immediately

@@ -26,47 +23,41 @@ switch (action.type) {

case 'SET_EVENT_RESIZE':
_this.renderRunner.tryDrain();
this.renderRunner.tryDrain();
}
};
_this.handleData = function (data) {
_this.currentData = data;
_this.renderRunner.request(data.calendarOptions.rerenderDelay);
this.handleData = (data) => {
this.currentData = data;
this.renderRunner.request(data.calendarOptions.rerenderDelay);
};
_this.handleRenderRequest = function () {
if (_this.isRendering) {
_this.isRendered = true;
var currentData_1 = _this.currentData;
flushSync(function () {
render(createElement(CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {
_this.setClassNames(classNames);
_this.setHeight(height);
return (createElement(CustomContentRenderContext.Provider, { value: _this.customContentRenderId },
createElement(CalendarContent, __assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));
}), _this.el);
this.handleRenderRequest = () => {
if (this.isRendering) {
this.isRendered = true;
let { currentData } = this;
flushSync(() => {
render(createElement(CalendarRoot, { options: currentData.calendarOptions, theme: currentData.theme, emitter: currentData.emitter }, (classNames, height, isHeightAuto, forPrint) => {
this.setClassNames(classNames);
this.setHeight(height);
return (createElement(CustomContentRenderContext.Provider, { value: this.customContentRenderId },
createElement(CalendarContent, Object.assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData))));
}), this.el);
});
}
else if (_this.isRendered) {
_this.isRendered = false;
unmountComponentAtNode(_this.el);
_this.setClassNames([]);
_this.setHeight('');
else if (this.isRendered) {
this.isRendered = false;
unmountComponentAtNode(this.el);
this.setClassNames([]);
this.setHeight('');
}
};
_this.el = el;
_this.renderRunner = new DelayedRunner(_this.handleRenderRequest);
this.el = el;
this.renderRunner = new DelayedRunner(this.handleRenderRequest);
new CalendarDataManager({
optionOverrides: optionOverrides,
calendarApi: _this,
onAction: _this.handleAction,
onData: _this.handleData,
optionOverrides,
calendarApi: this,
onAction: this.handleAction,
onData: this.handleData,
});
return _this;
}
Object.defineProperty(Calendar.prototype, "view", {
get: function () { return this.currentData.viewApi; } // for public API
,
enumerable: false,
configurable: true
});
Calendar.prototype.render = function () {
var wasRendering = this.isRendering;
get view() { return this.currentData.viewApi; } // for public API
render() {
let wasRendering = this.isRendering;
if (!wasRendering) {

@@ -82,4 +73,4 @@ this.isRendering = true;

}
};
Calendar.prototype.destroy = function () {
}
destroy() {
if (this.isRendering) {

@@ -89,32 +80,29 @@ this.isRendering = false;

}
};
Calendar.prototype.updateSize = function () {
var _this = this;
flushSync(function () {
_super.prototype.updateSize.call(_this);
}
updateSize() {
flushSync(() => {
super.updateSize();
});
};
Calendar.prototype.batchRendering = function (func) {
}
batchRendering(func) {
this.renderRunner.pause('batchRendering');
func();
this.renderRunner.resume('batchRendering');
};
Calendar.prototype.pauseRendering = function () {
}
pauseRendering() {
this.renderRunner.pause('pauseRendering');
};
Calendar.prototype.resumeRendering = function () {
}
resumeRendering() {
this.renderRunner.resume('pauseRendering', true);
};
Calendar.prototype.resetOptions = function (optionOverrides, append) {
}
resetOptions(optionOverrides, append) {
this.currentDataManager.resetOptions(optionOverrides, append);
};
Calendar.prototype.setClassNames = function (classNames) {
}
setClassNames(classNames) {
if (!isArraysEqual(classNames, this.currentClassNames)) {
var classList = this.el.classList;
for (var _i = 0, _a = this.currentClassNames; _i < _a.length; _i++) {
var className = _a[_i];
let { classList } = this.el;
for (let className of this.currentClassNames) {
classList.remove(className);
}
for (var _b = 0, classNames_1 = classNames; _b < classNames_1.length; _b++) {
var className = classNames_1[_b];
for (let className of classNames) {
classList.add(className);

@@ -124,10 +112,9 @@ }

}
};
Calendar.prototype.setHeight = function (height) {
}
setHeight(height) {
applyStyleProp(this.el, 'height', height);
};
return Calendar;
}(CalendarApi));
}
}
export { Calendar };
//# sourceMappingURL=main.js.map
{
"name": "@fullcalendar/core",
"version": "5.11.2",
"version": "6.0.0-beta.1",
"title": "FullCalendar Core Package",

@@ -8,3 +8,3 @@ "description": "Provides core functionality, including the Calendar class",

"dependencies": {
"@fullcalendar/common": "~5.11.2",
"@fullcalendar/common": "6.0.0-beta.1",
"preact": "^10.0.5",

@@ -33,4 +33,4 @@ "tslib": "^2.1.0"

"devDependencies": {
"@fullcalendar/core-preact": "5.11.2"
"@fullcalendar/core-preact": "6.0.0-beta.1"
}
}
'use strict';
var tslib = require('tslib');
var preact = require('preact');

@@ -30,3 +29,3 @@ var preactCompat = require('preact/compat');

var globalObj = typeof globalThis !== 'undefined' ? globalThis : window; // // TODO: streamline when killing IE11 support
let globalObj = typeof globalThis !== 'undefined' ? globalThis : window; // // TODO: streamline when killing IE11 support
if (globalObj.FullCalendarVDom) {

@@ -42,6 +41,6 @@ console.warn('FullCalendar VDOM already loaded');

Fragment: preact__namespace.Fragment,
createContext: createContext,
createContext,
createPortal: preactCompat__namespace.createPortal,
flushSync: flushSync,
unmountComponentAtNode: unmountComponentAtNode,
flushSync,
unmountComponentAtNode,
};

@@ -54,4 +53,4 @@ }

runBeforeFlush();
var oldDebounceRendering = preact__namespace.options.debounceRendering; // orig
var callbackQ = [];
let oldDebounceRendering = preact__namespace.options.debounceRendering; // orig
let callbackQ = [];
function execCallbackSync(callback) {

@@ -67,23 +66,17 @@ callbackQ.push(callback);

}
var FakeComponent = /** @class */ (function (_super) {
tslib.__extends(FakeComponent, _super);
function FakeComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
FakeComponent.prototype.render = function () { return preact__namespace.createElement('div', {}); };
FakeComponent.prototype.componentDidMount = function () { this.setState({}); };
return FakeComponent;
}(preact__namespace.Component));
class FakeComponent extends preact__namespace.Component {
render() { return preact__namespace.createElement('div', {}); }
componentDidMount() { this.setState({}); }
}
function createContext(defaultValue) {
var ContextType = preact__namespace.createContext(defaultValue);
var origProvider = ContextType.Provider;
let ContextType = preact__namespace.createContext(defaultValue);
let origProvider = ContextType.Provider;
ContextType.Provider = function () {
var _this = this;
var isNew = !this.getChildContext;
var children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
let isNew = !this.getChildContext;
let children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
if (isNew) {
var subs_1 = [];
this.shouldComponentUpdate = function (_props) {
if (_this.props.value !== _props.value) {
subs_1.forEach(function (c) {
let subs = [];
this.shouldComponentUpdate = (_props) => {
if (this.props.value !== _props.value) {
subs.forEach((c) => {
c.context = _props.value;

@@ -94,7 +87,7 @@ c.forceUpdate();

};
this.sub = function (c) {
subs_1.push(c);
var old = c.componentWillUnmount;
c.componentWillUnmount = function () {
subs_1.splice(subs_1.indexOf(c), 1);
this.sub = (c) => {
subs.push(c);
let old = c.componentWillUnmount;
c.componentWillUnmount = () => {
subs.splice(subs.indexOf(c), 1);
old && old.call(c);

@@ -101,0 +94,0 @@ };

@@ -1,6 +0,5 @@

import { __extends } from 'tslib';
import * as preact from 'preact';
import * as preactCompat from 'preact/compat';
var globalObj = typeof globalThis !== 'undefined' ? globalThis : window; // // TODO: streamline when killing IE11 support
let globalObj = typeof globalThis !== 'undefined' ? globalThis : window; // // TODO: streamline when killing IE11 support
if (globalObj.FullCalendarVDom) {

@@ -16,6 +15,6 @@ console.warn('FullCalendar VDOM already loaded');

Fragment: preact.Fragment,
createContext: createContext,
createContext,
createPortal: preactCompat.createPortal,
flushSync: flushSync,
unmountComponentAtNode: unmountComponentAtNode,
flushSync,
unmountComponentAtNode,
};

@@ -28,4 +27,4 @@ }

runBeforeFlush();
var oldDebounceRendering = preact.options.debounceRendering; // orig
var callbackQ = [];
let oldDebounceRendering = preact.options.debounceRendering; // orig
let callbackQ = [];
function execCallbackSync(callback) {

@@ -41,23 +40,17 @@ callbackQ.push(callback);

}
var FakeComponent = /** @class */ (function (_super) {
__extends(FakeComponent, _super);
function FakeComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
FakeComponent.prototype.render = function () { return preact.createElement('div', {}); };
FakeComponent.prototype.componentDidMount = function () { this.setState({}); };
return FakeComponent;
}(preact.Component));
class FakeComponent extends preact.Component {
render() { return preact.createElement('div', {}); }
componentDidMount() { this.setState({}); }
}
function createContext(defaultValue) {
var ContextType = preact.createContext(defaultValue);
var origProvider = ContextType.Provider;
let ContextType = preact.createContext(defaultValue);
let origProvider = ContextType.Provider;
ContextType.Provider = function () {
var _this = this;
var isNew = !this.getChildContext;
var children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
let isNew = !this.getChildContext;
let children = origProvider.apply(this, arguments); // eslint-disable-line prefer-rest-params
if (isNew) {
var subs_1 = [];
this.shouldComponentUpdate = function (_props) {
if (_this.props.value !== _props.value) {
subs_1.forEach(function (c) {
let subs = [];
this.shouldComponentUpdate = (_props) => {
if (this.props.value !== _props.value) {
subs.forEach((c) => {
c.context = _props.value;

@@ -68,7 +61,7 @@ c.forceUpdate();

};
this.sub = function (c) {
subs_1.push(c);
var old = c.componentWillUnmount;
c.componentWillUnmount = function () {
subs_1.splice(subs_1.indexOf(c), 1);
this.sub = (c) => {
subs.push(c);
let old = c.componentWillUnmount;
c.componentWillUnmount = () => {
subs.splice(subs.indexOf(c), 1);
old && old.call(c);

@@ -75,0 +68,0 @@ };

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc