diff options
Diffstat (limited to 'library/fullcalendar/packages/rrule')
-rw-r--r-- | library/fullcalendar/packages/rrule/LICENSE.txt | 20 | ||||
-rw-r--r-- | library/fullcalendar/packages/rrule/README.md | 8 | ||||
-rw-r--r-- | library/fullcalendar/packages/rrule/main.d.ts | 9 | ||||
-rw-r--r-- | library/fullcalendar/packages/rrule/main.esm.js | 121 | ||||
-rw-r--r-- | library/fullcalendar/packages/rrule/main.js | 23 | ||||
-rw-r--r-- | library/fullcalendar/packages/rrule/main.min.js | 18 | ||||
-rw-r--r-- | library/fullcalendar/packages/rrule/package.json | 34 |
7 files changed, 206 insertions, 27 deletions
diff --git a/library/fullcalendar/packages/rrule/LICENSE.txt b/library/fullcalendar/packages/rrule/LICENSE.txt new file mode 100644 index 000000000..2149cfbef --- /dev/null +++ b/library/fullcalendar/packages/rrule/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2019 Adam Shaw + +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. diff --git a/library/fullcalendar/packages/rrule/README.md b/library/fullcalendar/packages/rrule/README.md new file mode 100644 index 000000000..7b56bed78 --- /dev/null +++ b/library/fullcalendar/packages/rrule/README.md @@ -0,0 +1,8 @@ + +# FullCalendar RRule Plugin + +A connector to the RRule library, for recurring events + +[View the docs »](https://fullcalendar.io/docs/rrule-plugin) + +This package was created from the [FullCalendar monorepo »](https://github.com/fullcalendar/fullcalendar) diff --git a/library/fullcalendar/packages/rrule/main.d.ts b/library/fullcalendar/packages/rrule/main.d.ts new file mode 100644 index 000000000..8ce74e975 --- /dev/null +++ b/library/fullcalendar/packages/rrule/main.d.ts @@ -0,0 +1,9 @@ +// Generated by dts-bundle v0.7.3-fork.1 +// Dependencies for this module: +// ../../../../../@fullcalendar/core + +declare module '@fullcalendar/rrule' { + const _default: import("@fullcalendar/core").PluginDef; + export default _default; +} + diff --git a/library/fullcalendar/packages/rrule/main.esm.js b/library/fullcalendar/packages/rrule/main.esm.js new file mode 100644 index 000000000..e4b92e95c --- /dev/null +++ b/library/fullcalendar/packages/rrule/main.esm.js @@ -0,0 +1,121 @@ +/*! +FullCalendar RRule Plugin v4.4.2 +Docs & License: https://fullcalendar.io/ +(c) 2019 Adam Shaw +*/ + +import { rrulestr, RRule } from 'rrule'; +import { createPlugin, refineProps, createDuration } from '@fullcalendar/core'; + +/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+
+var __assign = function() {
+ __assign = Object.assign || function __assign(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+}; + +var EVENT_DEF_PROPS = { + rrule: null, + duration: createDuration +}; +var recurring = { + parse: function (rawEvent, leftoverProps, dateEnv) { + if (rawEvent.rrule != null) { + var props = refineProps(rawEvent, EVENT_DEF_PROPS, {}, leftoverProps); + var parsed = parseRRule(props.rrule, dateEnv); + if (parsed) { + return { + typeData: parsed.rrule, + allDayGuess: parsed.allDayGuess, + duration: props.duration + }; + } + } + return null; + }, + expand: function (rrule, framingRange) { + // we WANT an inclusive start and in exclusive end, but the js rrule lib will only do either BOTH + // inclusive or BOTH exclusive, which is stupid: https://github.com/jakubroztocil/rrule/issues/84 + // Workaround: make inclusive, which will generate extra occurences, and then trim. + return rrule.between(framingRange.start, framingRange.end, true) + .filter(function (date) { + return date.valueOf() < framingRange.end.valueOf(); + }); + } +}; +var main = createPlugin({ + recurringTypes: [recurring] +}); +function parseRRule(input, dateEnv) { + var allDayGuess = null; + var rrule; + if (typeof input === 'string') { + rrule = rrulestr(input); + } + else if (typeof input === 'object' && input) { // non-null object + var refined = __assign({}, input); // copy + if (typeof refined.dtstart === 'string') { + var dtstartMeta = dateEnv.createMarkerMeta(refined.dtstart); + if (dtstartMeta) { + refined.dtstart = dtstartMeta.marker; + allDayGuess = dtstartMeta.isTimeUnspecified; + } + else { + delete refined.dtstart; + } + } + if (typeof refined.until === 'string') { + refined.until = dateEnv.createMarker(refined.until); + } + if (refined.freq != null) { + refined.freq = convertConstant(refined.freq); + } + if (refined.wkst != null) { + refined.wkst = convertConstant(refined.wkst); + } + else { + refined.wkst = (dateEnv.weekDow - 1 + 7) % 7; // convert Sunday-first to Monday-first + } + if (refined.byweekday != null) { + refined.byweekday = convertConstants(refined.byweekday); // the plural version + } + rrule = new RRule(refined); + } + if (rrule) { + return { rrule: rrule, allDayGuess: allDayGuess }; + } + return null; +} +function convertConstants(input) { + if (Array.isArray(input)) { + return input.map(convertConstant); + } + return convertConstant(input); +} +function convertConstant(input) { + if (typeof input === 'string') { + return RRule[input.toUpperCase()]; + } + return input; +} + +export default main; diff --git a/library/fullcalendar/packages/rrule/main.js b/library/fullcalendar/packages/rrule/main.js index 43ad6ed2f..29e6130ac 100644 --- a/library/fullcalendar/packages/rrule/main.js +++ b/library/fullcalendar/packages/rrule/main.js @@ -1,8 +1,9 @@ /*! -FullCalendar RRule Plugin v4.0.2 +FullCalendar RRule Plugin v4.4.2 Docs & License: https://fullcalendar.io/ (c) 2019 Adam Shaw */ + (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rrule'), require('@fullcalendar/core')) : typeof define === 'function' && define.amd ? define(['exports', 'rrule', '@fullcalendar/core'], factory) : @@ -10,18 +11,18 @@ Docs & License: https://fullcalendar.io/ }(this, function (exports, rrule, 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
+ Copyright (c) Microsoft Corporation.
- 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.
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted.
- See the Apache Version 2.0 License for specific language governing permissions
- and limitations under the License.
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
diff --git a/library/fullcalendar/packages/rrule/main.min.js b/library/fullcalendar/packages/rrule/main.min.js index 057788f3c..68addc2bd 100644 --- a/library/fullcalendar/packages/rrule/main.min.js +++ b/library/fullcalendar/packages/rrule/main.min.js @@ -1,20 +1,6 @@ /*! -FullCalendar RRule Plugin v4.0.2 +FullCalendar RRule Plugin v4.4.2 Docs & License: https://fullcalendar.io/ (c) 2019 Adam Shaw */ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("rrule"),require("@fullcalendar/core")):"function"==typeof define&&define.amd?define(["exports","rrule","@fullcalendar/core"],r):(e=e||self,r(e.FullCalendarRrule={},e.rrule,e.FullCalendar))}(this,function(e,r,t){"use strict";function n(e,t){var n,i=null;if("string"==typeof e)n=r.rrulestr(e);else if("object"==typeof e&&e){var f=a({},e);if("string"==typeof f.dtstart){var o=t.createMarkerMeta(f.dtstart);o?(f.dtstart=o.marker,i=o.isTimeUnspecified):delete f.dtstart}"string"==typeof f.until&&(f.until=t.createMarker(f.until)),null!=f.freq&&(f.freq=l(f.freq)),null!=f.wkst?f.wkst=l(f.wkst):f.wkst=(t.weekDow-1+7)%7,null!=f.byweekday&&(f.byweekday=u(f.byweekday)),n=new r.RRule(f)}return n?{rrule:n,allDayGuess:i}:null}function u(e){return Array.isArray(e)?e.map(l):l(e)}function l(e){return"string"==typeof e?r.RRule[e.toUpperCase()]:e}/*! ***************************************************************************** - 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. - ***************************************************************************** */ -var a=function(){return a=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&(e[u]=r[u])}return e},a.apply(this,arguments)},i={rrule:null,duration:t.createDuration},f={parse:function(e,r,u){if(null!=e.rrule){var l=t.refineProps(e,i,{},r),a=n(l.rrule,u);if(a)return{typeData:a.rrule,allDayGuess:a.allDayGuess,duration:l.duration}}return null},expand:function(e,r){return e.between(r.start,r.end,!0).filter(function(e){return e.valueOf()<r.end.valueOf()})}},o=t.createPlugin({recurringTypes:[f]});e.default=o,Object.defineProperty(e,"__esModule",{value:!0})});
\ No newline at end of file +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("rrule"),require("@fullcalendar/core")):"function"==typeof define&&define.amd?define(["exports","rrule","@fullcalendar/core"],r):r((e=e||self).FullCalendarRrule={},e.rrule,e.FullCalendar)}(this,(function(e,r,t){"use strict";var n=function(){return(n=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var u in r=arguments[t])Object.prototype.hasOwnProperty.call(r,u)&&(e[u]=r[u]);return e}).apply(this,arguments)},u={rrule:null,duration:t.createDuration},l={parse:function(e,l,a){if(null!=e.rrule){var f=t.refineProps(e,u,{},l),o=function(e,t){var u,l=null;if("string"==typeof e)u=r.rrulestr(e);else if("object"==typeof e&&e){var a=n({},e);if("string"==typeof a.dtstart){var f=t.createMarkerMeta(a.dtstart);f?(a.dtstart=f.marker,l=f.isTimeUnspecified):delete a.dtstart}"string"==typeof a.until&&(a.until=t.createMarker(a.until)),null!=a.freq&&(a.freq=i(a.freq)),null!=a.wkst?a.wkst=i(a.wkst):a.wkst=(t.weekDow-1+7)%7,null!=a.byweekday&&(a.byweekday=function(e){if(Array.isArray(e))return e.map(i);return i(e)}(a.byweekday)),u=new r.RRule(a)}if(u)return{rrule:u,allDayGuess:l};return null}(f.rrule,a);if(o)return{typeData:o.rrule,allDayGuess:o.allDayGuess,duration:f.duration}}return null},expand:function(e,r){return e.between(r.start,r.end,!0).filter((function(e){return e.valueOf()<r.end.valueOf()}))}},a=t.createPlugin({recurringTypes:[l]});function i(e){return"string"==typeof e?r.RRule[e.toUpperCase()]:e}e.default=a,Object.defineProperty(e,"__esModule",{value:!0})}));
\ No newline at end of file diff --git a/library/fullcalendar/packages/rrule/package.json b/library/fullcalendar/packages/rrule/package.json new file mode 100644 index 000000000..4cd35d029 --- /dev/null +++ b/library/fullcalendar/packages/rrule/package.json @@ -0,0 +1,34 @@ +{ + "name": "@fullcalendar/rrule", + "version": "4.4.2", + "title": "FullCalendar RRule Plugin", + "description": "A connector to the RRule library, for recurring events", + "keywords": [ + "calendar", + "event", + "full-sized" + ], + "homepage": "https://fullcalendar.io/", + "docs": "https://fullcalendar.io/docs/rrule-plugin", + "bugs": "https://fullcalendar.io/reporting-bugs", + "repository": { + "type": "git", + "url": "https://github.com/fullcalendar/fullcalendar.git", + "homepage": "https://github.com/fullcalendar/fullcalendar" + }, + "license": "MIT", + "author": { + "name": "Adam Shaw", + "email": "arshaw@arshaw.com", + "url": "http://arshaw.com/" + }, + "copyright": "2019 Adam Shaw", + "peerDependencies": { + "@fullcalendar/core": "~4.4.0", + "rrule": "^2.6.0" + }, + "main": "main.js", + "module": "main.esm.js", + "unpkg": "main.min.js", + "types": "main.d.ts" +} |