-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
8,788 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2019 Sardius Media LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
# FullCalendar React Component [![Build Status](https://travis-ci.com/fullcalendar/fullcalendar-react.svg?branch=master)](https://travis-ci.com/fullcalendar/fullcalendar-react) | ||
|
||
This project provides an official React component for FullCalendar, with all the same setting. | ||
|
||
- [FullCalendar React Component Docs](https://fullcalendar.io/docs/react) | ||
- [Example Project](https://github.com/fullcalendar/fullcalendar-example-projects/tree/master/react) | ||
- [Example Project with TypeScript](https://github.com/fullcalendar/fullcalendar-example-projects/tree/master/react-typescript) | ||
- [Contributor Guide](CONTRIBUTORS.md) | ||
|
||
This project is built and maintained by [Josh Ruff](https://github.com/joshuaRuff) of [Sardius Media](http://sardius.media/) in partnership with the maintainers of FullCalendar. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// <reference types="react" /> | ||
declare module "@fullcalendar/react" { | ||
import * as React from 'react'; | ||
import { Calendar, OptionsInput } from '@fullcalendar/core'; | ||
export default class FullCalendar extends React.Component<OptionsInput, any> { | ||
private elRef; | ||
private calendar; | ||
render(): JSX.Element; | ||
componentDidMount(): void; | ||
componentDidUpdate(oldProps: any): void; | ||
componentWillUnmount(): void; | ||
getApi(): Calendar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
FullCalendar React Component v4.2.0 | ||
Docs: https://fullcalendar.io/docs/react | ||
License: MIT | ||
*/ | ||
import deepEqual from 'fast-deep-equal'; | ||
import { createRef, createElement, Component } from 'react'; | ||
import { Calendar } from '@fullcalendar/core'; | ||
|
||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
|
||
var extendStatics = function(d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
|
||
function __extends(d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
|
||
var FullCalendar = /** @class */ (function (_super) { | ||
__extends(FullCalendar, _super); | ||
function FullCalendar() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.elRef = createRef(); | ||
return _this; | ||
} | ||
FullCalendar.prototype.render = function () { | ||
return (createElement("div", { ref: this.elRef })); | ||
}; | ||
FullCalendar.prototype.componentDidMount = function () { | ||
this.calendar = new Calendar(this.elRef.current, this.props); | ||
this.calendar.render(); | ||
}; | ||
FullCalendar.prototype.componentDidUpdate = function (oldProps) { | ||
var props = this.props; | ||
var updates = {}; | ||
var removals = []; | ||
for (var propName in oldProps) { | ||
if (!(propName in props)) { | ||
removals.push(propName); | ||
} | ||
} | ||
/* | ||
Do a deep-comparison for prop changes. We do this because often times the parent component will pass in | ||
an object literal that generates a new reference every time its render() function runs. | ||
This isn't too much of a performance hit because normally these object literals are rather small. | ||
For larger data, the parent component will almost definitely generate a new reference on every mutation, | ||
because immutable prop data is the norm in React-world, making the deepEqual function execute really fast. | ||
*/ | ||
for (var propName in props) { | ||
if (!deepEqual(props[propName], oldProps[propName])) { | ||
updates[propName] = props[propName]; | ||
} | ||
} | ||
this.calendar.mutateOptions(updates, removals, false, deepEqual); | ||
}; | ||
FullCalendar.prototype.componentWillUnmount = function () { | ||
this.calendar.destroy(); | ||
}; | ||
FullCalendar.prototype.getApi = function () { | ||
return this.calendar; | ||
}; | ||
return FullCalendar; | ||
}(Component)); | ||
|
||
export default FullCalendar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
/* | ||
FullCalendar React Component v4.2.0 | ||
Docs: https://fullcalendar.io/docs/react | ||
License: MIT | ||
*/ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@fullcalendar/core')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'react', '@fullcalendar/core'], factory) : | ||
(global = global || self, factory(global.FullCalendarReact = {}, global.React, global.FullCalendar)); | ||
}(this, function (exports, React, core) { 'use strict'; | ||
|
||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
|
||
var extendStatics = function(d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
|
||
function __extends(d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
|
||
var isArray = Array.isArray; | ||
var keyList = Object.keys; | ||
var hasProp = Object.prototype.hasOwnProperty; | ||
|
||
var fastDeepEqual = function equal(a, b) { | ||
if (a === b) return true; | ||
|
||
if (a && b && typeof a == 'object' && typeof b == 'object') { | ||
var arrA = isArray(a) | ||
, arrB = isArray(b) | ||
, i | ||
, length | ||
, key; | ||
|
||
if (arrA && arrB) { | ||
length = a.length; | ||
if (length != b.length) return false; | ||
for (i = length; i-- !== 0;) | ||
if (!equal(a[i], b[i])) return false; | ||
return true; | ||
} | ||
|
||
if (arrA != arrB) return false; | ||
|
||
var dateA = a instanceof Date | ||
, dateB = b instanceof Date; | ||
if (dateA != dateB) return false; | ||
if (dateA && dateB) return a.getTime() == b.getTime(); | ||
|
||
var regexpA = a instanceof RegExp | ||
, regexpB = b instanceof RegExp; | ||
if (regexpA != regexpB) return false; | ||
if (regexpA && regexpB) return a.toString() == b.toString(); | ||
|
||
var keys = keyList(a); | ||
length = keys.length; | ||
|
||
if (length !== keyList(b).length) | ||
return false; | ||
|
||
for (i = length; i-- !== 0;) | ||
if (!hasProp.call(b, keys[i])) return false; | ||
|
||
for (i = length; i-- !== 0;) { | ||
key = keys[i]; | ||
if (!equal(a[key], b[key])) return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
return a!==a && b!==b; | ||
}; | ||
|
||
var FullCalendar = /** @class */ (function (_super) { | ||
__extends(FullCalendar, _super); | ||
function FullCalendar() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.elRef = React.createRef(); | ||
return _this; | ||
} | ||
FullCalendar.prototype.render = function () { | ||
return (React.createElement("div", { ref: this.elRef })); | ||
}; | ||
FullCalendar.prototype.componentDidMount = function () { | ||
this.calendar = new core.Calendar(this.elRef.current, this.props); | ||
this.calendar.render(); | ||
}; | ||
FullCalendar.prototype.componentDidUpdate = function (oldProps) { | ||
var props = this.props; | ||
var updates = {}; | ||
var removals = []; | ||
for (var propName in oldProps) { | ||
if (!(propName in props)) { | ||
removals.push(propName); | ||
} | ||
} | ||
/* | ||
Do a deep-comparison for prop changes. We do this because often times the parent component will pass in | ||
an object literal that generates a new reference every time its render() function runs. | ||
This isn't too much of a performance hit because normally these object literals are rather small. | ||
For larger data, the parent component will almost definitely generate a new reference on every mutation, | ||
because immutable prop data is the norm in React-world, making the deepEqual function execute really fast. | ||
*/ | ||
for (var propName in props) { | ||
if (!fastDeepEqual(props[propName], oldProps[propName])) { | ||
updates[propName] = props[propName]; | ||
} | ||
} | ||
this.calendar.mutateOptions(updates, removals, false, fastDeepEqual); | ||
}; | ||
FullCalendar.prototype.componentWillUnmount = function () { | ||
this.calendar.destroy(); | ||
}; | ||
FullCalendar.prototype.getApi = function () { | ||
return this.calendar; | ||
}; | ||
return FullCalendar; | ||
}(React.Component)); | ||
|
||
exports.default = FullCalendar; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "@fullcalendar/react", | ||
"version": "4.2.0", | ||
"title": "FullCalendar React Component", | ||
"description": "An official FullCalendar component for React", | ||
"keywords": [ | ||
"react", | ||
"calendar", | ||
"fullcalendar" | ||
], | ||
"docs": "https://fullcalendar.io/docs/react", | ||
"license": "MIT", | ||
"author": "Sardius Media", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/fullcalendar/fullcalendar-react.git" | ||
}, | ||
"dependencies": { | ||
"@fullcalendar/core": "~4.2.0", | ||
"fast-deep-equal": "^2.0.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.7.0", | ||
"react-dom": "^16.7.0" | ||
}, | ||
"main": "main.umd.js", | ||
"module": "main.esm.js", | ||
"types": "main.d.ts" | ||
} |
Oops, something went wrong.