diff --git a/.gitignore b/.gitignore index 6fbf19413..c1090bcfe 100644 --- a/.gitignore +++ b/.gitignore @@ -20,9 +20,31 @@ node_modules/ bower_components/ # Plugins -/plugins/*/*.md -/plugins/*/*.html -/plugins/*/package.json +/plugins/**/*.html +/plugins/**/*.less +/plugins/**/*.md +/plugins/**/*.scss +/plugins/**/*.ts +/plugins/**/bower.json +/plugins/**/package.json +/plugins/**/webpack.config.js +/plugins/**/demo/ +/plugins/**/demos/ +/plugins/**/dev/ +/plugins/**/example/ +/plugins/**/examples/ +/plugins/**/less/ +/plugins/**/test/ +/plugins/**/tests/ +/plugins/daterangepicker/website/ +/plugins/daterangepicker/drp.png +!/plugins/**/LICENSE.md +!/plugins/**/LICENSE.txt +!/plugins/**/license.md +!/plugins/**/license.txt +!/plugins/**/LICENSE +!/plugins/**/license +!/plugins/**/COPYING # Docs diff --git a/plugins/daterangepicker/bower.json b/plugins/daterangepicker/bower.json deleted file mode 100644 index 878b18a79..000000000 --- a/plugins/daterangepicker/bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "daterangepicker", - "main": [ - "daterangepicker.js", - "daterangepicker.css" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests", - "moment.js", - "moment.min.js" - ], - "dependencies": { - "jquery": "1.9.1 - 3", - "moment": ">=2.9.0" - } -} diff --git a/plugins/daterangepicker/drp.png b/plugins/daterangepicker/drp.png deleted file mode 100644 index a76bdf358..000000000 Binary files a/plugins/daterangepicker/drp.png and /dev/null differ diff --git a/plugins/daterangepicker/example/amd/index.html b/plugins/daterangepicker/example/amd/index.html deleted file mode 100644 index 500450b22..000000000 --- a/plugins/daterangepicker/example/amd/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - A date range picker for Bootstrap - - - - - - -
- -

Configuration Builder

- -
- -
-
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
-
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- -
-
- -
- -
- -
-

Your Date Range Picker

- - -
- -
-

Configuration

- -
- -
-
- -
- -
- - - - - diff --git a/plugins/daterangepicker/example/amd/main.js b/plugins/daterangepicker/example/amd/main.js deleted file mode 100644 index 6cbba738a..000000000 --- a/plugins/daterangepicker/example/amd/main.js +++ /dev/null @@ -1,141 +0,0 @@ -requirejs.config({ - "paths": { - "jquery": "https://code.jquery.com/jquery-1.11.3.min", - "moment": "../../moment", - "daterangepicker": "../../daterangepicker" - } -}); - -requirejs(['jquery', 'moment', 'daterangepicker'] , function ($, moment) { -$(document).ready(function() { - - $('#config-text').keyup(function() { - eval($(this).val()); - }); - - $('.configurator input, .configurator select').change(function() { - updateConfig(); - }); - - $('.demo i').click(function() { - $(this).parent().find('input').click(); - }); - - $('#startDate').daterangepicker({ - singleDatePicker: true, - startDate: moment().subtract(6, 'days') - }); - - $('#endDate').daterangepicker({ - singleDatePicker: true, - startDate: moment() - }); - - updateConfig(); - - function updateConfig() { - var options = {}; - - if ($('#singleDatePicker').is(':checked')) - options.singleDatePicker = true; - - if ($('#showDropdowns').is(':checked')) - options.showDropdowns = true; - - if ($('#showWeekNumbers').is(':checked')) - options.showWeekNumbers = true; - - if ($('#showISOWeekNumbers').is(':checked')) - options.showISOWeekNumbers = true; - - if ($('#timePicker').is(':checked')) - options.timePicker = true; - - if ($('#timePicker24Hour').is(':checked')) - options.timePicker24Hour = true; - - if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1) - options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10); - - if ($('#timePickerSeconds').is(':checked')) - options.timePickerSeconds = true; - - if ($('#autoApply').is(':checked')) - options.autoApply = true; - - if ($('#dateLimit').is(':checked')) - options.dateLimit = { days: 7 }; - - if ($('#ranges').is(':checked')) { - options.ranges = { - 'Today': [moment(), moment()], - 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], - 'Last 7 Days': [moment().subtract(6, 'days'), moment()], - 'Last 30 Days': [moment().subtract(29, 'days'), moment()], - 'This Month': [moment().startOf('month'), moment().endOf('month')], - 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] - }; - } - - if ($('#locale').is(':checked')) { - options.locale = { - format: 'MM/DD/YYYY HH:mm', - separator: ' - ', - applyLabel: 'Apply', - cancelLabel: 'Cancel', - fromLabel: 'From', - toLabel: 'To', - customRangeLabel: 'Custom', - daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'], - monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - firstDay: 1 - }; - } - - if (!$('#linkedCalendars').is(':checked')) - options.linkedCalendars = false; - - if (!$('#autoUpdateInput').is(':checked')) - options.autoUpdateInput = false; - - if ($('#alwaysShowCalendars').is(':checked')) - options.alwaysShowCalendars = true; - - if ($('#parentEl').val().length) - options.parentEl = $('#parentEl').val(); - - if ($('#startDate').val().length) - options.startDate = $('#startDate').val(); - - if ($('#endDate').val().length) - options.endDate = $('#endDate').val(); - - if ($('#minDate').val().length) - options.minDate = $('#minDate').val(); - - if ($('#maxDate').val().length) - options.maxDate = $('#maxDate').val(); - - if ($('#opens').val().length && $('#opens').val() != 'right') - options.opens = $('#opens').val(); - - if ($('#drops').val().length && $('#drops').val() != 'down') - options.drops = $('#drops').val(); - - if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm') - options.buttonClasses = $('#buttonClasses').val(); - - if ($('#applyClass').val().length && $('#applyClass').val() != 'btn-success') - options.applyClass = $('#applyClass').val(); - - if ($('#cancelClass').val().length && $('#cancelClass').val() != 'btn-default') - options.cancelClass = $('#cancelClass').val(); - - $('#config-text').val("$('#demo').daterangepicker(" + JSON.stringify(options, null, ' ') + ", function(start, end, label) {\n console.log(\"New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')\");\n});"); - - $('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); }); - - } - -}); -}); diff --git a/plugins/daterangepicker/example/amd/require.js b/plugins/daterangepicker/example/amd/require.js deleted file mode 100644 index efc2175ab..000000000 --- a/plugins/daterangepicker/example/amd/require.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - RequireJS 2.2.0 Copyright jQuery Foundation and other contributors. - Released under MIT license, http://github.com/requirejs/requirejs/LICENSE -*/ -var requirejs,require,define; -(function(ga){function ka(b,c,d,g){return g||""}function K(b){return"[object Function]"===Q.call(b)}function L(b){return"[object Array]"===Q.call(b)}function y(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(K(k)){if(this.events.error&&this.map.isDefine||g.onError!== -ha)try{h=l.execCb(c,k,b,h)}catch(d){a=d}else h=l.execCb(c,k,b,h);this.map.isDefine&&void 0===h&&((b=this.module)?h=b.exports:this.usingExports&&(h=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",A(this.error=a)}else h=k;this.exports=h;if(this.map.isDefine&&!this.ignore&&(v[c]=h,g.onResourceLoad)){var f=[];y(this.depMaps,function(a){f.push(a.normalizedMap||a)});g.onResourceLoad(l,this.map,f)}C(c); -this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var a=this.map,b=a.id,d=q(a.prefix);this.depMaps.push(d);w(d,"defined",z(this,function(h){var k,f,d=e(fa,this.map.id),M=this.map.name,r=this.map.parentMap?this.map.parentMap.name:null,m=l.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(h.normalize&&(M=h.normalize(M,function(a){return c(a,r,!0)})|| -""),f=q(a.prefix+"!"+M,this.map.parentMap),w(f,"defined",z(this,function(a){this.map.normalizedMap=f;this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),h=e(t,f.id)){this.depMaps.push(f);if(this.events.error)h.on("error",z(this,function(a){this.emit("error",a)}));h.enable()}}else d?(this.map.url=l.nameToUrl(d),this.load()):(k=z(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=z(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];D(t,function(a){0=== -a.map.id.indexOf(b+"_unnormalized")&&C(a.map.id)});A(a)}),k.fromText=z(this,function(h,c){var d=a.name,f=q(d),M=S;c&&(h=c);M&&(S=!1);u(f);x(p.config,b)&&(p.config[d]=p.config[b]);try{g.exec(h)}catch(e){return A(F("fromtexteval","fromText eval for "+b+" failed: "+e,e,[b]))}M&&(S=!0);this.depMaps.push(f);l.completeLoad(d);m([d],k)}),h.load(a.name,m,k,p))}));l.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){Z[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,z(this,function(a, -b){var c,h;if("string"===typeof a){a=q(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=e(R,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;w(a,"defined",z(this,function(a){this.undefed||(this.defineDep(b,a),this.check())}));this.errback?w(a,"error",z(this,this.errback)):this.events.error&&w(a,"error",z(this,function(a){this.emit("error",a)}))}c=a.id;h=t[c];x(R,c)||!h||h.enabled||l.enable(a,this)}));D(this.pluginMaps,z(this,function(a){var b=e(t,a.id); -b&&!b.enabled&&l.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};l={config:p,contextName:b,registry:t,defined:v,urlFetched:W,defQueue:G,defQueueMap:{},Module:da,makeModuleMap:q,nextTick:g.nextTick,onError:A,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");if("string"===typeof a.urlArgs){var b= -a.urlArgs;a.urlArgs=function(a,c){return(-1===c.indexOf("?")?"?":"&")+b}}var c=p.shim,h={paths:!0,bundles:!0,config:!0,map:!0};D(a,function(a,b){h[b]?(p[b]||(p[b]={}),Y(p[b],a,!0,!0)):p[b]=a});a.bundles&&D(a.bundles,function(a,b){y(a,function(a){a!==b&&(fa[a]=b)})});a.shim&&(D(a.shim,function(a,b){L(a)&&(a={deps:a});!a.exports&&!a.init||a.exportsFn||(a.exportsFn=l.makeShimExports(a));c[b]=a}),p.shim=c);a.packages&&y(a.packages,function(a){var b;a="string"===typeof a?{name:a}:a;b=a.name;a.location&& -(p.paths[b]=a.location);p.pkgs[b]=a.name+"/"+(a.main||"main").replace(na,"").replace(U,"")});D(t,function(a,b){a.inited||a.map.unnormalized||(a.map=q(b,null,!0))});(a.deps||a.callback)&&l.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ga,arguments));return b||a.exports&&ia(a.exports)}},makeRequire:function(a,n){function m(c,d,f){var e,r;n.enableBuildCallback&&d&&K(d)&&(d.__requireJsBuild=!0);if("string"===typeof c){if(K(d))return A(F("requireargs", -"Invalid require call"),f);if(a&&x(R,c))return R[c](t[a.id]);if(g.get)return g.get(l,c,a,m);e=q(c,a,!1,!0);e=e.id;return x(v,e)?v[e]:A(F("notloaded",'Module name "'+e+'" has not been loaded yet for context: '+b+(a?"":". Use require([])")))}P();l.nextTick(function(){P();r=u(q(null,a));r.skipMap=n.skipMap;r.init(c,d,f,{enabled:!0});H()});return m}n=n||{};Y(m,{isBrowser:E,toUrl:function(b){var d,f=b.lastIndexOf("."),g=b.split("/")[0];-1!==f&&("."!==g&&".."!==g||1e.attachEvent.toString().indexOf("[native code")||ca?(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)):(S=!0,e.attachEvent("onreadystatechange",b.onScriptLoad));e.src=d;if(m.onNodeCreated)m.onNodeCreated(e,m,c,d);P=e;H?C.insertBefore(e,H):C.appendChild(e);P=null;return e}if(ja)try{setTimeout(function(){}, -0),importScripts(d),b.completeLoad(c)}catch(q){b.onError(F("importscripts","importScripts failed for "+c+" at "+d,q,[c]))}};E&&!w.skipDataMain&&X(document.getElementsByTagName("script"),function(b){C||(C=b.parentNode);if(O=b.getAttribute("data-main"))return u=O,w.baseUrl||-1!==u.indexOf("!")||(I=u.split("/"),u=I.pop(),T=I.length?I.join("/")+"/":"./",w.baseUrl=T),u=u.replace(U,""),g.jsExtRegExp.test(u)&&(u=O),w.deps=w.deps?w.deps.concat(u):[u],!0});define=function(b,c,d){var e,g;"string"!==typeof b&& -(d=c,c=b,b=null);L(c)||(d=c,c=null);!c&&K(d)&&(c=[],d.length&&(d.toString().replace(qa,ka).replace(ra,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));S&&(e=P||pa())&&(b||(b=e.getAttribute("data-requiremodule")),g=J[e.getAttribute("data-requirecontext")]);g?(g.defQueue.push([b,c,d]),g.defQueueMap[b]=!0):V.push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(w)}})(this); diff --git a/plugins/daterangepicker/example/browserify/README.md b/plugins/daterangepicker/example/browserify/README.md deleted file mode 100644 index 9b026e153..000000000 --- a/plugins/daterangepicker/example/browserify/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Browserify example - -Two steps need to be done for this to work - -In the project root - - npm install - -In this folder - - ../../node_modules/.bin/browserify main.js -o bundle.js diff --git a/plugins/daterangepicker/example/browserify/bundle.js b/plugins/daterangepicker/example/browserify/bundle.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/plugins/daterangepicker/example/browserify/index.html b/plugins/daterangepicker/example/browserify/index.html deleted file mode 100644 index 28717f05f..000000000 --- a/plugins/daterangepicker/example/browserify/index.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - A date range picker for Bootstrap - - - - - - -
- -

Configuration Builder

- -
- -
-
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
-
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- -
-
- -
- -
- -
-

Your Date Range Picker

- - -
- -
-

Configuration

- -
- -
-
- -
- -
- - - - diff --git a/plugins/daterangepicker/example/browserify/main.js b/plugins/daterangepicker/example/browserify/main.js deleted file mode 100644 index fb6782236..000000000 --- a/plugins/daterangepicker/example/browserify/main.js +++ /dev/null @@ -1,135 +0,0 @@ -require('../../daterangepicker.js'); -var $ = require('jquery'), - moment = require('moment'); - -$(document).ready(function() { - - $('#config-text').keyup(function() { - eval($(this).val()); - }); - - $('.configurator input, .configurator select').change(function() { - updateConfig(); - }); - - $('.demo i').click(function() { - $(this).parent().find('input').click(); - }); - - $('#startDate').daterangepicker({ - singleDatePicker: true, - startDate: moment().subtract(6, 'days') - }); - - $('#endDate').daterangepicker({ - singleDatePicker: true, - startDate: moment() - }); - - updateConfig(); - - function updateConfig() { - var options = {}; - - if ($('#singleDatePicker').is(':checked')) - options.singleDatePicker = true; - - if ($('#showDropdowns').is(':checked')) - options.showDropdowns = true; - - if ($('#showWeekNumbers').is(':checked')) - options.showWeekNumbers = true; - - if ($('#showISOWeekNumbers').is(':checked')) - options.showISOWeekNumbers = true; - - if ($('#timePicker').is(':checked')) - options.timePicker = true; - - if ($('#timePicker24Hour').is(':checked')) - options.timePicker24Hour = true; - - if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1) - options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10); - - if ($('#timePickerSeconds').is(':checked')) - options.timePickerSeconds = true; - - if ($('#autoApply').is(':checked')) - options.autoApply = true; - - if ($('#dateLimit').is(':checked')) - options.dateLimit = { days: 7 }; - - if ($('#ranges').is(':checked')) { - options.ranges = { - 'Today': [moment(), moment()], - 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], - 'Last 7 Days': [moment().subtract(6, 'days'), moment()], - 'Last 30 Days': [moment().subtract(29, 'days'), moment()], - 'This Month': [moment().startOf('month'), moment().endOf('month')], - 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] - }; - } - - if ($('#locale').is(':checked')) { - options.locale = { - format: 'MM/DD/YYYY HH:mm', - separator: ' - ', - applyLabel: 'Apply', - cancelLabel: 'Cancel', - fromLabel: 'From', - toLabel: 'To', - customRangeLabel: 'Custom', - daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'], - monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - firstDay: 1 - }; - } - - if (!$('#linkedCalendars').is(':checked')) - options.linkedCalendars = false; - - if (!$('#autoUpdateInput').is(':checked')) - options.autoUpdateInput = false; - - if ($('#alwaysShowCalendars').is(':checked')) - options.alwaysShowCalendars = true; - - if ($('#parentEl').val().length) - options.parentEl = $('#parentEl').val(); - - if ($('#startDate').val().length) - options.startDate = $('#startDate').val(); - - if ($('#endDate').val().length) - options.endDate = $('#endDate').val(); - - if ($('#minDate').val().length) - options.minDate = $('#minDate').val(); - - if ($('#maxDate').val().length) - options.maxDate = $('#maxDate').val(); - - if ($('#opens').val().length && $('#opens').val() != 'right') - options.opens = $('#opens').val(); - - if ($('#drops').val().length && $('#drops').val() != 'down') - options.drops = $('#drops').val(); - - if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm') - options.buttonClasses = $('#buttonClasses').val(); - - if ($('#applyClass').val().length && $('#applyClass').val() != 'btn-success') - options.applyClass = $('#applyClass').val(); - - if ($('#cancelClass').val().length && $('#cancelClass').val() != 'btn-default') - options.cancelClass = $('#cancelClass').val(); - - $('#config-text').val("$('#demo').daterangepicker(" + JSON.stringify(options, null, ' ') + ", function(start, end, label) {\n console.log(\"New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')\");\n});"); - - $('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); }); - - } - -}); diff --git a/plugins/daterangepicker/website/index.html b/plugins/daterangepicker/website/index.html deleted file mode 100644 index 0954e5f16..000000000 --- a/plugins/daterangepicker/website/index.html +++ /dev/null @@ -1,745 +0,0 @@ - - - - - - - - Date Range Picker — JavaScript Date & Time Picker Library - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -

Date Range Picker

-

- A JavaScript component for choosing date ranges, - dates and times. -

- -
-
- - - -
- - - - - -
- -
-
-
-
- -
-
-
- - -
- - - - -
- -
-
- -

Originally created for reports at Improvely, the Date Range Picker can be attached to any webpage element to pop up two calendars for selecting dates, times, or predefined ranges like "Last 30 Days".

- - - -

Getting Started

- -

- To get started, include jQuery, Moment.js and Date Range Picker's files in your webpage: -

- - - -

- Then attach a date range picker to whatever you want to trigger it: -

- -
-
- - -
-
- - - -
-
- -

- You can customize Date Range Picker with options, and get notified when the user chooses new dates by providing a callback function. -

- -

Examples

- - -

Simple Date Range Picker With a Callback

-
-
-
- - -
-
- - - - -
-
-
- - -

Date Range Picker With Times

-
-
-
- - -
-
- - - - -
-
-
- - -

Single Date Picker

-
-
-
- - -
-
- - - - -
-
-
- - -

Predefined Date Ranges

-
-
-
- - -
-
- - -
-   - -
- - - -
-
-
- - -

Input Initially Empty

-
-
-
- - -
-
- - - - -
-
-
- -

Options

- -
    -
  • - startDate (Date or string) The beginning date of the initially selected date range. If you provide a string, it must match the date format string set in your locale setting. -
  • -
  • - endDate: (Date or string) The end date of the initially selected date range. -
  • -
  • - minDate: (Date or string) The earliest date a user may select. -
  • -
  • - maxDate: (Date or string) The latest date a user may select. -
  • -
  • - maxSpan: (object) The maximum span between the selected start and end dates. Check off maxSpan in the configuration generator for an example of how to use this. You can provide any object the moment library would let you add to a date. -
  • -
  • - showDropdowns: (true/false) Show year and month select boxes above calendars to jump to a specific month and year. -
  • -
  • - minYear: (number) The minimum year shown in the dropdowns when showDropdowns is set to true. -
  • -
  • - maxYear: (number) The maximum year shown in the dropdowns when showDropdowns is set to true. -
  • -
  • - showWeekNumbers: (true/false) Show localized week numbers at the start of each week on the calendars. -
  • -
  • - showISOWeekNumbers: (true/false) Show ISO week numbers at the start of each week on the calendars. -
  • -
  • - timePicker: (true/false) Adds select boxes to choose times in addition to dates. -
  • -
  • - timePickerIncrement: (number) Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30). -
  • -
  • - timePicker24Hour: (true/false) Use 24-hour instead of 12-hour times, removing the AM/PM selection. -
  • -
  • - timePickerSeconds: (true/false) Show seconds in the timePicker. -
  • -
  • - ranges: (object) Set predefined date ranges the user can select from. Each key is the label for the range, and its value an array with two dates representing the bounds of the range. Click ranges in the configuration generator for examples. -
  • -
  • - showCustomRangeLabel: (true/false) Displays "Custom Range" at - the end of the list of predefined ranges, when the ranges option is used. - This option will be highlighted whenever the current date range selection does not match one of the predefined ranges. Clicking it will display the calendars to select a new range. -
  • -
  • - alwaysShowCalendars: (true/false) Normally, if you use the ranges option to specify pre-defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range". When this option is set to true, the calendars for choosing a custom date range are always shown instead. -
  • -
  • - opens: ('left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to. -
  • -
  • - drops: ('down'/'up'/'auto') Whether the picker appears below (default) or above the HTML element it's attached to. -
  • -
  • - buttonClasses: (string) CSS class names that will be added to both the apply and cancel buttons. -
  • -
  • - applyButtonClasses: (string) CSS class names that will be added only to the apply button. -
  • -
  • - cancelButtonClasses: (string) CSS class names that will be added only to the cancel button. -
  • -
  • - locale: (object) Allows you to provide localized strings for buttons and labels, customize the date format, and change the first day of week for the calendars. - Check off locale in the configuration generator to see how - to customize these options. -
  • -
  • - singleDatePicker: (true/false) Show only a single calendar to choose one date, instead of a range picker with two calendars. The start and end dates provided to your callback will be the same single date chosen. -
  • -
  • - autoApply: (true/false) Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates are clicked. -
  • -
  • - linkedCalendars: (true/false) When enabled, the two calendars displayed will always be for two sequential months (i.e. January and February), and both will be advanced when clicking the left or right arrows above the calendars. When disabled, the two calendars can be individually advanced and display any month/year. -
  • -
  • - isInvalidDate: (function) A function that is passed each date in the two - calendars before they are displayed, and may return true or false to indicate whether - that date should be available for selection or not. -
  • -
  • - isCustomDate: (function) A function that is passed each date in the two - calendars before they are displayed, and may return a string or array of CSS class names - to apply to that date's calendar cell. -
  • -
  • - autoUpdateInput: (true/false) Indicates whether the date range picker should - automatically update the value of the <input> element it's attached to at initialization and when the selected dates change. -
  • -
  • - parentEl: (string) jQuery selector of the parent element that the date range picker will be added to, if not provided this will be 'body' -
  • -
- -

Methods

- -

- You can programmatically update the startDate and endDate - in the picker using the setStartDate and setEndDate methods. - You can access the Date Range Picker object and its functions and properties through - data properties of the element you attached it to. -

- - - -
- -
    -
  • - setStartDate(Date or string): Sets the date range picker's currently selected start date to the provided date -
  • -
  • - setEndDate(Date or string): Sets the date range picker's currently selected end date to the provided date -
  • -
- -

Example usage:

- - - -

Events

- -

- Several events are triggered on the element you attach the picker to, which you can listen for. -

- -
    -
  • - show.daterangepicker: Triggered when the picker is shown -
  • -
  • - hide.daterangepicker: Triggered when the picker is hidden -
  • -
  • - showCalendar.daterangepicker: Triggered when the calendar(s) are shown -
  • -
  • - hideCalendar.daterangepicker: Triggered when the calendar(s) are hidden -
  • -
  • - apply.daterangepicker: Triggered when the apply button is clicked, - or when a predefined range is clicked -
  • -
  • - cancel.daterangepicker: Triggered when the cancel button is clicked -
  • -
- -

- Some applications need a "clear" instead of a "cancel" functionality, which can be achieved by changing the button label and watching for the cancel event: -

- - - -
- -

- While passing in a callback to the constructor is the easiest way to listen for changes in the selected date range, you can also do something every time the apply button is clicked even if the selection hasn't changed: -

- - - -

Configuration Generator

- -
- -
-
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
-
- -
- -
- -
- - -
- -
- - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
- -
- - -
- -
- - -
- -
- - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
- -
- -
- -
-
-

Your Date Range Picker

- -
-
- -
-

Your Configuration to Copy

- -
- -
-
- -
- - - -

License

- -

The MIT License (MIT)

- -

Copyright (c) 2012-2019 Dan Grossman

- -

- 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. -

- -

Comments

- -
- - - -
-
-
- - - - - - - - - - - diff --git a/plugins/daterangepicker/website/website.css b/plugins/daterangepicker/website/website.css deleted file mode 100644 index aa5f30d33..000000000 --- a/plugins/daterangepicker/website/website.css +++ /dev/null @@ -1,152 +0,0 @@ -body { - font-size: 15px; - line-height: 1.6em; - position: relative; - margin: 0; -} - -.navbar .nav-item { - padding: 8px 0 8px 20px; -} - -.navbar .nav-link { - font-weight: bold; - font-size: 14px; - padding: 0; -} - -.navbar-expand-sm .navbar-nav .nav-link { - padding: 0; -} - -.well { - background: #f5f5f5; - border-radius: 4px; - padding: 20px; -} - -h1 { - font-size: 20px; - margin-bottom: 1em; - padding-bottom: 5px; - border-bottom: 1px dotted #08c; -} - -h1:before { - content: '#'; - color: #666; - position: relative; - padding-right: 5px; -} - -h2 { - padding: 0; - margin: 20px 0 0 0; - font-size: 18px; -} - -h2 a { - color: #444; - display: block; - background: #eee; - padding: 8px 12px; - margin-bottom: 0; - cursor: default; - text-decoration: none; -} - -input.form-control { - font-size: 14px; -} - -.collapsable { - border: 1px solid #eee; - padding: 12px; - display: block; -} - -label { - font-size: 13px; - font-weight: bold; -} - -.gist { - overflow: auto; -} - -.gist .blob-wrapper.data { - max-height: 350px; - overflow: auto; -} - -.list-group-item { - padding: 4px 0; - border: 0; - font-size: 16px; -} - -.leftcol { - position: absolute; - top: 180px; -} - -.rightcol { - max-width: 950px; -} - -.container { - max-width: 1300px; -} - -@media (min-width: 980px) { - .rightcol { - margin-left: 320px; - } -} - -p, pre { - margin-bottom: 2em; -} - -ul.nobullets { - margin: 0; - padding: 0; - list-style: none; -} -ul.nobullets li { - padding-bottom: 1em; - margin-bottom: 1em; - border-bottom: 1px dotted #ddd; -} - -input[type="text"] { - padding: 6px; - width: 100%; - border-radius: 4px; -} - -#footer { - background: #222; - margin-top: 80px; - padding: 10px; - color: #fff; - text-align: center; -} -#footer a:link, #footer a:visited { - color: #fff; - border-bottom: 1px dotted #fff; -} -#jumbo { - background: #c1deef; - color: #000; - padding: 20px 0; - margin-bottom: 20px; -} - -#jumbo h1 { - font-size: 28px; -} -#jumbo .btn { - border-radius: 0; - font-size: 16px; -} \ No newline at end of file diff --git a/plugins/daterangepicker/website/website.js b/plugins/daterangepicker/website/website.js deleted file mode 100644 index cbbb87434..000000000 --- a/plugins/daterangepicker/website/website.js +++ /dev/null @@ -1,179 +0,0 @@ -$(document).ready(function() { - - $('#config-text').keyup(function() { - eval($(this).val()); - }); - - $('.configurator input, .configurator select').change(function() { - updateConfig(); - }); - - $('.demo i').click(function() { - $(this).parent().find('input').click(); - }); - - $('#startDate').daterangepicker({ - singleDatePicker: true, - startDate: moment().subtract(6, 'days') - }); - - $('#endDate').daterangepicker({ - singleDatePicker: true, - startDate: moment() - }); - - //updateConfig(); - - function updateConfig() { - var options = {}; - - if ($('#singleDatePicker').is(':checked')) - options.singleDatePicker = true; - - if ($('#showDropdowns').is(':checked')) - options.showDropdowns = true; - - if ($('#minYear').val().length && $('#minYear').val() != 1) - options.minYear = parseInt($('#minYear').val(), 10); - - if ($('#maxYear').val().length && $('#maxYear').val() != 1) - options.maxYear = parseInt($('#maxYear').val(), 10); - - if ($('#showWeekNumbers').is(':checked')) - options.showWeekNumbers = true; - - if ($('#showISOWeekNumbers').is(':checked')) - options.showISOWeekNumbers = true; - - if ($('#timePicker').is(':checked')) - options.timePicker = true; - - if ($('#timePicker24Hour').is(':checked')) - options.timePicker24Hour = true; - - if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1) - options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10); - - if ($('#timePickerSeconds').is(':checked')) - options.timePickerSeconds = true; - - if ($('#autoApply').is(':checked')) - options.autoApply = true; - - if ($('#maxSpan').is(':checked')) - options.maxSpan = { days: 7 }; - - if ($('#ranges').is(':checked')) { - options.ranges = { - 'Today': [moment(), moment()], - 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], - 'Last 7 Days': [moment().subtract(6, 'days'), moment()], - 'Last 30 Days': [moment().subtract(29, 'days'), moment()], - 'This Month': [moment().startOf('month'), moment().endOf('month')], - 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] - }; - } - - if ($('#locale').is(':checked')) { - options.locale = { - format: 'MM/DD/YYYY', - separator: ' - ', - applyLabel: 'Apply', - cancelLabel: 'Cancel', - fromLabel: 'From', - toLabel: 'To', - customRangeLabel: 'Custom', - weekLabel: 'W', - daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'], - monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - firstDay: 1 - }; - } - - if (!$('#linkedCalendars').is(':checked')) - options.linkedCalendars = false; - - if (!$('#autoUpdateInput').is(':checked')) - options.autoUpdateInput = false; - - if (!$('#showCustomRangeLabel').is(':checked')) - options.showCustomRangeLabel = false; - - if ($('#alwaysShowCalendars').is(':checked')) - options.alwaysShowCalendars = true; - - if ($('#parentEl').val().length) - options.parentEl = $('#parentEl').val(); - - if ($('#startDate').val().length) - options.startDate = $('#startDate').val(); - - if ($('#endDate').val().length) - options.endDate = $('#endDate').val(); - - if ($('#minDate').val().length) - options.minDate = $('#minDate').val(); - - if ($('#maxDate').val().length) - options.maxDate = $('#maxDate').val(); - - if ($('#opens').val().length && $('#opens').val() != 'right') - options.opens = $('#opens').val(); - - if ($('#drops').val().length && $('#drops').val() != 'down') - options.drops = $('#drops').val(); - - if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm') - options.buttonClasses = $('#buttonClasses').val(); - - if ($('#applyButtonClasses').val().length && $('#applyButtonClasses').val() != 'btn-primary') - options.applyButtonClasses = $('#applyButtonClasses').val(); - - if ($('#cancelButtonClasses').val().length && $('#cancelButtonClasses').val() != 'btn-default') - options.cancelClass = $('#cancelButtonClasses').val(); - - $('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); }); - - if (typeof options.ranges !== 'undefined') { - options.ranges = {}; - } - - var option_text = JSON.stringify(options, null, ' '); - - var replacement = "ranges: {\n" - + " 'Today': [moment(), moment()],\n" - + " 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n" - + " 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\n" - + " 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\n" - + " 'This Month': [moment().startOf('month'), moment().endOf('month')],\n" - + " 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n" - + " }"; - option_text = option_text.replace(new RegExp('"ranges"\: \{\}', 'g'), replacement); - - $('#config-text').val("$('#demo').daterangepicker(" + option_text + ", function(start, end, label) {\n console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');\n});"); - - } - - $(window).scroll(function (event) { - var scroll = $(window).scrollTop(); - if (scroll > 180) { - $('.leftcol').css('position', 'fixed'); - $('.leftcol').css('top', '10px'); - } else { - $('.leftcol').css('position', 'absolute'); - $('.leftcol').css('top', '180px'); - } - }); - - var bg = new Trianglify({ - x_colors: ["#e1f3fd", "#eeeeee", "#407dbf"], - y_colors: 'match_x', - width: document.body.clientWidth, - height: 150, - stroke_width: 0, - cell_size: 20 - }); - - $('#jumbo').css('background-image', 'url(' + bg.png() + ')'); - -}); diff --git a/plugins/filterizr/ActiveFilter.d.ts b/plugins/filterizr/ActiveFilter.d.ts deleted file mode 100755 index 42c094692..000000000 --- a/plugins/filterizr/ActiveFilter.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Filter } from './types'; -/** - * ActiveFilter represents the currently active filter over - * the grid. - * - * It can be a plain string value or an array of strings. - */ -export default class ActiveFilter { - private filter; - constructor(filter: Filter); - get(): Filter; - set(targetFilter: Filter): void; - toggle(targetFilter: string): void; - private toggleFilter; -} diff --git a/plugins/filterizr/EventReceiver.d.ts b/plugins/filterizr/EventReceiver.d.ts deleted file mode 100755 index 8dd252622..000000000 --- a/plugins/filterizr/EventReceiver.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Destructible } from './types/interfaces'; -declare type Receiver = NodeListOf | Element | Window; -export default class EventReceiver implements Destructible { - private receiver; - private eventDictionary; - constructor(receiver: Receiver); - on(eventType: string, eventHandler: EventListener): void; - off(eventType: string): void; - destroy(): void; - private removeAllEvents; -} -export {}; diff --git a/plugins/filterizr/FilterContainer/FilterContainer.d.ts b/plugins/filterizr/FilterContainer/FilterContainer.d.ts deleted file mode 100755 index 69bc64d23..000000000 --- a/plugins/filterizr/FilterContainer/FilterContainer.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { FilterizrState } from '../types'; -import FilterizrOptions from '../FilterizrOptions'; -import FilterItems from '../FilterItems'; -import FilterizrElement from '../FilterizrElement'; -import StyledFilterContainer from './StyledFilterContainer'; -/** - * Resembles the grid of items within Filterizr. - */ -export default class FilterContainer extends FilterizrElement { - filterItems: FilterItems; - protected styledNode: StyledFilterContainer; - private _filterizrState; - constructor(node: Element, options: FilterizrOptions); - readonly styles: StyledFilterContainer; - filterizrState: FilterizrState; - destroy(): void; - /** - * Turn the HTML elements in the grid to FilterItem - * instances and return a collection of them. - * @throws when no filter items are found in the grid. - */ - makeFilterItems(options: FilterizrOptions): FilterItems; - insertItem(node: HTMLElement): void; - removeItem(node: HTMLElement): void; - setHeight(newHeight: number): void; - bindEvents(): void; - unbindEvents(): void; -} diff --git a/plugins/filterizr/FilterContainer/StyledFilterContainer.d.ts b/plugins/filterizr/FilterContainer/StyledFilterContainer.d.ts deleted file mode 100755 index f2128e996..000000000 --- a/plugins/filterizr/FilterContainer/StyledFilterContainer.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import StyledFilterizrElement from '../StyledFilterizrElement'; -export default class StyledFilterContainer extends StyledFilterizrElement { - initialize(): void; - updatePaddings(): void; - setHeight(newHeight: number): void; -} diff --git a/plugins/filterizr/FilterContainer/index.d.ts b/plugins/filterizr/FilterContainer/index.d.ts deleted file mode 100755 index cdefe97b0..000000000 --- a/plugins/filterizr/FilterContainer/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './FilterContainer'; diff --git a/plugins/filterizr/FilterContainer/styles.d.ts b/plugins/filterizr/FilterContainer/styles.d.ts deleted file mode 100755 index b3983eda3..000000000 --- a/plugins/filterizr/FilterContainer/styles.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import FilterizrOptions from '../FilterizrOptions'; -export declare const makePaddingStyles: (options: FilterizrOptions) => object; -export declare const makeInitialStyles: (options: FilterizrOptions) => object; -export declare const makeHeightStyles: (height: number) => object; diff --git a/plugins/filterizr/FilterControls.d.ts b/plugins/filterizr/FilterControls.d.ts deleted file mode 100755 index 530080b93..000000000 --- a/plugins/filterizr/FilterControls.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Filterizr from './Filterizr'; -import { Destructible } from './types/interfaces'; -export default class FilterControls implements Destructible { - private filterControls; - private filterizr; - private multiFilterControls; - private searchControls; - private selector; - private shuffleControls; - private sortAscControls; - private sortDescControls; - /** - * @param filterizr keep a ref to the Filterizr object to control actions - * @param selector selector of controls in case of multiple Filterizr instances - */ - constructor(filterizr: Filterizr, selector?: string); - destroy(): void; - private initialize; -} diff --git a/plugins/filterizr/FilterItem/FilterItem.d.ts b/plugins/filterizr/FilterItem/FilterItem.d.ts deleted file mode 100755 index 193fcbf66..000000000 --- a/plugins/filterizr/FilterItem/FilterItem.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Position } from '../types/interfaces'; -import FilterizrOptions from '../FilterizrOptions'; -import FilterizrElement from '../FilterizrElement'; -import StyledFilterItem from './StyledFilterItem'; -/** - * Resembles an item in the grid of Filterizr. - */ -export default class FilterItem extends FilterizrElement { - protected styledNode: StyledFilterItem; - private filteredOut; - private lastPosition; - private sortData; - constructor(node: Element, index: number, options: FilterizrOptions); - readonly styles: StyledFilterItem; - /** - * Destroys the FilterItem instance - */ - destroy(): void; - /** - * Filters in a specific FilterItem out of the grid. - */ - filterIn(targetPosition: Position): void; - /** - * Filters out a specific FilterItem out of the grid. - */ - filterOut(): void; - /** - * Returns true if the text contents of the FilterItem match the search term - * @param searchTerm to look up - */ - contentsMatchSearch(searchTerm: string): boolean; - /** - * Returns all categories of the grid items data-category attribute - * with a regexp regarding all whitespace. - */ - getCategories(): string[]; - /** - * Returns the value of the sort attribute - * @param sortAttribute "index", "sortData" or custom user data-attribute by which to sort - */ - getSortAttribute(sortAttribute: string): string | number; - protected bindEvents(): void; - protected unbindEvents(): void; -} diff --git a/plugins/filterizr/FilterItem/StyledFilterItem.d.ts b/plugins/filterizr/FilterItem/StyledFilterItem.d.ts deleted file mode 100755 index 9a08c5c93..000000000 --- a/plugins/filterizr/FilterItem/StyledFilterItem.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Position } from './../types/interfaces'; -import StyledFilterizrElement from '../StyledFilterizrElement'; -import FilterizrOptions from '../FilterizrOptions'; -export default class StyledFilterItem extends StyledFilterizrElement { - private _index; - constructor(node: HTMLElement, index: number, options: FilterizrOptions); - initialize(): void; - setFilteredStyles(position: Position, cssOptions: object): void; - updateTransitionStyle(): void; - updateWidth(): void; - /** - * Sets the transition css property as an inline style on the FilterItem. - * - * The idea here is that during the very first render items should assume - * their positions directly. - * - * Following renders should actually trigger the transitions, which is why - * we need to delay setting the transition property. - * - * Unfortunately, JavaScript code executes on the same thread as the - * browser's rendering. Everything that needs to be drawn waits for - * JavaScript execution to complete. Thus, we need to use a setTimeout - * here to defer setting the transition style at the first rendering cycle. - */ - enableTransitions(): Promise; - disableTransitions(): void; - setZIndex(zIndex: number): void; - removeZIndex(): void; - removeWidth(): void; - setHidden(): void; - setVisible(): void; -} diff --git a/plugins/filterizr/FilterItem/index.d.ts b/plugins/filterizr/FilterItem/index.d.ts deleted file mode 100755 index 7442505f6..000000000 --- a/plugins/filterizr/FilterItem/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './FilterItem'; diff --git a/plugins/filterizr/FilterItem/styles.d.ts b/plugins/filterizr/FilterItem/styles.d.ts deleted file mode 100755 index e31a67f11..000000000 --- a/plugins/filterizr/FilterItem/styles.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import FilterizrOptions from '../FilterizrOptions'; -import { Dictionary, Position } from '../types/interfaces'; -export declare const makeInitialStyles: (options: FilterizrOptions) => object; -export declare const makeFilteringStyles: (targetPosition: Position, cssOptions: Dictionary) => object; -export declare const makeTransitionStyles: (index: number, options: FilterizrOptions) => object; diff --git a/plugins/filterizr/FilterItems/FilterItems.d.ts b/plugins/filterizr/FilterItems/FilterItems.d.ts deleted file mode 100755 index 97616f268..000000000 --- a/plugins/filterizr/FilterItems/FilterItems.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import StyledFilterItems from './StyledFilterItems'; -import { Filter } from '../types'; -import FilterItem from '../FilterItem'; -import FilterizrOptions from '../FilterizrOptions/FilterizrOptions'; -import { Destructible, Styleable } from '../types/interfaces'; -export default class FilterItems implements Destructible, Styleable { - private filterItems; - private styledFilterItems; - private options; - constructor(filterItems: FilterItem[], options: FilterizrOptions); - readonly styles: StyledFilterItems; - readonly length: number; - getItem(index: number): FilterItem; - destroy(): void; - push(filterItem: FilterItem): number; - remove(node: HTMLElement): void; - getFiltered(filter: Filter): FilterItem[]; - getFilteredOut(filter: Filter): FilterItem[]; - sort(sortAttr?: string, sortOrder?: 'asc' | 'desc'): void; - shuffle(): void; - private search; - private shouldBeFiltered; -} diff --git a/plugins/filterizr/FilterItems/StyledFilterItems.d.ts b/plugins/filterizr/FilterItems/StyledFilterItems.d.ts deleted file mode 100755 index 6c747b1db..000000000 --- a/plugins/filterizr/FilterItems/StyledFilterItems.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import StyledFilterizrElements from '../StyledFilterizrElements'; -import FilterItem from '../FilterItem/FilterItem'; -export default class StyledFilterItems extends StyledFilterizrElements { - private _filterItems; - constructor(elements: FilterItem[]); - resetDisplay(): void; - removeWidth(): void; - updateWidth(): void; - updateTransitionStyle(): void; - disableTransitions(): void; - enableTransitions(): Promise; - updateWidthWithTransitionsDisabled(): void; -} diff --git a/plugins/filterizr/FilterItems/index.d.ts b/plugins/filterizr/FilterItems/index.d.ts deleted file mode 100755 index e091bad7f..000000000 --- a/plugins/filterizr/FilterItems/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './FilterItems'; diff --git a/plugins/filterizr/Filterizr/Filterizr.d.ts b/plugins/filterizr/Filterizr/Filterizr.d.ts deleted file mode 100755 index a2697899f..000000000 --- a/plugins/filterizr/Filterizr/Filterizr.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Filter } from '../types'; -import { RawOptions, Destructible } from '../types/interfaces'; -import FilterizrOptions from '../FilterizrOptions'; -import FilterContainer from '../FilterContainer'; -import FilterItem from '../FilterItem'; -export default class Filterizr implements Destructible { - /** - * Main Filterizr classes exported as static members - */ - static FilterContainer: typeof FilterContainer; - static FilterItem: typeof FilterItem; - static defaultOptions: RawOptions; - /** - * Static method that receives the jQuery object and extends - * its prototype with a .filterizr method. - */ - static installAsJQueryPlugin: Function; - options: FilterizrOptions; - private windowEventReceiver; - private filterContainer; - private filterControls?; - private imagesHaveLoaded; - private spinner?; - constructor(selectorOrNode?: string | HTMLElement, userOptions?: RawOptions); - private readonly filterItems; - /** - * Filters the items in the grid by a category - * @param category by which to filter - */ - filter(category: Filter): void; - destroy(): void; - /** - * Inserts a new FilterItem into the grid - */ - insertItem(node: HTMLElement): Promise; - /** - * Removes a FilterItem from the grid - */ - removeItem(node: HTMLElement): void; - /** - * Sorts the FilterItems in the grid - * @param sortAttr the attribute by which to perform the sort - * @param sortOrder ascending or descending - */ - sort(sortAttr?: string, sortOrder?: 'asc' | 'desc'): void; - /** - * Searches through the FilterItems for a given string and adds an additional filter layer. - */ - search(searchTerm?: string): void; - /** - * Shuffles the FilterItems in the grid, making sure their positions have changed. - */ - shuffle(): void; - /** - * Updates the perferences of the users for rendering the Filterizr grid, - * additionally performs error checking on the new options passed. - * @param newOptions to override the defaults. - */ - setOptions(newOptions: RawOptions): void; - /** - * Performs multifiltering with AND/OR logic. - * @param toggledFilter the filter to toggle - */ - toggleFilter(toggledFilter: string): void; - private render; - /** - * Initialization sequence of Filterizr when the grid is first loaded - */ - private initialize; - private bindEvents; - /** - * Resolves when the images of the grid have finished loading into the DOM - */ - private waitForImagesToLoad; -} diff --git a/plugins/filterizr/Filterizr/index.d.ts b/plugins/filterizr/Filterizr/index.d.ts deleted file mode 100755 index db1a35aa7..000000000 --- a/plugins/filterizr/Filterizr/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Filterizr'; diff --git a/plugins/filterizr/Filterizr/installAsJQueryPlugin.d.ts b/plugins/filterizr/Filterizr/installAsJQueryPlugin.d.ts deleted file mode 100755 index a73182198..000000000 --- a/plugins/filterizr/Filterizr/installAsJQueryPlugin.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function installAsJQueryPlugin($: any): void; diff --git a/plugins/filterizr/FilterizrElement.d.ts b/plugins/filterizr/FilterizrElement.d.ts deleted file mode 100755 index 62f9d2c32..000000000 --- a/plugins/filterizr/FilterizrElement.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Destructible, Dimensions, Resizable, Styleable } from './types/interfaces'; -import FilterizrOptions from './FilterizrOptions'; -import EventReceiver from './EventReceiver'; -import StyledFilterizrElement from './StyledFilterizrElement'; -export default abstract class FilterizrElement implements Destructible, Resizable, Styleable { - node: Element; - options: FilterizrOptions; - protected eventReceiver: EventReceiver; - constructor(node: Element, options: FilterizrOptions); - readonly dimensions: Dimensions; - destroy(): void | Promise; - trigger(eventType: string): void; - abstract readonly styles: StyledFilterizrElement; - protected abstract bindEvents(): void; - protected abstract unbindEvents(): void; -} diff --git a/plugins/filterizr/FilterizrOptions/FilterizrOptions.d.ts b/plugins/filterizr/FilterizrOptions/FilterizrOptions.d.ts deleted file mode 100755 index fb841ac35..000000000 --- a/plugins/filterizr/FilterizrOptions/FilterizrOptions.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { BaseOptions, RawOptions } from './../types/interfaces'; -import ActiveFilter from '../ActiveFilter'; -import { Filter } from '../types'; -export interface Options extends BaseOptions { - filter: ActiveFilter; -} -export default class FilterizrOptions { - private options; - constructor(userOptions: RawOptions); - readonly isSpinnerEnabled: boolean; - readonly areControlsEnabled: boolean; - readonly controlsSelector: string; - filter: Filter; - toggleFilter(filter: string): void; - searchTerm: string; - get(): Options; - getRaw(): RawOptions; - set(newUserOptions: RawOptions): void; - private convertToFilterizrOptions; - private convertToOptions; - private validate; -} diff --git a/plugins/filterizr/FilterizrOptions/defaultOptions.d.ts b/plugins/filterizr/FilterizrOptions/defaultOptions.d.ts deleted file mode 100755 index 6f9f9e3e8..000000000 --- a/plugins/filterizr/FilterizrOptions/defaultOptions.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { RawOptions } from '../types/interfaces'; -declare const defaultOptions: RawOptions; -export default defaultOptions; diff --git a/plugins/filterizr/FilterizrOptions/index.d.ts b/plugins/filterizr/FilterizrOptions/index.d.ts deleted file mode 100755 index ead3e320d..000000000 --- a/plugins/filterizr/FilterizrOptions/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as defaultOptions } from './defaultOptions'; -export { default } from './FilterizrOptions'; diff --git a/plugins/filterizr/Spinner/Spinner.d.ts b/plugins/filterizr/Spinner/Spinner.d.ts deleted file mode 100755 index e852c136c..000000000 --- a/plugins/filterizr/Spinner/Spinner.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Destructible, Styleable } from '../types/interfaces'; -import FilterizrOptions from '../FilterizrOptions'; -import FilterContainer from '../FilterContainer'; -import StyledSpinner from './StyledSpinner'; -export default class Spinner implements Destructible, Styleable { - private node; - private styledNode; - private filterContainer; - constructor(filterContainer: FilterContainer, options: FilterizrOptions); - readonly styles: StyledSpinner; - destroy(): Promise; - private initialize; -} diff --git a/plugins/filterizr/Spinner/StyledSpinner.d.ts b/plugins/filterizr/Spinner/StyledSpinner.d.ts deleted file mode 100755 index a69c42e0f..000000000 --- a/plugins/filterizr/Spinner/StyledSpinner.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import StyledFilterizrElement from '../StyledFilterizrElement'; -export default class StyledSpinner extends StyledFilterizrElement { - initialize(): void; - fadeOut(): Promise; -} diff --git a/plugins/filterizr/Spinner/index.d.ts b/plugins/filterizr/Spinner/index.d.ts deleted file mode 100755 index f90663a51..000000000 --- a/plugins/filterizr/Spinner/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Spinner'; diff --git a/plugins/filterizr/Spinner/makeSpinner.d.ts b/plugins/filterizr/Spinner/makeSpinner.d.ts deleted file mode 100755 index b51648b2e..000000000 --- a/plugins/filterizr/Spinner/makeSpinner.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { SpinnerOptions } from '../types/interfaces'; -export declare function makeSpinner({ fillColor }: SpinnerOptions): HTMLElement; diff --git a/plugins/filterizr/StyledFilterizrElement.d.ts b/plugins/filterizr/StyledFilterizrElement.d.ts deleted file mode 100755 index 269a0b507..000000000 --- a/plugins/filterizr/StyledFilterizrElement.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Destructible } from './types/interfaces/Destructible'; -import FilterizrOptions from './FilterizrOptions'; -export default abstract class StyledFilterizrElement implements Destructible { - protected options: FilterizrOptions; - protected node: HTMLElement; - constructor(node: HTMLElement, options: FilterizrOptions); - destroy(): void; - protected animate(targetStyles: object): Promise; - protected set(targetStyles: object): void; - protected remove(propertyName: string): void; - abstract initialize(): void | Promise; -} diff --git a/plugins/filterizr/StyledFilterizrElements.d.ts b/plugins/filterizr/StyledFilterizrElements.d.ts deleted file mode 100755 index 634ce35f9..000000000 --- a/plugins/filterizr/StyledFilterizrElements.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default abstract class StyledFilterizrElements { -} diff --git a/plugins/filterizr/animate.d.ts b/plugins/filterizr/animate.d.ts deleted file mode 100755 index 2d8f85438..000000000 --- a/plugins/filterizr/animate.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare class Animator { - static animate(node: HTMLElement, targetStyles: object): Promise; - private static process; -} -declare const _default: typeof Animator.animate; -export default _default; diff --git a/plugins/filterizr/config/cssEasingValuesRegexp.d.ts b/plugins/filterizr/config/cssEasingValuesRegexp.d.ts deleted file mode 100755 index f7cc5e872..000000000 --- a/plugins/filterizr/config/cssEasingValuesRegexp.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * A Regexp to validate potential values for the CSS easing property of transitions. - */ -export declare const cssEasingValuesRegexp: RegExp; diff --git a/plugins/filterizr/config/filterizrState.d.ts b/plugins/filterizr/config/filterizrState.d.ts deleted file mode 100755 index a418b0ce2..000000000 --- a/plugins/filterizr/config/filterizrState.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -interface FilterizrState { - IDLE: 'IDLE'; - FILTERING: 'FILTERING'; - SORTING: 'SORTING'; - SHUFFLING: 'SHUFFLING'; -} -/** - * Possible animation states for Filterizr - */ -export declare const FILTERIZR_STATE: FilterizrState; -export {}; diff --git a/plugins/filterizr/config/index.d.ts b/plugins/filterizr/config/index.d.ts deleted file mode 100755 index 5e84dc22f..000000000 --- a/plugins/filterizr/config/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { FILTERIZR_STATE } from './filterizrState'; -export { LAYOUT } from './layout'; -export { cssEasingValuesRegexp } from './cssEasingValuesRegexp'; diff --git a/plugins/filterizr/config/layout.d.ts b/plugins/filterizr/config/layout.d.ts deleted file mode 100755 index 53be33f8a..000000000 --- a/plugins/filterizr/config/layout.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -interface Layout { - SAME_SIZE: 'sameSize'; - SAME_HEIGHT: 'sameHeight'; - SAME_WIDTH: 'sameWidth'; - PACKED: 'packed'; - HORIZONTAL: 'horizontal'; - VERTICAL: 'vertical'; -} -/** - * Possible grid layout modes - */ -export declare const LAYOUT: Layout; -export {}; diff --git a/plugins/filterizr/index.d.ts b/plugins/filterizr/index.d.ts deleted file mode 100755 index 7f753b22e..000000000 --- a/plugins/filterizr/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Filterizr is a JavaScript library that sorts, shuffles and applies stunning - * filters over responsive galleries using CSS3 transitions and - * custom CSS effects. - * @author Yiotis Kaltsikis - * @see {@link http://yiotis.net/filterizr} - * @license MIT - */ -export { default } from './Filterizr'; diff --git a/plugins/filterizr/index.jquery.d.ts b/plugins/filterizr/index.jquery.d.ts deleted file mode 100755 index 5f8461219..000000000 --- a/plugins/filterizr/index.jquery.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Filterizr is a JavaScript library that sorts, shuffles and applies stunning filters over - * responsive galleries using CSS3 transitions and custom CSS effects. - * - * @author Yiotis Kaltsikis - * @see {@link http://yiotis.net/filterizr} - * @license MIT - */ -import Filterizr from './Filterizr'; -export default Filterizr; diff --git a/plugins/filterizr/makeLayoutPositions/Packer.d.ts b/plugins/filterizr/makeLayoutPositions/Packer.d.ts deleted file mode 100755 index 96ddc854f..000000000 --- a/plugins/filterizr/makeLayoutPositions/Packer.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Modified version of Jake Gordon's Bin Packing algorithm used for Filterizr's 'packed' layout - * @see {@link https://github.com/jakesgordon/bin-packing} - */ -interface PackerRoot { - x: number; - y: number; - w: number; - h?: number; - used?: boolean; - down?: PackerRoot; - right?: PackerRoot; -} -interface PackerBlock { - x?: number; - y?: number; - w?: number; - h?: number; - fit?: PackerRoot | void; -} -export default class Packer { - root: PackerRoot; - constructor(w: number); - init(w: number): void; - fit(blocks: PackerBlock[]): void; - findNode(root: PackerRoot, w: number, h: number): PackerRoot | void; - splitNode(node: PackerRoot, w: number, h: number): PackerRoot; - growDown(w: number, h: number): PackerRoot | void; -} -export {}; diff --git a/plugins/filterizr/makeLayoutPositions/index.d.ts b/plugins/filterizr/makeLayoutPositions/index.d.ts deleted file mode 100755 index 45ca82b56..000000000 --- a/plugins/filterizr/makeLayoutPositions/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './makeLayoutPositions'; diff --git a/plugins/filterizr/makeLayoutPositions/makeHorizontalLayoutPositions.d.ts b/plugins/filterizr/makeLayoutPositions/makeHorizontalLayoutPositions.d.ts deleted file mode 100755 index be5d96d65..000000000 --- a/plugins/filterizr/makeLayoutPositions/makeHorizontalLayoutPositions.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ContainerLayout, Dimensions } from '../types/interfaces'; -declare const _default: (itemsDimensions: Dimensions[], gutterPixels: number) => ContainerLayout; -/** - * Horizontal layout algorithm that arranges all FilterItems in one row. Their width may vary. - */ -export default _default; diff --git a/plugins/filterizr/makeLayoutPositions/makeLayoutPositions.d.ts b/plugins/filterizr/makeLayoutPositions/makeLayoutPositions.d.ts deleted file mode 100755 index 3f79af046..000000000 --- a/plugins/filterizr/makeLayoutPositions/makeLayoutPositions.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ContainerLayout, Dimensions, Options } from '../types/interfaces'; -declare const _default: (containerWidth: number, itemsDimensions: Dimensions[], { gutterPixels, layout }: Options) => ContainerLayout; -/** - * Creates the specifications of the dimensions of the - * container and items for the next render of Filterizr. - */ -export default _default; diff --git a/plugins/filterizr/makeLayoutPositions/makePackedLayoutPositions.d.ts b/plugins/filterizr/makeLayoutPositions/makePackedLayoutPositions.d.ts deleted file mode 100755 index 7a73ad3c1..000000000 --- a/plugins/filterizr/makeLayoutPositions/makePackedLayoutPositions.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ContainerLayout, Dimensions } from '../types/interfaces'; -declare const _default: (containerWidth: number, itemsDimensions: Dimensions[], gutterPixels: number) => ContainerLayout; -/** - * Packed layout for items that can have varying width as well as varying height. - */ -export default _default; diff --git a/plugins/filterizr/makeLayoutPositions/makeSameHeightLayoutPositions.d.ts b/plugins/filterizr/makeLayoutPositions/makeSameHeightLayoutPositions.d.ts deleted file mode 100755 index 947c52b06..000000000 --- a/plugins/filterizr/makeLayoutPositions/makeSameHeightLayoutPositions.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ContainerLayout, Dimensions } from '../types/interfaces'; -declare const _default: (containerWidth: number, itemsDimensions: Dimensions[], gutterPixels: number) => ContainerLayout; -/** - * Same height layout for items that have the same height, but can have varying width - */ -export default _default; diff --git a/plugins/filterizr/makeLayoutPositions/makeSameSizeLayoutPosition.d.ts b/plugins/filterizr/makeLayoutPositions/makeSameSizeLayoutPosition.d.ts deleted file mode 100755 index d8dde5d16..000000000 --- a/plugins/filterizr/makeLayoutPositions/makeSameSizeLayoutPosition.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ContainerLayout, Dimensions } from '../types/interfaces'; -declare const _default: (containerWidth: number, itemsDimensions: Dimensions[], gutterPixels: number) => ContainerLayout; -/** - * Same size layout for items that have the same width/height - */ -export default _default; diff --git a/plugins/filterizr/makeLayoutPositions/makeSameWidthLayoutPositions.d.ts b/plugins/filterizr/makeLayoutPositions/makeSameWidthLayoutPositions.d.ts deleted file mode 100755 index 5c5202503..000000000 --- a/plugins/filterizr/makeLayoutPositions/makeSameWidthLayoutPositions.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ContainerLayout, Dimensions } from '../types/interfaces'; -declare const _default: (containerWidth: number, itemsDimensions: Dimensions[], gutterPixels: number) => ContainerLayout; -/** - * Same width layout for items that have the same width and varying height - */ -export default _default; diff --git a/plugins/filterizr/makeLayoutPositions/makeVerticalLayoutPositions.d.ts b/plugins/filterizr/makeLayoutPositions/makeVerticalLayoutPositions.d.ts deleted file mode 100755 index c630e160f..000000000 --- a/plugins/filterizr/makeLayoutPositions/makeVerticalLayoutPositions.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ContainerLayout, Dimensions } from '../types/interfaces'; -declare const _default: (itemsDimensions: Dimensions[], gutterPixels: number) => ContainerLayout; -/** - * Vertical layout algorithm that arranges all FilterItems in one column. Their height may vary. - */ -export default _default; diff --git a/plugins/filterizr/types/index.d.ts b/plugins/filterizr/types/index.d.ts deleted file mode 100755 index 33547eba5..000000000 --- a/plugins/filterizr/types/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare type Filter = string | string[]; -export declare type FilterizrState = 'IDLE' | 'FILTERING' | 'SORTING' | 'SHUFFLING'; -export declare type Layout = 'horizontal' | 'vertical' | 'sameHeight' | 'sameWidth' | 'sameSize' | 'packed'; diff --git a/plugins/filterizr/types/interfaces/BaseOptions.d.ts b/plugins/filterizr/types/interfaces/BaseOptions.d.ts deleted file mode 100755 index f82907b63..000000000 --- a/plugins/filterizr/types/interfaces/BaseOptions.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { SpinnerOptions } from './SpinnerOptions'; -import { RawOptionsCallbacks } from './RawOptionsCallbacks'; -import { Layout } from '..'; -export interface BaseOptions { - animationDuration?: number; - callbacks?: RawOptionsCallbacks; - controlsSelector?: string; - delay?: number; - delayMode?: 'alternate' | 'progressive'; - easing?: string; - filterOutCss?: object; - filterInCss?: object; - gridItemsSelector?: string; - gutterPixels?: number; - layout?: Layout; - multifilterLogicalOperator?: 'or' | 'and'; - searchTerm?: string; - setupControls?: boolean; - spinner?: SpinnerOptions; -} diff --git a/plugins/filterizr/types/interfaces/ContainerLayout.d.ts b/plugins/filterizr/types/interfaces/ContainerLayout.d.ts deleted file mode 100755 index b979c5aef..000000000 --- a/plugins/filterizr/types/interfaces/ContainerLayout.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Position } from './Position'; -export interface ContainerLayout { - containerHeight: number; - itemsPositions: Position[]; -} diff --git a/plugins/filterizr/types/interfaces/Destructible.d.ts b/plugins/filterizr/types/interfaces/Destructible.d.ts deleted file mode 100755 index c5ba34b42..000000000 --- a/plugins/filterizr/types/interfaces/Destructible.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Destructible { - destroy(): void | Promise; -} diff --git a/plugins/filterizr/types/interfaces/Dictionary.d.ts b/plugins/filterizr/types/interfaces/Dictionary.d.ts deleted file mode 100755 index cf55c6f30..000000000 --- a/plugins/filterizr/types/interfaces/Dictionary.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Dictionary { - [key: string]: any; -} diff --git a/plugins/filterizr/types/interfaces/Dimensions.d.ts b/plugins/filterizr/types/interfaces/Dimensions.d.ts deleted file mode 100755 index 07ae5a343..000000000 --- a/plugins/filterizr/types/interfaces/Dimensions.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface Dimensions { - width: number; - height: number; -} diff --git a/plugins/filterizr/types/interfaces/Options.d.ts b/plugins/filterizr/types/interfaces/Options.d.ts deleted file mode 100755 index ea92d21f3..000000000 --- a/plugins/filterizr/types/interfaces/Options.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { BaseOptions } from './BaseOptions'; -import ActiveFilter from '../../ActiveFilter'; -export interface Options extends BaseOptions { - filter: ActiveFilter; -} diff --git a/plugins/filterizr/types/interfaces/Position.d.ts b/plugins/filterizr/types/interfaces/Position.d.ts deleted file mode 100755 index 7401f9fae..000000000 --- a/plugins/filterizr/types/interfaces/Position.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface Position { - left: number; - top: number; -} diff --git a/plugins/filterizr/types/interfaces/RawOptions.d.ts b/plugins/filterizr/types/interfaces/RawOptions.d.ts deleted file mode 100755 index 4ace1a3d9..000000000 --- a/plugins/filterizr/types/interfaces/RawOptions.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { BaseOptions } from './BaseOptions'; -export interface RawOptions extends BaseOptions { - filter?: string | string[]; -} diff --git a/plugins/filterizr/types/interfaces/RawOptionsCallbacks.d.ts b/plugins/filterizr/types/interfaces/RawOptionsCallbacks.d.ts deleted file mode 100755 index 076a3d3de..000000000 --- a/plugins/filterizr/types/interfaces/RawOptionsCallbacks.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface RawOptionsCallbacks { - onInit?: EventListener; - onFilteringStart?: EventListener; - onFilteringEnd?: EventListener; - onShufflingStart?: EventListener; - onShufflingEnd?: EventListener; - onSortingStart?: EventListener; - onSortingEnd?: EventListener; - onTransitionEnd?: EventListener; -} diff --git a/plugins/filterizr/types/interfaces/Resizable.d.ts b/plugins/filterizr/types/interfaces/Resizable.d.ts deleted file mode 100755 index 4c6aa1e29..000000000 --- a/plugins/filterizr/types/interfaces/Resizable.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface Resizable { - readonly dimensions: { - width: number; - height: number; - }; -} diff --git a/plugins/filterizr/types/interfaces/SpinnerOptions.d.ts b/plugins/filterizr/types/interfaces/SpinnerOptions.d.ts deleted file mode 100755 index 48fd8adba..000000000 --- a/plugins/filterizr/types/interfaces/SpinnerOptions.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Dictionary } from './Dictionary'; -export interface SpinnerOptions { - enabled?: boolean; - fillColor?: string; - styles?: Dictionary; -} diff --git a/plugins/filterizr/types/interfaces/Styleable.d.ts b/plugins/filterizr/types/interfaces/Styleable.d.ts deleted file mode 100755 index 867ead269..000000000 --- a/plugins/filterizr/types/interfaces/Styleable.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import StyledFilterizrElement from '../../StyledFilterizrElement'; -import StyledFilterizrElements from '../../StyledFilterizrElements'; -export interface Styleable { - readonly styles: StyledFilterizrElement | StyledFilterizrElements; -} diff --git a/plugins/filterizr/types/interfaces/index.d.ts b/plugins/filterizr/types/interfaces/index.d.ts deleted file mode 100755 index 382a0ee2a..000000000 --- a/plugins/filterizr/types/interfaces/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export { BaseOptions } from './BaseOptions'; -export { ContainerLayout } from './ContainerLayout'; -export { Destructible } from './Destructible'; -export { Dictionary } from './Dictionary'; -export { Dimensions } from './Dimensions'; -export { Options } from './Options'; -export { Position } from './Position'; -export { RawOptions } from './RawOptions'; -export { RawOptionsCallbacks } from './RawOptionsCallbacks'; -export { Resizable } from './Resizable'; -export { SpinnerOptions } from './SpinnerOptions'; -export { Styleable } from './Styleable'; diff --git a/plugins/filterizr/utils/allStringsOfArray1InArray2.d.ts b/plugins/filterizr/utils/allStringsOfArray1InArray2.d.ts deleted file mode 100755 index d128448e5..000000000 --- a/plugins/filterizr/utils/allStringsOfArray1InArray2.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const allStringsOfArray1InArray2: (arr1: string[], arr2: string[]) => boolean; diff --git a/plugins/filterizr/utils/checkOptionForErrors.d.ts b/plugins/filterizr/utils/checkOptionForErrors.d.ts deleted file mode 100755 index 2d4f17bc5..000000000 --- a/plugins/filterizr/utils/checkOptionForErrors.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Error checking method to restrict a prop to some allowed values - * @param {String} name of the option key in the options object - * @param {String|Number|Object|Function|Array|Boolean} value of the option - * @param {String} type of the property - * @param {Array} allowed accepted values for option - * @param {String} furtherHelpLink a link to docs for further help - */ -export declare const checkOptionForErrors: (name: string, value: string | number | boolean | object | Function | any[], type?: string, allowed?: RegExp | any[], furtherHelpLink?: string) => void; diff --git a/plugins/filterizr/utils/debounce.d.ts b/plugins/filterizr/utils/debounce.d.ts deleted file mode 100755 index aa3795cb1..000000000 --- a/plugins/filterizr/utils/debounce.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Debounce of Underscore.js - */ -export declare const debounce: (func: Function, wait: number, immediate: boolean) => Function; diff --git a/plugins/filterizr/utils/filterItemArraysHaveSameSorting.d.ts b/plugins/filterizr/utils/filterItemArraysHaveSameSorting.d.ts deleted file mode 100755 index a6ebfc62c..000000000 --- a/plugins/filterizr/utils/filterItemArraysHaveSameSorting.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import FilterItem from '../FilterItem'; -/** - * Simple method to check if two arrays of FilterItems - * are sorted in the same manner or not. - * @param {Array} arr1 the first array of FilterItems - * @param {Array} arr2 the second array of FilterItems - * @return {Boolean} equality - */ -export declare const filterItemArraysHaveSameSorting: (filterItemsA: FilterItem[], filterItemsB: FilterItem[]) => boolean; diff --git a/plugins/filterizr/utils/getDataAttributesOfHTMLNode.d.ts b/plugins/filterizr/utils/getDataAttributesOfHTMLNode.d.ts deleted file mode 100755 index 1b2d4d1cf..000000000 --- a/plugins/filterizr/utils/getDataAttributesOfHTMLNode.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Dictionary } from '../types/interfaces/Dictionary'; -export declare function getDataAttributesOfHTMLNode(node: Element): Dictionary; diff --git a/plugins/filterizr/utils/getHTMLElement.d.ts b/plugins/filterizr/utils/getHTMLElement.d.ts deleted file mode 100755 index 099a09baf..000000000 --- a/plugins/filterizr/utils/getHTMLElement.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Wrapper around document.querySelector, will function as - * an identity function if an HTML element is passed in - * @param {HTMLElement|string} nodeOrSelector - */ -export declare const getHTMLElement: (selectorOrNode: string | HTMLElement) => HTMLElement; diff --git a/plugins/filterizr/utils/index.d.ts b/plugins/filterizr/utils/index.d.ts deleted file mode 100755 index 62ca737b6..000000000 --- a/plugins/filterizr/utils/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export { allStringsOfArray1InArray2 } from './allStringsOfArray1InArray2'; -export { checkOptionForErrors } from './checkOptionForErrors'; -export { debounce } from './debounce'; -export { filterItemArraysHaveSameSorting, } from './filterItemArraysHaveSameSorting'; -export { getDataAttributesOfHTMLNode } from './getDataAttributesOfHTMLNode'; -export { getHTMLElement } from './getHTMLElement'; -export { intersection } from './intersection'; -export { merge } from './merge'; -export { noop } from './noop'; -export { setStyles } from './setStyles'; -export { shuffle } from './shuffle'; -export { sortBy } from './sortBy'; diff --git a/plugins/filterizr/utils/intersection.d.ts b/plugins/filterizr/utils/intersection.d.ts deleted file mode 100755 index 70b6c98f8..000000000 --- a/plugins/filterizr/utils/intersection.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * A function get the intersection of two arrays. IE9+. - */ -export declare const intersection: (arr1: any[], arr2: any[]) => any[]; diff --git a/plugins/filterizr/utils/merge.d.ts b/plugins/filterizr/utils/merge.d.ts deleted file mode 100755 index 00f19f2a7..000000000 --- a/plugins/filterizr/utils/merge.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Dictionary } from '../types/interfaces/Dictionary'; -/** - * Deep merge two objects. - */ -export declare function merge(target: Dictionary, ...sources: Dictionary[]): Dictionary; diff --git a/plugins/filterizr/utils/noop.d.ts b/plugins/filterizr/utils/noop.d.ts deleted file mode 100755 index ce943ff51..000000000 --- a/plugins/filterizr/utils/noop.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * A no-operation function - */ -export declare const noop: () => void; diff --git a/plugins/filterizr/utils/setStyles.d.ts b/plugins/filterizr/utils/setStyles.d.ts deleted file mode 100755 index bc91f3134..000000000 --- a/plugins/filterizr/utils/setStyles.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Set inline styles on an HTML node - * @param {HTMLElement} node - HTML node - * @param {Object} styles - object with styles - * @returns {undefined} - */ -export declare function setStyles(node: Element, styles: any): void; diff --git a/plugins/filterizr/utils/shuffle.d.ts b/plugins/filterizr/utils/shuffle.d.ts deleted file mode 100755 index 9d17417ce..000000000 --- a/plugins/filterizr/utils/shuffle.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Fisher-Yates shuffle ES6 non-mutating implementation. - * @param {Array} array the array to shuffle - * @return {Array} shuffled array without mutating the initial array. - */ -export declare const shuffle: (array: any[]) => any[]; diff --git a/plugins/filterizr/utils/sortBy.d.ts b/plugins/filterizr/utils/sortBy.d.ts deleted file mode 100755 index 44de50991..000000000 --- a/plugins/filterizr/utils/sortBy.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Simple non-mutating sorting function for arrays of objects by a property - * @param {Array} array to sort - * @param {Function} propFn fetches the property by which to sort - * @return {Array} a new sorted array - */ -export declare const sortBy: (array: any[], propFn: Function) => any[]; diff --git a/plugins/fullcalendar-bootstrap/main.d.ts b/plugins/fullcalendar-bootstrap/main.d.ts deleted file mode 100644 index 4aa91f33d..000000000 --- a/plugins/fullcalendar-bootstrap/main.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by dts-bundle v0.7.3-fork.1 -// Dependencies for this module: -// ../../../../../@fullcalendar/core - -declare module '@fullcalendar/bootstrap' { - import { Theme } from '@fullcalendar/core'; - export class BootstrapTheme extends Theme { - } - const _default: import("@fullcalendar/core").PluginDef; - export default _default; -} - diff --git a/plugins/fullcalendar-daygrid/main.d.ts b/plugins/fullcalendar-daygrid/main.d.ts deleted file mode 100644 index 312ddd97b..000000000 --- a/plugins/fullcalendar-daygrid/main.d.ts +++ /dev/null @@ -1,316 +0,0 @@ -// Generated by dts-bundle v0.7.3-fork.1 -// Dependencies for this module: -// ../../../../../@fullcalendar/core - -declare module '@fullcalendar/daygrid' { - export { default as SimpleDayGrid, DayGridSlicer } from '@fullcalendar/daygrid/SimpleDayGrid'; - export { default as DayGrid, DayGridSeg } from '@fullcalendar/daygrid/DayGrid'; - export { default as AbstractDayGridView } from '@fullcalendar/daygrid/AbstractDayGridView'; - export { default as DayGridView, buildDayTable as buildBasicDayTable } from '@fullcalendar/daygrid/DayGridView'; - export { default as DayBgRow } from '@fullcalendar/daygrid/DayBgRow'; - const _default: import("@fullcalendar/core").PluginDef; - export default _default; -} - -declare module '@fullcalendar/daygrid/SimpleDayGrid' { - import { DateProfile, EventStore, EventUiHash, DateSpan, EventInteractionState, DayTable, Duration, DateComponent, DateRange, Slicer, Hit, ComponentContext } from '@fullcalendar/core'; - import { default as DayGrid, DayGridSeg } from '@fullcalendar/daygrid/DayGrid'; - export interface SimpleDayGridProps { - dateProfile: DateProfile | null; - dayTable: DayTable; - nextDayThreshold: Duration; - businessHours: EventStore; - eventStore: EventStore; - eventUiBases: EventUiHash; - dateSelection: DateSpan | null; - eventSelection: string; - eventDrag: EventInteractionState | null; - eventResize: EventInteractionState | null; - isRigid: boolean; - } - export { SimpleDayGrid as default, SimpleDayGrid }; - class SimpleDayGrid extends DateComponent { - dayGrid: DayGrid; - constructor(dayGrid: DayGrid); - firstContext(context: ComponentContext): void; - destroy(): void; - render(props: SimpleDayGridProps, context: ComponentContext): void; - buildPositionCaches(): void; - queryHit(positionLeft: number, positionTop: number): Hit; - } - export class DayGridSlicer extends Slicer { - sliceRange(dateRange: DateRange, dayTable: DayTable): DayGridSeg[]; - } -} - -declare module '@fullcalendar/daygrid/DayGrid' { - import { PositionCache, DateMarker, DateComponent, EventSegUiInteractionState, Seg, DateProfile, ComponentContext } from '@fullcalendar/core'; - import Popover from '@fullcalendar/daygrid/Popover'; - import DayGridEventRenderer from '@fullcalendar/daygrid/DayGridEventRenderer'; - import DayTile from '@fullcalendar/daygrid/DayTile'; - export interface RenderProps { - renderNumberIntroHtml: (row: number, dayGrid: DayGrid) => string; - renderBgIntroHtml: () => string; - renderIntroHtml: () => string; - colWeekNumbersVisible: boolean; - cellWeekNumbersVisible: boolean; - } - export interface DayGridSeg extends Seg { - row: number; - firstCol: number; - lastCol: number; - } - export interface DayGridCell { - date: DateMarker; - htmlAttrs?: string; - } - export interface DayGridProps { - dateProfile: DateProfile; - cells: DayGridCell[][]; - businessHourSegs: DayGridSeg[]; - bgEventSegs: DayGridSeg[]; - fgEventSegs: DayGridSeg[]; - dateSelectionSegs: DayGridSeg[]; - eventSelection: string; - eventDrag: EventSegUiInteractionState | null; - eventResize: EventSegUiInteractionState | null; - isRigid: boolean; - } - export { DayGrid as default, DayGrid }; - class DayGrid extends DateComponent { - eventRenderer: DayGridEventRenderer; - renderProps: RenderProps; - rowCnt: number; - colCnt: number; - bottomCoordPadding: number; - rowEls: HTMLElement[]; - cellEls: HTMLElement[]; - isCellSizesDirty: boolean; - rowPositions: PositionCache; - colPositions: PositionCache; - segPopover: Popover; - segPopoverTile: DayTile; - constructor(el: any, renderProps: RenderProps); - render(props: DayGridProps, context: ComponentContext): void; - destroy(): void; - getCellRange(row: any, col: any): { - start: Date; - end: Date; - }; - updateSegPopoverTile(date?: any, segs?: any): void; - _renderCells(cells: DayGridCell[][], isRigid: boolean): void; - _unrenderCells(): void; - renderDayRowHtml(row: any, isRigid: any): string; - getIsNumbersVisible(): boolean; - getIsDayNumbersVisible(): boolean; - renderNumberTrHtml(row: number): string; - renderNumberCellsHtml(row: any): string; - renderNumberCellHtml(date: any): string; - updateSize(isResize: boolean): void; - buildPositionCaches(): void; - buildColPositions(): void; - buildRowPositions(): void; - positionToHit(leftPosition: any, topPosition: any): { - row: any; - col: any; - dateSpan: { - range: { - start: Date; - end: Date; - }; - allDay: boolean; - }; - dayEl: HTMLElement; - relativeRect: { - left: any; - right: any; - top: any; - bottom: any; - }; - }; - getCellEl(row: any, col: any): HTMLElement; - _renderEventDrag(state: EventSegUiInteractionState): void; - _unrenderEventDrag(state: EventSegUiInteractionState): void; - _renderEventResize(state: EventSegUiInteractionState): void; - _unrenderEventResize(state: EventSegUiInteractionState): void; - removeSegPopover(): void; - limitRows(levelLimit: any): void; - computeRowLevelLimit(row: any): (number | false); - limitRow(row: any, levelLimit: any): void; - unlimitRow(row: any): void; - renderMoreLink(row: any, col: any, hiddenSegs: any): HTMLElement; - showSegPopover(row: any, col: any, moreLink: HTMLElement, segs: any): void; - resliceDaySegs(segs: any, dayDate: any): any[]; - getMoreLinkText(num: any): any; - getCellSegs(row: any, col: any, startLevel?: any): any[]; - } -} - -declare module '@fullcalendar/daygrid/AbstractDayGridView' { - import { ScrollComponent, View, Duration, ComponentContext, ViewProps } from '@fullcalendar/core'; - import DayGrid from '@fullcalendar/daygrid/DayGrid'; - export { AbstractDayGridView as default, AbstractDayGridView }; - abstract class AbstractDayGridView extends View { - scroller: ScrollComponent; - dayGrid: DayGrid; - colWeekNumbersVisible: boolean; - cellWeekNumbersVisible: boolean; - weekNumberWidth: number; - _processOptions(options: any): void; - render(props: ViewProps, context: ComponentContext): void; - destroy(): void; - _renderSkeleton(context: ComponentContext): void; - _unrenderSkeleton(): void; - renderSkeletonHtml(): string; - weekNumberStyleAttr(): string; - hasRigidRows(): boolean; - updateSize(isResize: boolean, viewHeight: number, isAuto: boolean): void; - updateBaseSize(isResize: boolean, viewHeight: number, isAuto: boolean): void; - computeScrollerHeight(viewHeight: any): number; - setGridHeight(height: any, isAuto: any): void; - computeDateScroll(duration: Duration): { - top: number; - }; - queryDateScroll(): { - top: number; - }; - applyDateScroll(scroll: any): void; - renderHeadIntroHtml: () => string; - renderDayGridNumberIntroHtml: (row: number, dayGrid: DayGrid) => string; - renderDayGridBgIntroHtml: () => string; - renderDayGridIntroHtml: () => string; - } -} - -declare module '@fullcalendar/daygrid/DayGridView' { - import { DayHeader, ComponentContext, DateProfileGenerator, DateProfile, ViewProps, DayTable } from '@fullcalendar/core'; - import AbstractDayGridView from '@fullcalendar/daygrid/AbstractDayGridView'; - import SimpleDayGrid from '@fullcalendar/daygrid/SimpleDayGrid'; - export { DayGridView as default, DayGridView }; - class DayGridView extends AbstractDayGridView { - header: DayHeader; - simpleDayGrid: SimpleDayGrid; - dayTable: DayTable; - render(props: ViewProps, context: ComponentContext): void; - _renderSkeleton(context: ComponentContext): void; - _unrenderSkeleton(): void; - } - export function buildDayTable(dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator): DayTable; -} - -declare module '@fullcalendar/daygrid/DayBgRow' { - import { ComponentContext, DateMarker, DateProfile } from '@fullcalendar/core'; - export interface DayBgCell { - date: DateMarker; - htmlAttrs?: string; - } - export interface DayBgRowProps { - cells: DayBgCell[]; - dateProfile: DateProfile; - renderIntroHtml?: () => string; - } - export { DayBgRow as default, DayBgRow }; - class DayBgRow { - context: ComponentContext; - constructor(context: ComponentContext); - renderHtml(props: DayBgRowProps): string; - } -} - -declare module '@fullcalendar/daygrid/Popover' { - export interface PopoverOptions { - className?: string; - content?: (el: HTMLElement) => void; - parentEl: HTMLElement; - autoHide?: boolean; - top?: number; - left?: number; - right?: number; - viewportConstrain?: boolean; - } - export { Popover as default, Popover }; - class Popover { - isHidden: boolean; - options: PopoverOptions; - el: HTMLElement; - margin: number; - constructor(options: PopoverOptions); - show(): void; - hide(): void; - render(): void; - documentMousedown: (ev: any) => void; - destroy(): void; - position(): void; - trigger(name: any): void; - } -} - -declare module '@fullcalendar/daygrid/DayGridEventRenderer' { - import { Seg } from '@fullcalendar/core'; - import DayGrid from '@fullcalendar/daygrid/DayGrid'; - import SimpleDayGridEventRenderer from '@fullcalendar/daygrid/SimpleDayGridEventRenderer'; - export { DayGridEventRenderer as default, DayGridEventRenderer }; - class DayGridEventRenderer extends SimpleDayGridEventRenderer { - dayGrid: DayGrid; - rowStructs: any; - constructor(dayGrid: DayGrid); - attachSegs(segs: Seg[], mirrorInfo: any): void; - detachSegs(): void; - renderSegRows(segs: Seg[]): any[]; - renderSegRow(row: any, rowSegs: any): { - row: any; - tbodyEl: HTMLTableSectionElement; - cellMatrix: any[]; - segMatrix: any[]; - segLevels: any[]; - segs: any; - }; - buildSegLevels(segs: Seg[]): any[]; - groupSegRows(segs: Seg[]): any[]; - computeDisplayEventEnd(): boolean; - } -} - -declare module '@fullcalendar/daygrid/DayTile' { - import { DateComponent, Seg, Hit, DateMarker, ComponentContext, EventInstanceHash } from '@fullcalendar/core'; - import SimpleDayGridEventRenderer from '@fullcalendar/daygrid/SimpleDayGridEventRenderer'; - export interface DayTileProps { - date: DateMarker; - fgSegs: Seg[]; - eventSelection: string; - eventDragInstances: EventInstanceHash; - eventResizeInstances: EventInstanceHash; - } - export { DayTile as default, DayTile }; - class DayTile extends DateComponent { - segContainerEl: HTMLElement; - constructor(el: HTMLElement); - firstContext(context: ComponentContext): void; - render(props: DayTileProps, context: ComponentContext): void; - destroy(): void; - _renderFrame(date: DateMarker): void; - queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit | null; - } - export class DayTileEventRenderer extends SimpleDayGridEventRenderer { - dayTile: DayTile; - constructor(dayTile: any); - attachSegs(segs: Seg[]): void; - detachSegs(segs: Seg[]): void; - } -} - -declare module '@fullcalendar/daygrid/SimpleDayGridEventRenderer' { - import { FgEventRenderer, Seg } from '@fullcalendar/core'; - export { SimpleDayGridEventRenderer as default, SimpleDayGridEventRenderer }; - abstract class SimpleDayGridEventRenderer extends FgEventRenderer { - renderSegHtml(seg: Seg, mirrorInfo: any): string; - computeEventTimeFormat(): { - hour: string; - minute: string; - omitZeroMinute: boolean; - meridiem: string; - }; - computeDisplayEventEnd(): boolean; - } -} - diff --git a/plugins/fullcalendar-interaction/main.d.ts b/plugins/fullcalendar-interaction/main.d.ts deleted file mode 100644 index b7398ba76..000000000 --- a/plugins/fullcalendar-interaction/main.d.ts +++ /dev/null @@ -1,323 +0,0 @@ -// Generated by dts-bundle v0.7.3-fork.1 -// Dependencies for this module: -// ../../../../../@fullcalendar/core - -declare module '@fullcalendar/interaction' { - import FeaturefulElementDragging from '@fullcalendar/interaction/dnd/FeaturefulElementDragging'; - const _default: import("@fullcalendar/core").PluginDef; - export default _default; - export { FeaturefulElementDragging }; - export { default as PointerDragging } from '@fullcalendar/interaction/dnd/PointerDragging'; - export { default as Draggable } from '@fullcalendar/interaction/interactions-external/ExternalDraggable'; - export { default as ThirdPartyDraggable } from '@fullcalendar/interaction/interactions-external/ThirdPartyDraggable'; -} - -declare module '@fullcalendar/interaction/dnd/FeaturefulElementDragging' { - import { PointerDragEvent, ElementDragging } from '@fullcalendar/core'; - import PointerDragging from '@fullcalendar/interaction/dnd/PointerDragging'; - import ElementMirror from '@fullcalendar/interaction/dnd/ElementMirror'; - import AutoScroller from '@fullcalendar/interaction/dnd/AutoScroller'; - export { FeaturefulElementDragging as default, FeaturefulElementDragging }; - class FeaturefulElementDragging extends ElementDragging { - pointer: PointerDragging; - mirror: ElementMirror; - autoScroller: AutoScroller; - delay: number | null; - minDistance: number; - touchScrollAllowed: boolean; - mirrorNeedsRevert: boolean; - isInteracting: boolean; - isDragging: boolean; - isDelayEnded: boolean; - isDistanceSurpassed: boolean; - delayTimeoutId: number | null; - constructor(containerEl: HTMLElement); - destroy(): void; - onPointerDown: (ev: PointerDragEvent) => void; - onPointerMove: (ev: PointerDragEvent) => void; - onPointerUp: (ev: PointerDragEvent) => void; - startDelay(ev: PointerDragEvent): void; - handleDelayEnd(ev: PointerDragEvent): void; - handleDistanceSurpassed(ev: PointerDragEvent): void; - tryStartDrag(ev: PointerDragEvent): void; - tryStopDrag(ev: PointerDragEvent): void; - stopDrag(ev: PointerDragEvent): void; - setIgnoreMove(bool: boolean): void; - setMirrorIsVisible(bool: boolean): void; - setMirrorNeedsRevert(bool: boolean): void; - setAutoScrollEnabled(bool: boolean): void; - } -} - -declare module '@fullcalendar/interaction/dnd/PointerDragging' { - import { EmitterMixin, PointerDragEvent } from '@fullcalendar/core'; - export { PointerDragging as default, PointerDragging }; - class PointerDragging { - containerEl: EventTarget; - subjectEl: HTMLElement | null; - downEl: HTMLElement | null; - emitter: EmitterMixin; - selector: string; - handleSelector: string; - shouldIgnoreMove: boolean; - shouldWatchScroll: boolean; - isDragging: boolean; - isTouchDragging: boolean; - wasTouchScroll: boolean; - origPageX: number; - origPageY: number; - prevPageX: number; - prevPageY: number; - prevScrollX: number; - prevScrollY: number; - constructor(containerEl: EventTarget); - destroy(): void; - tryStart(ev: UIEvent): boolean; - cleanup(): void; - querySubjectEl(ev: UIEvent): HTMLElement; - handleMouseDown: (ev: MouseEvent) => void; - handleMouseMove: (ev: MouseEvent) => void; - handleMouseUp: (ev: MouseEvent) => void; - shouldIgnoreMouse(): number | boolean; - handleTouchStart: (ev: TouchEvent) => void; - handleTouchMove: (ev: TouchEvent) => void; - handleTouchEnd: (ev: TouchEvent) => void; - handleTouchScroll: () => void; - cancelTouchScroll(): void; - initScrollWatch(ev: PointerDragEvent): void; - recordCoords(ev: PointerDragEvent): void; - handleScroll: (ev: UIEvent) => void; - destroyScrollWatch(): void; - createEventFromMouse(ev: MouseEvent, isFirst?: boolean): PointerDragEvent; - createEventFromTouch(ev: TouchEvent, isFirst?: boolean): PointerDragEvent; - } -} - -declare module '@fullcalendar/interaction/interactions-external/ExternalDraggable' { - import { PointerDragEvent } from '@fullcalendar/core'; - import FeaturefulElementDragging from '@fullcalendar/interaction/dnd/FeaturefulElementDragging'; - import { DragMetaGenerator } from '@fullcalendar/interaction/interactions-external/ExternalElementDragging'; - export interface ExternalDraggableSettings { - eventData?: DragMetaGenerator; - itemSelector?: string; - minDistance?: number; - longPressDelay?: number; - appendTo?: HTMLElement; - } - export { ExternalDraggable as default, ExternalDraggable }; - class ExternalDraggable { - dragging: FeaturefulElementDragging; - settings: ExternalDraggableSettings; - constructor(el: HTMLElement, settings?: ExternalDraggableSettings); - handlePointerDown: (ev: PointerDragEvent) => void; - handleDragStart: (ev: PointerDragEvent) => void; - destroy(): void; - } -} - -declare module '@fullcalendar/interaction/interactions-external/ThirdPartyDraggable' { - import { DragMetaGenerator } from '@fullcalendar/interaction/interactions-external/ExternalElementDragging'; - import InferredElementDragging from '@fullcalendar/interaction/interactions-external/InferredElementDragging'; - export interface ThirdPartyDraggableSettings { - eventData?: DragMetaGenerator; - itemSelector?: string; - mirrorSelector?: string; - } - export { ThirdPartyDraggable as default, ThirdPartyDraggable }; - class ThirdPartyDraggable { - dragging: InferredElementDragging; - constructor(containerOrSettings?: EventTarget | ThirdPartyDraggableSettings, settings?: ThirdPartyDraggableSettings); - destroy(): void; - } -} - -declare module '@fullcalendar/interaction/dnd/ElementMirror' { - import { Rect } from '@fullcalendar/core'; - export { ElementMirror as default, ElementMirror }; - class ElementMirror { - isVisible: boolean; - origScreenX?: number; - origScreenY?: number; - deltaX?: number; - deltaY?: number; - sourceEl: HTMLElement | null; - mirrorEl: HTMLElement | null; - sourceElRect: Rect | null; - parentNode: HTMLElement; - zIndex: number; - revertDuration: number; - start(sourceEl: HTMLElement, pageX: number, pageY: number): void; - handleMove(pageX: number, pageY: number): void; - setIsVisible(bool: boolean): void; - stop(needsRevertAnimation: boolean, callback: () => void): void; - doRevertAnimation(callback: () => void, revertDuration: number): void; - cleanup(): void; - updateElPosition(): void; - getMirrorEl(): HTMLElement; - } -} - -declare module '@fullcalendar/interaction/dnd/AutoScroller' { - import { ScrollGeomCache } from '@fullcalendar/interaction/scroll-geom-cache'; - export { AutoScroller as default, AutoScroller }; - class AutoScroller { - isEnabled: boolean; - scrollQuery: (Window | string)[]; - edgeThreshold: number; - maxVelocity: number; - pointerScreenX: number | null; - pointerScreenY: number | null; - isAnimating: boolean; - scrollCaches: ScrollGeomCache[] | null; - msSinceRequest?: number; - everMovedUp: boolean; - everMovedDown: boolean; - everMovedLeft: boolean; - everMovedRight: boolean; - start(pageX: number, pageY: number): void; - handleMove(pageX: number, pageY: number): void; - stop(): void; - requestAnimation(now: number): void; - } -} - -declare module '@fullcalendar/interaction/interactions-external/ExternalElementDragging' { - import { Hit, PointerDragEvent, EventTuple, DatePointApi, Calendar, EventInteractionState, DragMetaInput, DragMeta, View, ElementDragging } from '@fullcalendar/core'; - import HitDragging from '@fullcalendar/interaction/interactions/HitDragging'; - export type DragMetaGenerator = DragMetaInput | ((el: HTMLElement) => DragMetaInput); - export interface ExternalDropApi extends DatePointApi { - draggedEl: HTMLElement; - jsEvent: UIEvent; - view: View; - } - export { ExternalElementDragging as default, ExternalElementDragging }; - class ExternalElementDragging { - hitDragging: HitDragging; - receivingCalendar: Calendar | null; - droppableEvent: EventTuple | null; - suppliedDragMeta: DragMetaGenerator | null; - dragMeta: DragMeta | null; - constructor(dragging: ElementDragging, suppliedDragMeta?: DragMetaGenerator); - handleDragStart: (ev: PointerDragEvent) => void; - buildDragMeta(subjectEl: HTMLElement): DragMeta; - handleHitUpdate: (hit: Hit, isFinal: boolean, ev: PointerDragEvent) => void; - handleDragEnd: (pev: PointerDragEvent) => void; - displayDrag(nextCalendar: Calendar | null, state: EventInteractionState): void; - clearDrag(): void; - canDropElOnCalendar(el: HTMLElement, receivingCalendar: Calendar): boolean; - } -} - -declare module '@fullcalendar/interaction/interactions-external/InferredElementDragging' { - import { PointerDragEvent, ElementDragging } from '@fullcalendar/core'; - import PointerDragging from '@fullcalendar/interaction/dnd/PointerDragging'; - export { InferredElementDragging as default, InferredElementDragging }; - class InferredElementDragging extends ElementDragging { - pointer: PointerDragging; - shouldIgnoreMove: boolean; - mirrorSelector: string; - currentMirrorEl: HTMLElement | null; - constructor(containerEl: HTMLElement); - destroy(): void; - handlePointerDown: (ev: PointerDragEvent) => void; - handlePointerMove: (ev: PointerDragEvent) => void; - handlePointerUp: (ev: PointerDragEvent) => void; - setIgnoreMove(bool: boolean): void; - setMirrorIsVisible(bool: boolean): void; - } -} - -declare module '@fullcalendar/interaction/scroll-geom-cache' { - import { Rect, ScrollController } from '@fullcalendar/core'; - export abstract class ScrollGeomCache extends ScrollController { - clientRect: Rect; - origScrollTop: number; - origScrollLeft: number; - protected scrollController: ScrollController; - protected doesListening: boolean; - protected scrollTop: number; - protected scrollLeft: number; - protected scrollWidth: number; - protected scrollHeight: number; - protected clientWidth: number; - protected clientHeight: number; - constructor(scrollController: ScrollController, doesListening: boolean); - abstract getEventTarget(): EventTarget; - abstract computeClientRect(): Rect; - destroy(): void; - handleScroll: () => void; - getScrollTop(): number; - getScrollLeft(): number; - setScrollTop(top: number): void; - setScrollLeft(top: number): void; - getClientWidth(): number; - getClientHeight(): number; - getScrollWidth(): number; - getScrollHeight(): number; - handleScrollChange(): void; - } - export class ElementScrollGeomCache extends ScrollGeomCache { - constructor(el: HTMLElement, doesListening: boolean); - getEventTarget(): EventTarget; - computeClientRect(): { - left: number; - right: number; - top: number; - bottom: number; - }; - } - export class WindowScrollGeomCache extends ScrollGeomCache { - constructor(doesListening: boolean); - getEventTarget(): EventTarget; - computeClientRect(): Rect; - handleScrollChange(): void; - } -} - -declare module '@fullcalendar/interaction/interactions/HitDragging' { - import { EmitterMixin, PointerDragEvent, Point, Hit, InteractionSettingsStore, ElementDragging } from '@fullcalendar/core'; - import OffsetTracker from '@fullcalendar/interaction/OffsetTracker'; - export { HitDragging as default, HitDragging }; - class HitDragging { - droppableStore: InteractionSettingsStore; - dragging: ElementDragging; - emitter: EmitterMixin; - useSubjectCenter: boolean; - requireInitial: boolean; - offsetTrackers: { - [componentUid: string]: OffsetTracker; - }; - initialHit: Hit | null; - movingHit: Hit | null; - finalHit: Hit | null; - coordAdjust?: Point; - constructor(dragging: ElementDragging, droppableStore: InteractionSettingsStore); - handlePointerDown: (ev: PointerDragEvent) => void; - processFirstCoord(ev: PointerDragEvent): void; - handleDragStart: (ev: PointerDragEvent) => void; - handleDragMove: (ev: PointerDragEvent) => void; - handlePointerUp: (ev: PointerDragEvent) => void; - handleDragEnd: (ev: PointerDragEvent) => void; - handleMove(ev: PointerDragEvent, forceHandle?: boolean): void; - prepareHits(): void; - releaseHits(): void; - queryHitForOffset(offsetLeft: number, offsetTop: number): Hit | null; - } - export function isHitsEqual(hit0: Hit | null, hit1: Hit | null): boolean; -} - -declare module '@fullcalendar/interaction/OffsetTracker' { - import { Rect } from '@fullcalendar/core'; - import { ElementScrollGeomCache } from '@fullcalendar/interaction/scroll-geom-cache'; - export { OffsetTracker as default, OffsetTracker }; - class OffsetTracker { - scrollCaches: ElementScrollGeomCache[]; - origRect: Rect; - constructor(el: HTMLElement); - destroy(): void; - computeLeft(): number; - computeTop(): number; - isWithinClipping(pageX: number, pageY: number): boolean; - } -} - diff --git a/plugins/fullcalendar-timegrid/main.d.ts b/plugins/fullcalendar-timegrid/main.d.ts deleted file mode 100644 index 303b51672..000000000 --- a/plugins/fullcalendar-timegrid/main.d.ts +++ /dev/null @@ -1,224 +0,0 @@ -// Generated by dts-bundle v0.7.3-fork.1 -// Dependencies for this module: -// ../../../../../@fullcalendar/core -// ../../../../../@fullcalendar/daygrid - -declare module '@fullcalendar/timegrid' { - import AbstractTimeGridView from '@fullcalendar/timegrid/AbstractTimeGridView'; - import TimeGridView, { buildDayTable } from '@fullcalendar/timegrid/TimeGridView'; - import { TimeGridSeg } from '@fullcalendar/timegrid/TimeGrid'; - import { TimeGridSlicer, buildDayRanges } from '@fullcalendar/timegrid/SimpleTimeGrid'; - export { TimeGridView, AbstractTimeGridView, buildDayTable, buildDayRanges, TimeGridSlicer, TimeGridSeg }; - export { default as TimeGrid } from '@fullcalendar/timegrid/TimeGrid'; - const _default: import("@fullcalendar/core").PluginDef; - export default _default; -} - -declare module '@fullcalendar/timegrid/AbstractTimeGridView' { - import { ScrollComponent, View, ComponentContext, Duration, ViewProps } from '@fullcalendar/core'; - import { DayGrid } from '@fullcalendar/daygrid'; - import TimeGrid from '@fullcalendar/timegrid/TimeGrid'; - import AllDaySplitter from '@fullcalendar/timegrid/AllDaySplitter'; - export { AbstractTimeGridView as default, AbstractTimeGridView }; - abstract class AbstractTimeGridView extends View { - timeGrid: TimeGrid; - dayGrid: DayGrid; - scroller: ScrollComponent; - axisWidth: any; - protected splitter: AllDaySplitter; - render(props: ViewProps, context: ComponentContext): void; - destroy(): void; - _renderSkeleton(context: ComponentContext): void; - _unrenderSkeleton(): void; - renderSkeletonHtml(): string; - getNowIndicatorUnit(): string; - unrenderNowIndicator(): void; - updateSize(isResize: boolean, viewHeight: number, isAuto: boolean): void; - updateBaseSize(isResize: any, viewHeight: any, isAuto: any): void; - computeScrollerHeight(viewHeight: any): number; - computeDateScroll(duration: Duration): { - top: any; - }; - queryDateScroll(): { - top: number; - }; - applyDateScroll(scroll: any): void; - renderHeadIntroHtml: () => string; - axisStyleAttr(): string; - renderTimeGridBgIntroHtml: () => string; - renderTimeGridIntroHtml: () => string; - renderDayGridBgIntroHtml: () => string; - renderDayGridIntroHtml: () => string; - } -} - -declare module '@fullcalendar/timegrid/TimeGridView' { - import { DateProfileGenerator, DateProfile, ComponentContext, DayHeader, DayTable, ViewProps } from '@fullcalendar/core'; - import { SimpleDayGrid } from '@fullcalendar/daygrid'; - import SimpleTimeGrid from '@fullcalendar/timegrid/SimpleTimeGrid'; - import AbstractTimeGridView from '@fullcalendar/timegrid/AbstractTimeGridView'; - export { TimeGridView as default, TimeGridView }; - class TimeGridView extends AbstractTimeGridView { - header: DayHeader; - simpleDayGrid: SimpleDayGrid; - simpleTimeGrid: SimpleTimeGrid; - render(props: ViewProps, context: ComponentContext): void; - _renderSkeleton(context: ComponentContext): void; - _unrenderSkeleton(): void; - renderNowIndicator(date: any): void; - } - export function buildDayTable(dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator): DayTable; -} - -declare module '@fullcalendar/timegrid/TimeGrid' { - import { PositionCache, Duration, DateMarker, DateFormatter, ComponentContext, DateComponent, Seg, EventSegUiInteractionState, DateProfile, Theme } from '@fullcalendar/core'; - export interface RenderProps { - renderBgIntroHtml: () => string; - renderIntroHtml: () => string; - } - export interface TimeGridSeg extends Seg { - col: number; - start: DateMarker; - end: DateMarker; - } - export interface TimeGridCell { - date: DateMarker; - htmlAttrs?: string; - } - export interface TimeGridProps { - dateProfile: DateProfile; - cells: TimeGridCell[]; - businessHourSegs: TimeGridSeg[]; - bgEventSegs: TimeGridSeg[]; - fgEventSegs: TimeGridSeg[]; - dateSelectionSegs: TimeGridSeg[]; - eventSelection: string; - eventDrag: EventSegUiInteractionState | null; - eventResize: EventSegUiInteractionState | null; - } - export { TimeGrid as default, TimeGrid }; - class TimeGrid extends DateComponent { - renderProps: RenderProps; - slotDuration: Duration; - snapDuration: Duration; - snapsPerSlot: any; - labelFormat: DateFormatter; - labelInterval: Duration; - colCnt: number; - colEls: HTMLElement[]; - slatContainerEl: HTMLElement; - slatEls: HTMLElement[]; - nowIndicatorEls: HTMLElement[]; - colPositions: PositionCache; - slatPositions: PositionCache; - isSlatSizesDirty: boolean; - isColSizesDirty: boolean; - rootBgContainerEl: HTMLElement; - bottomRuleEl: HTMLElement; - contentSkeletonEl: HTMLElement; - colContainerEls: HTMLElement[]; - fgContainerEls: HTMLElement[]; - bgContainerEls: HTMLElement[]; - mirrorContainerEls: HTMLElement[]; - highlightContainerEls: HTMLElement[]; - businessContainerEls: HTMLElement[]; - constructor(el: HTMLElement, renderProps: RenderProps); - _processOptions(options: any): void; - computeLabelInterval(slotDuration: any): any; - render(props: TimeGridProps, context: ComponentContext): void; - destroy(): void; - updateSize(isResize: boolean): void; - _renderSkeleton(theme: Theme): void; - _renderSlats(dateProfile: DateProfile): void; - renderSlatRowHtml(dateProfile: DateProfile): string; - _renderColumns(cells: TimeGridCell[], dateProfile: DateProfile): void; - _unrenderColumns(): void; - renderContentSkeleton(): void; - unrenderContentSkeleton(): void; - groupSegsByCol(segs: any): any[]; - attachSegsByCol(segsByCol: any, containerEls: HTMLElement[]): void; - getNowIndicatorUnit(): string; - renderNowIndicator(segs: TimeGridSeg[], date: any): void; - unrenderNowIndicator(): void; - getTotalSlatHeight(): number; - computeDateTop(when: DateMarker, startOfDayDate?: DateMarker): any; - computeTimeTop(duration: Duration): any; - computeSegVerticals(segs: any): void; - assignSegVerticals(segs: any): void; - generateSegVerticalCss(seg: any): { - top: any; - bottom: number; - }; - buildPositionCaches(): void; - buildColPositions(): void; - buildSlatPositions(): void; - positionToHit(positionLeft: any, positionTop: any): { - col: any; - dateSpan: { - range: { - start: Date; - end: Date; - }; - allDay: boolean; - }; - dayEl: HTMLElement; - relativeRect: { - left: any; - right: any; - top: any; - bottom: any; - }; - }; - _renderEventDrag(state: EventSegUiInteractionState): void; - _unrenderEventDrag(state: EventSegUiInteractionState): void; - _renderEventResize(state: EventSegUiInteractionState): void; - _unrenderEventResize(state: EventSegUiInteractionState): void; - _renderDateSelection(segs: Seg[]): void; - _unrenderDateSelection(segs: Seg[]): void; - } -} - -declare module '@fullcalendar/timegrid/SimpleTimeGrid' { - import { DateComponent, DateProfile, EventStore, EventUiHash, EventInteractionState, DateSpan, DateRange, DayTable, DateEnv, DateMarker, Slicer, Hit, ComponentContext } from '@fullcalendar/core'; - import TimeGrid, { TimeGridSeg } from '@fullcalendar/timegrid/TimeGrid'; - export interface SimpleTimeGridProps { - dateProfile: DateProfile | null; - dayTable: DayTable; - businessHours: EventStore; - eventStore: EventStore; - eventUiBases: EventUiHash; - dateSelection: DateSpan | null; - eventSelection: string; - eventDrag: EventInteractionState | null; - eventResize: EventInteractionState | null; - } - export { SimpleTimeGrid as default, SimpleTimeGrid }; - class SimpleTimeGrid extends DateComponent { - timeGrid: TimeGrid; - constructor(timeGrid: TimeGrid); - firstContext(context: ComponentContext): void; - destroy(): void; - render(props: SimpleTimeGridProps, context: ComponentContext): void; - renderNowIndicator(date: DateMarker): void; - buildPositionCaches(): void; - queryHit(positionLeft: number, positionTop: number): Hit; - } - export function buildDayRanges(dayTable: DayTable, dateProfile: DateProfile, dateEnv: DateEnv): DateRange[]; - export class TimeGridSlicer extends Slicer { - sliceRange(range: DateRange, dayRanges: DateRange[]): TimeGridSeg[]; - } -} - -declare module '@fullcalendar/timegrid/AllDaySplitter' { - import { Splitter, EventDef, DateSpan } from '@fullcalendar/core'; - export { AllDaySplitter as default, AllDaySplitter }; - class AllDaySplitter extends Splitter { - getKeyInfo(): { - allDay: {}; - timed: {}; - }; - getKeysForDateSpan(dateSpan: DateSpan): string[]; - getKeysForEventDef(eventDef: EventDef): string[]; - } -} - diff --git a/plugins/fullcalendar/main.d.ts b/plugins/fullcalendar/main.d.ts deleted file mode 100644 index b6459021c..000000000 --- a/plugins/fullcalendar/main.d.ts +++ /dev/null @@ -1,2736 +0,0 @@ -// Generated by dts-bundle v0.7.3-fork.1 -// Dependencies for this module: -// ../../../../../@fullcalendar/core - -declare module '@fullcalendar/core' { - export const version = "<%= version %>"; - export { OptionsInput } from '@fullcalendar/core/types/input-types'; - export { EventInput, EventDef, EventDefHash, EventInstance, EventInstanceHash, parseEventDef, createEventInstance, EventTuple } from '@fullcalendar/core/structs/event'; - export { BusinessHoursInput, parseBusinessHours } from '@fullcalendar/core/structs/business-hours'; - export { applyAll, debounce, padStart, isInt, capitaliseFirstLetter, parseFieldSpecs, compareByFieldSpecs, compareByFieldSpec, flexibleCompare, computeVisibleDayRange, refineProps, matchCellWidths, uncompensateScroll, compensateScroll, subtractInnerElHeight, isMultiDayRange, distributeHeight, undistributeHeight, preventSelection, allowSelection, preventContextMenu, allowContextMenu, compareNumbers, enableCursor, disableCursor, diffDates } from '@fullcalendar/core/util/misc'; - export { htmlEscape, cssToStr } from '@fullcalendar/core/util/html'; - export { removeExact, isArraysEqual } from '@fullcalendar/core/util/array'; - export { memoize, memoizeOutput } from '@fullcalendar/core/util/memoize'; - export { memoizeRendering, MemoizedRendering } from '@fullcalendar/core/component/memoized-rendering'; - export { intersectRects, Rect, pointInsideRect, constrainPoint, getRectCenter, diffPoints, Point, translateRect } from '@fullcalendar/core/util/geom'; - export { mapHash, filterHash, isPropsEqual } from '@fullcalendar/core/util/object'; - export { findElements, findChildren, htmlToElement, createElement, insertAfterElement, prependToElement, removeElement, appendToElement, applyStyle, applyStyleProp, elementMatches, elementClosest, forceClassName } from '@fullcalendar/core/util/dom-manip'; - export { EventStore, filterEventStoreDefs, createEmptyEventStore, mergeEventStores, getRelevantEvents, eventTupleToStore } from '@fullcalendar/core/structs/event-store'; - export { EventUiHash, EventUi, processScopedUiProps, combineEventUis } from '@fullcalendar/core/component/event-ui'; - export { default as Splitter, SplittableProps } from '@fullcalendar/core/component/event-splitting'; - export { buildGotoAnchorHtml, getAllDayHtml, getDayClasses } from '@fullcalendar/core/component/date-rendering'; - export { preventDefault, listenBySelector, whenTransitionDone } from '@fullcalendar/core/util/dom-event'; - export { computeInnerRect, computeEdges, computeHeightAndMargins, getClippingParents, computeClippingRect, computeRect } from '@fullcalendar/core/util/dom-geom'; - export { unpromisify } from '@fullcalendar/core/util/promise'; - export { default as EmitterMixin, EmitterInterface } from '@fullcalendar/core/common/EmitterMixin'; - export { DateRange, rangeContainsMarker, intersectRanges, rangesEqual, rangesIntersect, rangeContainsRange } from '@fullcalendar/core/datelib/date-range'; - export { default as Mixin } from '@fullcalendar/core/common/Mixin'; - export { default as PositionCache } from '@fullcalendar/core/common/PositionCache'; - export { default as ScrollComponent, ScrollbarWidths } from '@fullcalendar/core/common/ScrollComponent'; - export { ScrollController, ElementScrollController, WindowScrollController } from '@fullcalendar/core/common/scroll-controller'; - export { default as Theme } from '@fullcalendar/core/theme/Theme'; - export { default as Component, ComponentContext } from '@fullcalendar/core/component/Component'; - export { default as DateComponent, Seg, EventSegUiInteractionState } from '@fullcalendar/core/component/DateComponent'; - export { default as Calendar, DatePointTransform, DateSpanTransform, DateSelectionApi } from '@fullcalendar/core/Calendar'; - export { default as View, ViewProps } from '@fullcalendar/core/View'; - export { default as FgEventRenderer, buildSegCompareObj } from '@fullcalendar/core/component/renderers/FgEventRenderer'; - export { default as FillRenderer } from '@fullcalendar/core/component/renderers/FillRenderer'; - export { default as DateProfileGenerator, DateProfile } from '@fullcalendar/core/DateProfileGenerator'; - export { ViewDef } from '@fullcalendar/core/structs/view-def'; - export { ViewSpec } from '@fullcalendar/core/structs/view-spec'; - export { DateSpan, DateSpanApi, DatePointApi, isDateSpansEqual } from '@fullcalendar/core/structs/date-span'; - export { DateMarker, addDays, startOfDay, addMs, addWeeks, diffWeeks, diffWholeWeeks, diffWholeDays, diffDayAndTime, diffDays, isValidDate } from '@fullcalendar/core/datelib/marker'; - export { Duration, createDuration, isSingleDay, multiplyDuration, addDurations, asRoughMinutes, asRoughSeconds, asRoughMs, wholeDivideDurations, greatestDurationDenominator } from '@fullcalendar/core/datelib/duration'; - export { DateEnv, DateMarkerMeta } from '@fullcalendar/core/datelib/env'; - export { DateFormatter, createFormatter, VerboseFormattingArg, formatIsoTimeString } from '@fullcalendar/core/datelib/formatting'; - export { NamedTimeZoneImpl } from '@fullcalendar/core/datelib/timezone'; - export { parse as parseMarker } from '@fullcalendar/core/datelib/parsing'; - export { EventSourceDef, EventSource, EventSourceHash } from '@fullcalendar/core/structs/event-source'; - export { Interaction, InteractionSettings, interactionSettingsToStore, interactionSettingsStore, InteractionSettingsStore } from '@fullcalendar/core/interactions/interaction'; - export { PointerDragEvent } from '@fullcalendar/core/interactions/pointer'; - export { Hit } from '@fullcalendar/core/interactions/hit'; - export { dateSelectionJoinTransformer } from '@fullcalendar/core/interactions/date-selecting'; - export { eventDragMutationMassager, EventDropTransformers } from '@fullcalendar/core/interactions/event-dragging'; - export { EventResizeJoinTransforms } from '@fullcalendar/core/interactions/event-resizing'; - export { default as ElementDragging } from '@fullcalendar/core/interactions/ElementDragging'; - export { formatDate, formatRange } from '@fullcalendar/core/formatting-api'; - export { globalDefaults, config } from '@fullcalendar/core/options'; - export { RecurringType, ParsedRecurring } from '@fullcalendar/core/structs/recurring-event'; - export { DragMetaInput, DragMeta, parseDragMeta } from '@fullcalendar/core/structs/drag-meta'; - export { createPlugin, PluginDef, PluginDefInput, ViewPropsTransformer, ViewContainerModifier } from '@fullcalendar/core/plugin-system'; - export { reducerFunc, Action, CalendarState } from '@fullcalendar/core/reducers/types'; - export { CalendarComponentProps } from '@fullcalendar/core/CalendarComponent'; - export { default as DayHeader } from '@fullcalendar/core/common/DayHeader'; - export { computeFallbackHeaderFormat, renderDateCell } from '@fullcalendar/core/common/table-utils'; - export { default as DaySeries } from '@fullcalendar/core/common/DaySeries'; - export { EventInteractionState } from '@fullcalendar/core/interactions/event-interaction-state'; - export { EventRenderRange, sliceEventStore, hasBgRendering, getElSeg, computeEventDraggable, computeEventStartResizable, computeEventEndResizable } from '@fullcalendar/core/component/event-rendering'; - export { default as DayTable, DayTableSeg, DayTableCell } from '@fullcalendar/core/common/DayTable'; - export { default as Slicer, SlicedProps } from '@fullcalendar/core/common/slicing-utils'; - export { EventMutation, applyMutationToEventStore } from '@fullcalendar/core/structs/event-mutation'; - export { Constraint, ConstraintInput, AllowFunc, isPropsValid, isInteractionValid } from '@fullcalendar/core/validation'; - export { default as EventApi } from '@fullcalendar/core/api/EventApi'; - export { default as requestJson } from '@fullcalendar/core/util/requestJson'; -} - -declare module '@fullcalendar/core/types/input-types' { - import View from '@fullcalendar/core/View'; - import { EventSourceInput, EventInputTransformer } from '@fullcalendar/core/structs/event-source'; - import { Duration, DurationInput } from '@fullcalendar/core/datelib/duration'; - import { DateInput } from '@fullcalendar/core/datelib/env'; - import { FormatterInput } from '@fullcalendar/core/datelib/formatting'; - import { DateRangeInput } from '@fullcalendar/core/datelib/date-range'; - import { BusinessHoursInput } from '@fullcalendar/core/structs/business-hours'; - import EventApi from '@fullcalendar/core/api/EventApi'; - import { AllowFunc, ConstraintInput, OverlapFunc } from '@fullcalendar/core/validation'; - import { PluginDef } from '@fullcalendar/core/plugin-system'; - import { LocaleSingularArg, RawLocale } from '@fullcalendar/core/datelib/locale'; - export interface ToolbarInput { - left?: string; - center?: string; - right?: string; - } - export interface CustomButtonInput { - text: string; - icon?: string; - themeIcon?: string; - bootstrapFontAwesome?: string; - click(element: HTMLElement): void; - } - export interface ButtonIconsInput { - prev?: string; - next?: string; - prevYear?: string; - nextYear?: string; - } - export interface ButtonTextCompoundInput { - prev?: string; - next?: string; - prevYear?: string; - nextYear?: string; - today?: string; - month?: string; - week?: string; - day?: string; - [viewId: string]: string | undefined; - } - export interface EventSegment { - event: EventApi; - start: Date; - end: Date; - isStart: boolean; - isEnd: boolean; - } - export interface CellInfo { - date: Date; - dayEl: HTMLElement; - moreEl: HTMLElement; - segs: EventSegment[]; - hiddenSegs: EventSegment[]; - } - export interface DropInfo { - start: Date; - end: Date; - } - export type EventHandlerName = '_init' | 'selectAllow' | 'eventAllow' | 'eventDataTransform' | 'datesRender' | 'datesDestroy' | 'dayRender' | 'windowResize' | 'dateClick' | 'eventClick' | 'eventMouseEnter' | 'eventMouseLeave' | 'select' | 'unselect' | 'loading' | 'eventRender' | 'eventPositioned' | '_eventsPositioned' | 'eventDestroy' | 'eventDragStart' | 'eventDragStop' | 'eventDrop' | '_destroyed' | 'drop' | 'eventResizeStart' | 'eventResizeStop' | 'eventResize' | 'eventReceive' | 'eventLeave' | 'viewSkeletonRender' | 'viewSkeletonDestroy' | '_noEventDrop' | '_noEventResize' | 'eventLimitClick' | 'resourceRender'; - export type EventHandlerArgs = Parameters any>>; - export type EventHandlerArg = EventHandlerArgs[0]; - export interface OptionsInputBase { - header?: boolean | ToolbarInput; - footer?: boolean | ToolbarInput; - customButtons?: { - [name: string]: CustomButtonInput; - }; - buttonIcons?: boolean | ButtonIconsInput; - themeSystem?: 'standard' | string; - bootstrapFontAwesome?: boolean | ButtonIconsInput; - firstDay?: number; - dir?: 'ltr' | 'rtl' | 'auto'; - weekends?: boolean; - hiddenDays?: number[]; - fixedWeekCount?: boolean; - weekNumbers?: boolean; - weekNumbersWithinDays?: boolean; - weekNumberCalculation?: 'local' | 'ISO' | ((m: Date) => number); - businessHours?: BusinessHoursInput; - showNonCurrentDates?: boolean; - height?: number | 'auto' | 'parent' | (() => number); - contentHeight?: number | 'auto' | (() => number); - aspectRatio?: number; - handleWindowResize?: boolean; - windowResizeDelay?: number; - eventLimit?: boolean | number; - eventLimitClick?: 'popover' | 'week' | 'day' | 'timeGridWeek' | 'timeGridDay' | string | ((arg: { - date: Date; - allDay: boolean; - dayEl: HTMLElement; - moreEl: HTMLElement; - segs: any[]; - hiddenSegs: any[]; - jsEvent: MouseEvent; - view: View; - }) => void); - timeZone?: string | boolean; - now?: DateInput | (() => DateInput); - defaultView?: string; - allDaySlot?: boolean; - allDayText?: string; - slotDuration?: DurationInput; - slotLabelFormat?: FormatterInput; - slotLabelInterval?: DurationInput; - snapDuration?: DurationInput; - scrollTime?: DurationInput; - minTime?: DurationInput; - maxTime?: DurationInput; - slotEventOverlap?: boolean; - listDayFormat?: FormatterInput | boolean; - listDayAltFormat?: FormatterInput | boolean; - noEventsMessage?: string; - defaultDate?: DateInput; - nowIndicator?: boolean; - visibleRange?: ((currentDate: Date) => DateRangeInput) | DateRangeInput; - validRange?: DateRangeInput; - dateIncrement?: DurationInput; - dateAlignment?: string; - duration?: DurationInput; - dayCount?: number; - locales?: RawLocale[]; - locale?: LocaleSingularArg; - eventTimeFormat?: FormatterInput; - columnHeader?: boolean; - columnHeaderFormat?: FormatterInput; - columnHeaderText?: string | ((date: DateInput) => string); - columnHeaderHtml?: string | ((date: DateInput) => string); - titleFormat?: FormatterInput; - weekLabel?: string; - displayEventTime?: boolean; - displayEventEnd?: boolean; - eventLimitText?: string | ((eventCnt: number) => string); - dayPopoverFormat?: FormatterInput; - navLinks?: boolean; - navLinkDayClick?: string | ((date: Date, jsEvent: Event) => void); - navLinkWeekClick?: string | ((weekStart: any, jsEvent: Event) => void); - selectable?: boolean; - selectMirror?: boolean; - unselectAuto?: boolean; - unselectCancel?: string; - defaultAllDayEventDuration?: DurationInput; - defaultTimedEventDuration?: DurationInput; - cmdFormatter?: string; - defaultRangeSeparator?: string; - selectConstraint?: ConstraintInput; - selectOverlap?: boolean | OverlapFunc; - selectAllow?: AllowFunc; - editable?: boolean; - eventStartEditable?: boolean; - eventDurationEditable?: boolean; - eventConstraint?: ConstraintInput; - eventOverlap?: boolean | OverlapFunc; - eventAllow?: AllowFunc; - eventClassName?: string[] | string; - eventClassNames?: string[] | string; - eventBackgroundColor?: string; - eventBorderColor?: string; - eventTextColor?: string; - eventColor?: string; - events?: EventSourceInput; - eventSources?: EventSourceInput[]; - allDayDefault?: boolean; - startParam?: string; - endParam?: string; - lazyFetching?: boolean; - nextDayThreshold?: DurationInput; - eventOrder?: string | Array<((a: EventApi, b: EventApi) => number) | (string | ((a: EventApi, b: EventApi) => number))>; - rerenderDelay?: number | null; - dragRevertDuration?: number; - dragScroll?: boolean; - longPressDelay?: number; - eventLongPressDelay?: number; - droppable?: boolean; - dropAccept?: string | ((draggable: any) => boolean); - eventDataTransform?: EventInputTransformer; - allDayMaintainDuration?: boolean; - eventResizableFromStart?: boolean; - timeGridEventMinHeight?: number; - allDayHtml?: string; - eventDragMinDistance?: number; - eventSourceFailure?: any; - eventSourceSuccess?: any; - forceEventDuration?: boolean; - progressiveEventRendering?: boolean; - selectLongPressDelay?: number; - selectMinDistance?: number; - timeZoneParam?: string; - titleRangeSeparator?: string; - datesRender?(arg: { - view: View; - el: HTMLElement; - }): void; - datesDestroy?(arg: { - view: View; - el: HTMLElement; - }): void; - dayRender?(arg: { - view: View; - date: Date; - allDay?: boolean; - el: HTMLElement; - }): void; - windowResize?(view: View): void; - dateClick?(arg: { - date: Date; - dateStr: string; - allDay: boolean; - resource?: any; - dayEl: HTMLElement; - jsEvent: MouseEvent; - view: View; - }): void; - eventClick?(arg: { - el: HTMLElement; - event: EventApi; - jsEvent: MouseEvent; - view: View; - }): boolean | void; - eventMouseEnter?(arg: { - el: HTMLElement; - event: EventApi; - jsEvent: MouseEvent; - view: View; - }): void; - eventMouseLeave?(arg: { - el: HTMLElement; - event: EventApi; - jsEvent: MouseEvent; - view: View; - }): void; - select?(arg: { - start: Date; - end: Date; - startStr: string; - endStr: string; - allDay: boolean; - resource?: any; - jsEvent: MouseEvent; - view: View; - }): void; - unselect?(arg: { - view: View; - jsEvent: Event; - }): void; - loading?(isLoading: boolean): void; - eventRender?(arg: { - isMirror: boolean; - isStart: boolean; - isEnd: boolean; - event: EventApi; - el: HTMLElement; - view: View; - }): void; - eventPositioned?(arg: { - isMirror: boolean; - isStart: boolean; - isEnd: boolean; - event: EventApi; - el: HTMLElement; - view: View; - }): void; - _eventsPositioned?(arg: { - view: View; - }): void; - eventDestroy?(arg: { - isMirror: boolean; - event: EventApi; - el: HTMLElement; - view: View; - }): void; - eventDragStart?(arg: { - event: EventApi; - el: HTMLElement; - jsEvent: MouseEvent; - view: View; - }): void; - eventDragStop?(arg: { - event: EventApi; - el: HTMLElement; - jsEvent: MouseEvent; - view: View; - }): void; - eventDrop?(arg: { - el: HTMLElement; - event: EventApi; - oldEvent: EventApi; - delta: Duration; - revert: () => void; - jsEvent: Event; - view: View; - }): void; - eventResizeStart?(arg: { - el: HTMLElement; - event: EventApi; - jsEvent: MouseEvent; - view: View; - }): void; - eventResizeStop?(arg: { - el: HTMLElement; - event: EventApi; - jsEvent: MouseEvent; - view: View; - }): void; - eventResize?(arg: { - el: HTMLElement; - startDelta: Duration; - endDelta: Duration; - prevEvent: EventApi; - event: EventApi; - revert: () => void; - jsEvent: Event; - view: View; - }): void; - drop?(arg: { - date: Date; - dateStr: string; - allDay: boolean; - draggedEl: HTMLElement; - jsEvent: MouseEvent; - view: View; - }): void; - eventReceive?(arg: { - event: EventApi; - draggedEl: HTMLElement; - view: View; - }): void; - eventLeave?(arg: { - draggedEl: HTMLElement; - event: EventApi; - view: View; - }): void; - viewSkeletonRender?(arg: { - el: HTMLElement; - view: View; - }): void; - viewSkeletonDestroy?(arg: { - el: HTMLElement; - view: View; - }): void; - _destroyed?(): void; - _init?(): void; - _noEventDrop?(): void; - _noEventResize?(): void; - resourceRender?(arg: { - resource: any; - el: HTMLElement; - view: View; - }): void; - } - export interface ViewOptionsInput extends OptionsInputBase { - type?: string; - buttonText?: string; - } - export interface OptionsInput extends OptionsInputBase { - buttonText?: ButtonTextCompoundInput; - views?: { - [viewId: string]: ViewOptionsInput; - }; - plugins?: (PluginDef | string)[]; - } -} - -declare module '@fullcalendar/core/structs/event' { - import { DateInput } from '@fullcalendar/core/datelib/env'; - import Calendar from '@fullcalendar/core/Calendar'; - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { UnscopedEventUiInput, EventUi } from '@fullcalendar/core/component/event-ui'; - export type EventRenderingChoice = '' | 'background' | 'inverse-background' | 'none'; - export interface EventNonDateInput extends UnscopedEventUiInput { - id?: string | number; - groupId?: string | number; - title?: string; - url?: string; - rendering?: EventRenderingChoice; - extendedProps?: object; - [extendedProp: string]: any; - } - export interface EventDateInput { - start?: DateInput; - end?: DateInput; - date?: DateInput; - allDay?: boolean; - } - export type EventInput = EventNonDateInput & EventDateInput; - export interface EventDef { - defId: string; - sourceId: string; - publicId: string; - groupId: string; - allDay: boolean; - hasEnd: boolean; - recurringDef: { - typeId: number; - typeData: any; - duration: Duration | null; - } | null; - title: string; - url: string; - rendering: EventRenderingChoice; - ui: EventUi; - extendedProps: any; - } - export interface EventInstance { - instanceId: string; - defId: string; - range: DateRange; - forcedStartTzo: number | null; - forcedEndTzo: number | null; - } - export interface EventTuple { - def: EventDef; - instance: EventInstance | null; - } - export type EventInstanceHash = { - [instanceId: string]: EventInstance; - }; - export type EventDefHash = { - [defId: string]: EventDef; - }; - export const NON_DATE_PROPS: { - id: StringConstructor; - groupId: StringConstructor; - title: StringConstructor; - url: StringConstructor; - rendering: StringConstructor; - extendedProps: any; - }; - export const DATE_PROPS: { - start: any; - date: any; - end: any; - allDay: any; - }; - export function parseEvent(raw: EventInput, sourceId: string, calendar: Calendar, allowOpenRange?: boolean): EventTuple | null; - export function parseEventDef(raw: EventNonDateInput, sourceId: string, allDay: boolean, hasEnd: boolean, calendar: Calendar): EventDef; - export type eventDefParserFunc = (def: EventDef, props: any, leftovers: any) => void; - export function createEventInstance(defId: string, range: DateRange, forcedStartTzo?: number, forcedEndTzo?: number): EventInstance; -} - -declare module '@fullcalendar/core/structs/business-hours' { - import Calendar from '@fullcalendar/core/Calendar'; - import { EventInput } from '@fullcalendar/core/structs/event'; - import { EventStore } from '@fullcalendar/core/structs/event-store'; - export type BusinessHoursInput = boolean | EventInput | EventInput[]; - export function parseBusinessHours(input: BusinessHoursInput, calendar: Calendar): EventStore; -} - -declare module '@fullcalendar/core/util/misc' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { DateEnv } from '@fullcalendar/core/datelib/env'; - import { DateRange, OpenDateRange } from '@fullcalendar/core/datelib/date-range'; - export function compensateScroll(rowEl: HTMLElement, scrollbarWidths: any): void; - export function uncompensateScroll(rowEl: HTMLElement): void; - export function disableCursor(): void; - export function enableCursor(): void; - export function distributeHeight(els: HTMLElement[], availableHeight: any, shouldRedistribute: any): void; - export function undistributeHeight(els: HTMLElement[]): void; - export function matchCellWidths(els: HTMLElement[]): number; - export function subtractInnerElHeight(outerEl: HTMLElement, innerEl: HTMLElement): number; - export function preventSelection(el: HTMLElement): void; - export function allowSelection(el: HTMLElement): void; - export function preventContextMenu(el: HTMLElement): void; - export function allowContextMenu(el: HTMLElement): void; - export function parseFieldSpecs(input: any): any[]; - export function compareByFieldSpecs(obj0: any, obj1: any, fieldSpecs: any): any; - export function compareByFieldSpec(obj0: any, obj1: any, fieldSpec: any): any; - export function flexibleCompare(a: any, b: any): number; - export function capitaliseFirstLetter(str: any): any; - export function padStart(val: any, len: any): string; - export function compareNumbers(a: any, b: any): number; - export function isInt(n: any): boolean; - export function applyAll(functions: any, thisObj: any, args: any): any; - export function firstDefined(...args: any[]): any; - export function debounce(func: any, wait: any): () => any; - export type GenericHash = { - [key: string]: any; - }; - export function refineProps(rawProps: GenericHash, processors: GenericHash, defaults?: GenericHash, leftoverProps?: GenericHash): GenericHash; - export function computeAlignedDayRange(timedRange: DateRange): DateRange; - export function computeVisibleDayRange(timedRange: OpenDateRange, nextDayThreshold?: Duration): OpenDateRange; - export function isMultiDayRange(range: DateRange): boolean; - export function diffDates(date0: DateMarker, date1: DateMarker, dateEnv: DateEnv, largeUnit?: string): Duration; -} - -declare module '@fullcalendar/core/util/html' { - export function htmlEscape(s: any): string; - export function cssToStr(cssProps: any): string; - export function attrsToStr(attrs: any): string; - export type ClassNameInput = string | string[]; - export function parseClassName(raw: ClassNameInput): string[]; -} - -declare module '@fullcalendar/core/util/array' { - export function removeMatching(array: any, testFunc: any): number; - export function removeExact(array: any, exactVal: any): number; - export function isArraysEqual(a0: any, a1: any): boolean; -} - -declare module '@fullcalendar/core/util/memoize' { - export function memoize(workerFunc: T): T; - export function memoizeOutput(workerFunc: T, equalityFunc: (output0: any, output1: any) => boolean): T; -} - -declare module '@fullcalendar/core/component/memoized-rendering' { - export interface MemoizedRendering { - (...args: ArgsType): void; - unrender: () => void; - dependents: MemoizedRendering[]; - } - export function memoizeRendering(renderFunc: (...args: ArgsType) => void, unrenderFunc?: (...args: ArgsType) => void, dependencies?: MemoizedRendering[]): MemoizedRendering; -} - -declare module '@fullcalendar/core/util/geom' { - export interface Point { - left: number; - top: number; - } - export interface Rect { - left: number; - right: number; - top: number; - bottom: number; - } - export function pointInsideRect(point: Point, rect: Rect): boolean; - export function intersectRects(rect1: Rect, rect2: Rect): Rect | false; - export function translateRect(rect: Rect, deltaX: number, deltaY: number): Rect; - export function constrainPoint(point: Point, rect: Rect): Point; - export function getRectCenter(rect: Rect): Point; - export function diffPoints(point1: Point, point2: Point): Point; -} - -declare module '@fullcalendar/core/util/object' { - export function mergeProps(propObjs: any, complexProps?: any): any; - export function filterHash(hash: any, func: any): {}; - export function mapHash(hash: { - [key: string]: InputItem; - }, func: (input: InputItem, key: string) => OutputItem): { - [key: string]: OutputItem; - }; - export function arrayToHash(a: any): { - [key: string]: true; - }; - export function hashValuesToArray(obj: any): any[]; - export function isPropsEqual(obj0: any, obj1: any): boolean; -} - -declare module '@fullcalendar/core/util/dom-manip' { - export function createElement(tagName: string, attrs: object | null, content?: ElementContent): HTMLElement; - export function htmlToElement(html: string): HTMLElement; - export function htmlToElements(html: string): HTMLElement[]; - export type ElementContent = string | Node | Node[] | NodeList; - export function appendToElement(el: HTMLElement, content: ElementContent): void; - export function prependToElement(parent: HTMLElement, content: ElementContent): void; - export function insertAfterElement(refEl: HTMLElement, content: ElementContent): void; - export function removeElement(el: HTMLElement): void; - export function elementClosest(el: HTMLElement, selector: string): HTMLElement; - export function elementMatches(el: HTMLElement, selector: string): HTMLElement; - export function findElements(container: HTMLElement[] | HTMLElement | NodeListOf, selector: string): HTMLElement[]; - export function findChildren(parent: HTMLElement[] | HTMLElement, selector?: string): HTMLElement[]; - export function forceClassName(el: HTMLElement, className: string, bool: any): void; - export function applyStyle(el: HTMLElement, props: object): void; - export function applyStyleProp(el: HTMLElement, name: string, val: any): void; -} - -declare module '@fullcalendar/core/structs/event-store' { - import { EventInput, EventDef, EventDefHash, EventInstanceHash, EventTuple } from '@fullcalendar/core/structs/event'; - import { EventSource } from '@fullcalendar/core/structs/event-source'; - import Calendar from '@fullcalendar/core/Calendar'; - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - export interface EventStore { - defs: EventDefHash; - instances: EventInstanceHash; - } - export function parseEvents(rawEvents: EventInput[], sourceId: string, calendar: Calendar, allowOpenRange?: boolean): EventStore; - export function eventTupleToStore(tuple: EventTuple, eventStore?: EventStore): EventStore; - export function expandRecurring(eventStore: EventStore, framingRange: DateRange, calendar: Calendar): EventStore; - export function getRelevantEvents(eventStore: EventStore, instanceId: string): EventStore; - export function transformRawEvents(rawEvents: any, eventSource: EventSource, calendar: Calendar): any; - export function createEmptyEventStore(): EventStore; - export function mergeEventStores(store0: EventStore, store1: EventStore): EventStore; - export function filterEventStoreDefs(eventStore: EventStore, filterFunc: (eventDef: EventDef) => boolean): EventStore; -} - -declare module '@fullcalendar/core/component/event-ui' { - import { Constraint, AllowFunc, ConstraintInput } from '@fullcalendar/core/validation'; - import { parseClassName } from '@fullcalendar/core/util/html'; - import Calendar from '@fullcalendar/core/Calendar'; - export interface UnscopedEventUiInput { - editable?: boolean; - startEditable?: boolean; - durationEditable?: boolean; - constraint?: ConstraintInput; - overlap?: boolean; - allow?: AllowFunc; - className?: string[] | string; - classNames?: string[] | string; - backgroundColor?: string; - borderColor?: string; - textColor?: string; - color?: string; - } - export interface EventUi { - startEditable: boolean | null; - durationEditable: boolean | null; - constraints: Constraint[]; - overlap: boolean | null; - allows: AllowFunc[]; - backgroundColor: string; - borderColor: string; - textColor: string; - classNames: string[]; - } - export type EventUiHash = { - [defId: string]: EventUi; - }; - export const UNSCOPED_EVENT_UI_PROPS: { - editable: BooleanConstructor; - startEditable: BooleanConstructor; - durationEditable: BooleanConstructor; - constraint: any; - overlap: any; - allow: any; - className: typeof parseClassName; - classNames: typeof parseClassName; - color: StringConstructor; - backgroundColor: StringConstructor; - borderColor: StringConstructor; - textColor: StringConstructor; - }; - export function processUnscopedUiProps(rawProps: UnscopedEventUiInput, calendar: Calendar, leftovers?: any): EventUi; - export function processScopedUiProps(prefix: string, rawScoped: any, calendar: Calendar, leftovers?: any): EventUi; - export function combineEventUis(uis: EventUi[]): EventUi; -} - -declare module '@fullcalendar/core/component/event-splitting' { - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { EventDef } from '@fullcalendar/core/structs/event'; - import { EventInteractionState } from '@fullcalendar/core/interactions/event-interaction-state'; - import { EventUiHash, EventUi } from '@fullcalendar/core/component/event-ui'; - import { DateSpan } from '@fullcalendar/core/structs/date-span'; - export interface SplittableProps { - businessHours: EventStore | null; - dateSelection: DateSpan | null; - eventStore: EventStore; - eventUiBases: EventUiHash; - eventSelection: string; - eventDrag: EventInteractionState | null; - eventResize: EventInteractionState | null; - } - export { Splitter as default, Splitter }; - abstract class Splitter { - abstract getKeyInfo(props: PropsType): { - [key: string]: { - ui?: EventUi; - businessHours?: EventStore; - }; - }; - abstract getKeysForDateSpan(dateSpan: DateSpan): string[]; - abstract getKeysForEventDef(eventDef: EventDef): string[]; - splitProps(props: PropsType): { - [key: string]: SplittableProps; - }; - } -} - -declare module '@fullcalendar/core/component/date-rendering' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { ComponentContext } from '@fullcalendar/core/component/Component'; - import { DateProfile } from '@fullcalendar/core/DateProfileGenerator'; - import { DateEnv } from '@fullcalendar/core/datelib/env'; - export function buildGotoAnchorHtml(allOptions: any, dateEnv: DateEnv, gotoOptions: any, attrs: any, innerHtml?: any): string; - export function getAllDayHtml(allOptions: any): any; - export function getDayClasses(date: DateMarker, dateProfile: DateProfile, context: ComponentContext, noThemeHighlight?: any): any[]; -} - -declare module '@fullcalendar/core/util/dom-event' { - export function preventDefault(ev: any): void; - export function listenBySelector(container: HTMLElement, eventType: string, selector: string, handler: (ev: Event, matchedTarget: HTMLElement) => void): () => void; - export function listenToHoverBySelector(container: HTMLElement, selector: string, onMouseEnter: (ev: Event, matchedTarget: HTMLElement) => void, onMouseLeave: (ev: Event, matchedTarget: HTMLElement) => void): () => void; - export function whenTransitionDone(el: HTMLElement, callback: (ev: Event) => void): void; -} - -declare module '@fullcalendar/core/util/dom-geom' { - import { Rect } from '@fullcalendar/core/util/geom'; - export interface EdgeInfo { - borderLeft: number; - borderRight: number; - borderTop: number; - borderBottom: number; - scrollbarLeft: number; - scrollbarRight: number; - scrollbarBottom: number; - paddingLeft?: number; - paddingRight?: number; - paddingTop?: number; - paddingBottom?: number; - } - export function computeEdges(el: any, getPadding?: boolean): EdgeInfo; - export function computeInnerRect(el: any, goWithinPadding?: boolean): { - left: number; - right: number; - top: number; - bottom: number; - }; - export function computeRect(el: any): Rect; - export function computeHeightAndMargins(el: HTMLElement): number; - export function computeVMargins(el: HTMLElement): number; - export function getClippingParents(el: HTMLElement): HTMLElement[]; - export function computeClippingRect(el: HTMLElement): Rect; -} - -declare module '@fullcalendar/core/util/promise' { - export function unpromisify(func: any, success: any, failure?: any): void; -} - -declare module '@fullcalendar/core/common/EmitterMixin' { - import Mixin from '@fullcalendar/core/common/Mixin'; - export interface EmitterInterface { - on(types: any, handler: any): any; - one(types: any, handler: any): any; - off(types: any, handler: any): any; - trigger(type: any, ...args: any[]): any; - triggerWith(type: any, context: any, args: any): any; - hasHandlers(type: any): any; - } - export { EmitterMixin as default, EmitterMixin }; - class EmitterMixin extends Mixin implements EmitterInterface { - _handlers: any; - _oneHandlers: any; - on(type: any, handler: any): this; - one(type: any, handler: any): this; - off(type: any, handler?: any): this; - trigger(type: any, ...args: any[]): this; - triggerWith(type: any, context: any, args: any): this; - hasHandlers(type: any): any; - } -} - -declare module '@fullcalendar/core/datelib/date-range' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { DateEnv, DateInput } from '@fullcalendar/core/datelib/env'; - export interface DateRangeInput { - start?: DateInput; - end?: DateInput; - } - export interface OpenDateRange { - start: DateMarker | null; - end: DateMarker | null; - } - export interface DateRange { - start: DateMarker; - end: DateMarker; - } - export function parseRange(input: DateRangeInput, dateEnv: DateEnv): OpenDateRange; - export function invertRanges(ranges: DateRange[], constraintRange: DateRange): DateRange[]; - export function intersectRanges(range0: OpenDateRange, range1: OpenDateRange): OpenDateRange; - export function rangesEqual(range0: OpenDateRange, range1: OpenDateRange): boolean; - export function rangesIntersect(range0: OpenDateRange, range1: OpenDateRange): boolean; - export function rangeContainsRange(outerRange: OpenDateRange, innerRange: OpenDateRange): boolean; - export function rangeContainsMarker(range: OpenDateRange, date: DateMarker | number): boolean; - export function constrainMarkerToRange(date: DateMarker, range: DateRange): DateMarker; -} - -declare module '@fullcalendar/core/common/Mixin' { - export { Mixin as default, Mixin }; - class Mixin { - static mixInto(destClass: any): void; - static mixIntoObj(destObj: any): void; - static mixOver(destClass: any): void; - } -} - -declare module '@fullcalendar/core/common/PositionCache' { - export { PositionCache as default, PositionCache }; - class PositionCache { - originClientRect: ClientRect; - els: HTMLElement[]; - originEl: HTMLElement; - isHorizontal: boolean; - isVertical: boolean; - lefts: any; - rights: any; - tops: any; - bottoms: any; - constructor(originEl: HTMLElement, els: HTMLElement[], isHorizontal: boolean, isVertical: boolean); - build(): void; - buildElHorizontals(originClientLeft: number): void; - buildElVerticals(originClientTop: number): void; - leftToIndex(leftPosition: number): any; - topToIndex(topPosition: number): any; - getWidth(leftIndex: number): number; - getHeight(topIndex: number): number; - } -} - -declare module '@fullcalendar/core/common/ScrollComponent' { - import { ElementScrollController } from '@fullcalendar/core/common/scroll-controller'; - export interface ScrollbarWidths { - left: number; - right: number; - bottom: number; - } - export { ScrollComponent as default, ScrollComponent }; - class ScrollComponent extends ElementScrollController { - overflowX: string; - overflowY: string; - constructor(overflowX: string, overflowY: string); - clear(): void; - destroy(): void; - applyOverflow(): void; - lockOverflow(scrollbarWidths: ScrollbarWidths): void; - setHeight(height: number | string): void; - getScrollbarWidths(): ScrollbarWidths; - } -} - -declare module '@fullcalendar/core/common/scroll-controller' { - export abstract class ScrollController { - abstract getScrollTop(): number; - abstract getScrollLeft(): number; - abstract setScrollTop(top: number): void; - abstract setScrollLeft(left: number): void; - abstract getClientWidth(): number; - abstract getClientHeight(): number; - abstract getScrollWidth(): number; - abstract getScrollHeight(): number; - getMaxScrollTop(): number; - getMaxScrollLeft(): number; - canScrollVertically(): boolean; - canScrollHorizontally(): boolean; - canScrollUp(): boolean; - canScrollDown(): boolean; - canScrollLeft(): boolean; - canScrollRight(): boolean; - } - export class ElementScrollController extends ScrollController { - el: HTMLElement; - constructor(el: HTMLElement); - getScrollTop(): number; - getScrollLeft(): number; - setScrollTop(top: number): void; - setScrollLeft(left: number): void; - getScrollWidth(): number; - getScrollHeight(): number; - getClientHeight(): number; - getClientWidth(): number; - } - export class WindowScrollController extends ScrollController { - getScrollTop(): number; - getScrollLeft(): number; - setScrollTop(n: number): void; - setScrollLeft(n: number): void; - getScrollWidth(): number; - getScrollHeight(): number; - getClientHeight(): number; - getClientWidth(): number; - } -} - -declare module '@fullcalendar/core/theme/Theme' { - export { Theme as default, Theme }; - class Theme { - calendarOptions: any; - classes: any; - iconClasses: any; - baseIconClass: string; - iconOverrideOption: any; - iconOverrideCustomButtonOption: any; - iconOverridePrefix: string; - constructor(calendarOptions: any); - processIconOverride(): void; - setIconOverride(iconOverrideHash: any): void; - applyIconOverridePrefix(className: any): any; - getClass(key: any): any; - getIconClass(buttonName: any): string; - getCustomButtonIconClass(customButtonProps: any): string; - } - export type ThemeClass = { - new (calendarOptions: any): Theme; - }; -} - -declare module '@fullcalendar/core/component/Component' { - import Calendar from '@fullcalendar/core/Calendar'; - import View from '@fullcalendar/core/View'; - import Theme from '@fullcalendar/core/theme/Theme'; - import { DateEnv } from '@fullcalendar/core/datelib/env'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - export class ComponentContext { - calendar: Calendar; - theme: Theme; - dateEnv: DateEnv; - options: any; - view?: View; - isRtl: boolean; - eventOrderSpecs: any; - nextDayThreshold: Duration; - constructor(calendar: Calendar, theme: Theme, dateEnv: DateEnv, options: any, view?: View); - extend(options?: any, view?: View): ComponentContext; - } - export type EqualityFuncHash = { - [propName: string]: (obj0: any, obj1: any) => boolean; - }; - export { Component as default, Component }; - class Component { - equalityFuncs: EqualityFuncHash; - uid: string; - props: PropsType | null; - everRendered: boolean; - context: ComponentContext; - constructor(); - static addEqualityFuncs(newFuncs: EqualityFuncHash): void; - receiveProps(props: PropsType, context: ComponentContext): void; - receiveContext(context: ComponentContext): void; - protected render(props: PropsType, context: ComponentContext): void; - firstContext(context: ComponentContext): void; - beforeUpdate(): void; - afterUpdate(): void; - destroy(): void; - } -} - -declare module '@fullcalendar/core/component/DateComponent' { - import Component from '@fullcalendar/core/component/Component'; - import { EventRenderRange } from '@fullcalendar/core/component/event-rendering'; - import { DateSpan } from '@fullcalendar/core/structs/date-span'; - import { EventInstanceHash } from '@fullcalendar/core/structs/event'; - import { Hit } from '@fullcalendar/core/interactions/hit'; - import FgEventRenderer from '@fullcalendar/core/component/renderers/FgEventRenderer'; - import FillRenderer from '@fullcalendar/core/component/renderers/FillRenderer'; - import { EventInteractionState } from '@fullcalendar/core/interactions/event-interaction-state'; - export type DateComponentHash = { - [uid: string]: DateComponent; - }; - export interface Seg { - component?: DateComponent; - isStart: boolean; - isEnd: boolean; - eventRange?: EventRenderRange; - el?: HTMLElement; - [otherProp: string]: any; - } - export interface EventSegUiInteractionState { - affectedInstances: EventInstanceHash; - segs: Seg[]; - isEvent: boolean; - sourceSeg: any; - } - export { DateComponent as default, DateComponent }; - class DateComponent extends Component { - fgSegSelector: string; - bgSegSelector: string; - largeUnit: any; - eventRenderer: FgEventRenderer; - mirrorRenderer: FgEventRenderer; - fillRenderer: FillRenderer; - el: HTMLElement; - constructor(el: HTMLElement); - destroy(): void; - buildPositionCaches(): void; - queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit | null; - isInteractionValid(interaction: EventInteractionState): boolean; - isDateSelectionValid(selection: DateSpan): boolean; - isValidSegDownEl(el: HTMLElement): boolean; - isValidDateDownEl(el: HTMLElement): boolean; - isPopover(): boolean; - isInPopover(el: HTMLElement): boolean; - } -} - -declare module '@fullcalendar/core/Calendar' { - import { EmitterInterface } from '@fullcalendar/core/common/EmitterMixin'; - import OptionsManager from '@fullcalendar/core/OptionsManager'; - import View from '@fullcalendar/core/View'; - import Theme from '@fullcalendar/core/theme/Theme'; - import { OptionsInput, EventHandlerName, EventHandlerArgs } from '@fullcalendar/core/types/input-types'; - import { RawLocaleMap } from '@fullcalendar/core/datelib/locale'; - import { DateEnv, DateInput } from '@fullcalendar/core/datelib/env'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { Duration, DurationInput } from '@fullcalendar/core/datelib/duration'; - import { DateSpan, DateSpanApi, DatePointApi } from '@fullcalendar/core/structs/date-span'; - import { DateRangeInput } from '@fullcalendar/core/datelib/date-range'; - import DateProfileGenerator from '@fullcalendar/core/DateProfileGenerator'; - import { EventSourceInput } from '@fullcalendar/core/structs/event-source'; - import { EventInput } from '@fullcalendar/core/structs/event'; - import { CalendarState, Action } from '@fullcalendar/core/reducers/types'; - import EventSourceApi from '@fullcalendar/core/api/EventSourceApi'; - import EventApi from '@fullcalendar/core/api/EventApi'; - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { EventUiHash, EventUi } from '@fullcalendar/core/component/event-ui'; - import { ViewSpecHash, ViewSpec } from '@fullcalendar/core/structs/view-spec'; - import { PluginSystem } from '@fullcalendar/core/plugin-system'; - import CalendarComponent from '@fullcalendar/core/CalendarComponent'; - import DateComponent from '@fullcalendar/core/component/DateComponent'; - import { PointerDragEvent } from '@fullcalendar/core/interactions/pointer'; - import { InteractionSettingsInput, Interaction } from '@fullcalendar/core/interactions/interaction'; - export interface DateClickApi extends DatePointApi { - dayEl: HTMLElement; - jsEvent: UIEvent; - view: View; - } - export interface DateSelectionApi extends DateSpanApi { - jsEvent: UIEvent; - view: View; - } - export type DatePointTransform = (dateSpan: DateSpan, calendar: Calendar) => any; - export type DateSpanTransform = (dateSpan: DateSpan, calendar: Calendar) => any; - export type CalendarInteraction = { - destroy(): any; - }; - export type CalendarInteractionClass = { - new (calendar: Calendar): CalendarInteraction; - }; - export type OptionChangeHandler = (propValue: any, calendar: Calendar, deepEqual: any) => void; - export type OptionChangeHandlerMap = { - [propName: string]: OptionChangeHandler; - }; - export { Calendar as default, Calendar }; - class Calendar { - static on: EmitterInterface['on']; - static off: EmitterInterface['off']; - static trigger: EmitterInterface['trigger']; - on: EmitterInterface['on']; - one: EmitterInterface['one']; - off: EmitterInterface['off']; - trigger: EmitterInterface['trigger']; - triggerWith: EmitterInterface['triggerWith']; - hasHandlers: EmitterInterface['hasHandlers']; - eventUiBases: EventUiHash; - selectionConfig: EventUi; - optionsManager: OptionsManager; - viewSpecs: ViewSpecHash; - dateProfileGenerators: { - [viewName: string]: DateProfileGenerator; - }; - theme: Theme; - dateEnv: DateEnv; - availableRawLocales: RawLocaleMap; - pluginSystem: PluginSystem; - defaultAllDayEventDuration: Duration; - defaultTimedEventDuration: Duration; - calendarInteractions: CalendarInteraction[]; - interactionsStore: { - [componentUid: string]: Interaction[]; - }; - removeNavLinkListener: any; - windowResizeProxy: any; - isHandlingWindowResize: boolean; - state: CalendarState; - actionQueue: any[]; - isReducing: boolean; - needsRerender: boolean; - isRendering: boolean; - renderingPauseDepth: number; - renderableEventStore: EventStore; - buildDelayedRerender: typeof buildDelayedRerender; - delayedRerender: any; - afterSizingTriggers: any; - isViewUpdated: boolean; - isDatesUpdated: boolean; - isEventsUpdated: boolean; - el: HTMLElement; - component: CalendarComponent; - constructor(el: HTMLElement, overrides?: OptionsInput); - addPluginInputs(pluginInputs: any): void; - readonly view: View; - render(): void; - destroy(): void; - bindHandlers(): void; - unbindHandlers(): void; - hydrate(): void; - buildInitialState(): CalendarState; - reduce(state: CalendarState, action: Action, calendar: Calendar): CalendarState; - requestRerender(): void; - tryRerender(): void; - batchRendering(func: any): void; - executeRender(): void; - renderComponent(): void; - setOption(name: string, val: any): void; - getOption(name: string): any; - opt(name: string): any; - viewOpt(name: string): any; - viewOpts(): any; - mutateOptions(updates: any, removals: string[], isDynamic?: boolean, deepEqual?: any): void; - handleOptions(options: any): void; - getAvailableLocaleCodes(): string[]; - _buildSelectionConfig(rawOpts: any): EventUi; - _buildEventUiSingleBase(rawOpts: any): EventUi; - hasPublicHandlers(name: T): boolean; - publiclyTrigger(name: T, args?: EventHandlerArgs): any; - publiclyTriggerAfterSizing(name: T, args: EventHandlerArgs): void; - releaseAfterSizingTriggers(): void; - isValidViewType(viewType: string): boolean; - changeView(viewType: string, dateOrRange?: DateRangeInput | DateInput): void; - zoomTo(dateMarker: DateMarker, viewType?: string): void; - getUnitViewSpec(unit: string): ViewSpec | null; - getInitialDate(): Date; - prev(): void; - next(): void; - prevYear(): void; - nextYear(): void; - today(): void; - gotoDate(zonedDateInput: any): void; - incrementDate(deltaInput: any): void; - getDate(): Date; - formatDate(d: DateInput, formatter: any): string; - formatRange(d0: DateInput, d1: DateInput, settings: any): any; - formatIso(d: DateInput, omitTime?: boolean): string; - windowResize(ev: Event): void; - updateSize(): void; - registerInteractiveComponent(component: DateComponent, settingsInput: InteractionSettingsInput): void; - unregisterInteractiveComponent(component: DateComponent): void; - select(dateOrObj: DateInput | any, endDate?: DateInput): void; - unselect(pev?: PointerDragEvent): void; - triggerDateSelect(selection: DateSpan, pev?: PointerDragEvent): void; - triggerDateUnselect(pev?: PointerDragEvent): void; - triggerDateClick(dateSpan: DateSpan, dayEl: HTMLElement, view: View, ev: UIEvent): void; - buildDatePointApi(dateSpan: DateSpan): import("@fullcalendar/core/structs/date-span").DatePointApi; - buildDateSpanApi(dateSpan: DateSpan): import("@fullcalendar/core/structs/date-span").DateSpanApi; - getNow(): DateMarker; - getDefaultEventEnd(allDay: boolean, marker: DateMarker): DateMarker; - addEvent(eventInput: EventInput, sourceInput?: EventSourceApi | string | number): EventApi | null; - getEventById(id: string): EventApi | null; - getEvents(): EventApi[]; - removeAllEvents(): void; - rerenderEvents(): void; - getEventSources(): EventSourceApi[]; - getEventSourceById(id: string | number): EventSourceApi | null; - addEventSource(sourceInput: EventSourceInput): EventSourceApi; - removeAllEventSources(): void; - refetchEvents(): void; - scrollToTime(timeInput: DurationInput): void; - } - function buildDelayedRerender(this: Calendar, wait: any): any; - export {}; -} - -declare module '@fullcalendar/core/View' { - import DateProfileGenerator, { DateProfile } from '@fullcalendar/core/DateProfileGenerator'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { EmitterInterface } from '@fullcalendar/core/common/EmitterMixin'; - import { ViewSpec } from '@fullcalendar/core/structs/view-spec'; - import DateComponent from '@fullcalendar/core/component/DateComponent'; - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { EventUiHash } from '@fullcalendar/core/component/event-ui'; - import { EventRenderRange } from '@fullcalendar/core/component/event-rendering'; - import { DateSpan } from '@fullcalendar/core/structs/date-span'; - import { EventInteractionState } from '@fullcalendar/core/interactions/event-interaction-state'; - import { ComponentContext } from '@fullcalendar/core/component/Component'; - export interface ViewProps { - dateProfileGenerator: DateProfileGenerator; - dateProfile: DateProfile; - businessHours: EventStore; - eventStore: EventStore; - eventUiBases: EventUiHash; - dateSelection: DateSpan | null; - eventSelection: string; - eventDrag: EventInteractionState | null; - eventResize: EventInteractionState | null; - } - export { View as default, View }; - abstract class View extends DateComponent { - usesMinMaxTime: boolean; - dateProfileGeneratorClass: any; - on: EmitterInterface['on']; - one: EmitterInterface['one']; - off: EmitterInterface['off']; - trigger: EmitterInterface['trigger']; - triggerWith: EmitterInterface['triggerWith']; - hasHandlers: EmitterInterface['hasHandlers']; - viewSpec: ViewSpec; - type: string; - title: string; - queuedScroll: any; - isNowIndicatorRendered: boolean; - initialNowDate: DateMarker; - initialNowQueriedMs: number; - nowIndicatorTimeoutID: any; - nowIndicatorIntervalID: any; - constructor(viewSpec: ViewSpec, parentEl: HTMLElement); - initialize(): void; - readonly activeStart: Date; - readonly activeEnd: Date; - readonly currentStart: Date; - readonly currentEnd: Date; - render(props: ViewProps, context: ComponentContext): void; - beforeUpdate(): void; - destroy(): void; - updateSize(isResize: boolean, viewHeight: number, isAuto: boolean): void; - updateBaseSize(isResize: boolean, viewHeight: number, isAuto: boolean): void; - renderDatesWrap(dateProfile: DateProfile): void; - unrenderDatesWrap(): void; - renderDates(dateProfile: DateProfile): void; - unrenderDates(): void; - renderBusinessHours(businessHours: EventStore): void; - unrenderBusinessHours(): void; - renderDateSelectionWrap(selection: DateSpan): void; - unrenderDateSelectionWrap(selection: DateSpan): void; - renderDateSelection(selection: DateSpan): void; - unrenderDateSelection(selection: DateSpan): void; - renderEvents(eventStore: EventStore): void; - unrenderEvents(): void; - sliceEvents(eventStore: EventStore, allDay: boolean): EventRenderRange[]; - renderEventSelectionWrap(instanceId: string): void; - unrenderEventSelectionWrap(instanceId: string): void; - renderEventSelection(instanceId: string): void; - unrenderEventSelection(instanceId: string): void; - renderEventDragWrap(state: EventInteractionState): void; - unrenderEventDragWrap(state: EventInteractionState): void; - renderEventDrag(state: EventInteractionState): void; - unrenderEventDrag(state: EventInteractionState): void; - renderEventResizeWrap(state: EventInteractionState): void; - unrenderEventResizeWrap(state: EventInteractionState): void; - renderEventResize(state: EventInteractionState): void; - unrenderEventResize(state: EventInteractionState): void; - startNowIndicator(dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator): void; - updateNowIndicator(): void; - stopNowIndicator(): void; - getNowIndicatorUnit(dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator): void; - renderNowIndicator(date: any): void; - unrenderNowIndicator(): void; - addScroll(scroll: any, isForced?: boolean): void; - popScroll(isResize: boolean): void; - applyQueuedScroll(isResize: boolean): void; - queryScroll(): any; - applyScroll(scroll: any, isResize: boolean): void; - computeDateScroll(duration: Duration): {}; - queryDateScroll(): {}; - applyDateScroll(scroll: any): void; - scrollToDuration(duration: Duration): void; - } -} - -declare module '@fullcalendar/core/component/renderers/FgEventRenderer' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { DateFormatter } from '@fullcalendar/core/datelib/formatting'; - import { EventUi } from '@fullcalendar/core/component/event-ui'; - import { EventRenderRange } from '@fullcalendar/core/component/event-rendering'; - import { Seg } from '@fullcalendar/core/component/DateComponent'; - import { ComponentContext } from '@fullcalendar/core/component/Component'; - export { FgEventRenderer as default, FgEventRenderer }; - abstract class FgEventRenderer { - context: ComponentContext; - eventTimeFormat: DateFormatter; - displayEventTime: boolean; - displayEventEnd: boolean; - segs: Seg[]; - isSizeDirty: boolean; - renderSegs(context: ComponentContext, segs: Seg[], mirrorInfo?: any): void; - unrender(context: ComponentContext, _segs: Seg[], mirrorInfo?: any): void; - abstract renderSegHtml(seg: Seg, mirrorInfo: any): string; - abstract attachSegs(segs: Seg[], mirrorInfo: any): any; - abstract detachSegs(segs: Seg[]): any; - rangeUpdated(): void; - renderSegEls(segs: Seg[], mirrorInfo: any): Seg[]; - getSegClasses(seg: Seg, isDraggable: any, isResizable: any, mirrorInfo: any): string[]; - getTimeText(eventRange: EventRenderRange, formatter?: any, displayEnd?: any): any; - _getTimeText(start: DateMarker, end: DateMarker, allDay: any, formatter?: any, displayEnd?: any, forcedStartTzo?: number, forcedEndTzo?: number): any; - computeEventTimeFormat(): any; - computeDisplayEventTime(): boolean; - computeDisplayEventEnd(): boolean; - getSkinCss(ui: EventUi): { - 'background-color': string; - 'border-color': string; - color: string; - }; - sortEventSegs(segs: any): Seg[]; - computeSizes(force: boolean): void; - assignSizes(force: boolean): void; - computeSegSizes(segs: Seg[]): void; - assignSegSizes(segs: Seg[]): void; - hideByHash(hash: any): void; - showByHash(hash: any): void; - selectByInstanceId(instanceId: string): void; - unselectByInstanceId(instanceId: string): void; - } - export function buildSegCompareObj(seg: Seg): any; -} - -declare module '@fullcalendar/core/component/renderers/FillRenderer' { - import { Seg } from '@fullcalendar/core/component/DateComponent'; - import { ComponentContext } from '@fullcalendar/core/component/Component'; - export { FillRenderer as default, FillRenderer }; - abstract class FillRenderer { - context: ComponentContext; - fillSegTag: string; - containerElsByType: any; - segsByType: any; - dirtySizeFlags: any; - constructor(); - getSegsByType(type: string): any; - renderSegs(type: string, context: ComponentContext, segs: Seg[]): void; - unrender(type: string, context: ComponentContext): void; - renderSegEls(type: any, segs: Seg[]): Seg[]; - renderSegHtml(type: any, seg: Seg): string; - abstract attachSegs(type: any, segs: Seg[]): HTMLElement[] | void; - detachSegs(type: any, segs: Seg[]): void; - computeSizes(force: boolean): void; - assignSizes(force: boolean): void; - computeSegSizes(segs: Seg[]): void; - assignSegSizes(segs: Seg[]): void; - } -} - -declare module '@fullcalendar/core/DateProfileGenerator' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { DateRange, OpenDateRange } from '@fullcalendar/core/datelib/date-range'; - import { ViewSpec } from '@fullcalendar/core/structs/view-spec'; - import { DateEnv } from '@fullcalendar/core/datelib/env'; - import Calendar from '@fullcalendar/core/Calendar'; - export interface DateProfile { - currentRange: DateRange; - currentRangeUnit: string; - isRangeAllDay: boolean; - validRange: OpenDateRange; - activeRange: DateRange; - renderRange: DateRange; - minTime: Duration; - maxTime: Duration; - isValid: boolean; - dateIncrement: Duration; - } - export { DateProfileGenerator as default, DateProfileGenerator }; - class DateProfileGenerator { - viewSpec: ViewSpec; - options: any; - dateEnv: DateEnv; - calendar: Calendar; - isHiddenDayHash: boolean[]; - constructor(viewSpec: ViewSpec, calendar: Calendar); - buildPrev(currentDateProfile: DateProfile, currentDate: DateMarker): DateProfile; - buildNext(currentDateProfile: DateProfile, currentDate: DateMarker): DateProfile; - build(currentDate: DateMarker, direction?: any, forceToValid?: boolean): DateProfile; - buildValidRange(): OpenDateRange; - buildCurrentRangeInfo(date: DateMarker, direction: any): { - duration: any; - unit: any; - range: any; - }; - getFallbackDuration(): Duration; - adjustActiveRange(range: DateRange, minTime: Duration, maxTime: Duration): { - start: Date; - end: Date; - }; - buildRangeFromDuration(date: DateMarker, direction: any, duration: Duration, unit: any): any; - buildRangeFromDayCount(date: DateMarker, direction: any, dayCount: any): { - start: Date; - end: Date; - }; - buildCustomVisibleRange(date: DateMarker): OpenDateRange; - buildRenderRange(currentRange: DateRange, currentRangeUnit: any, isRangeAllDay: any): DateRange; - buildDateIncrement(fallback: any): Duration; - getRangeOption(name: any, ...otherArgs: any[]): OpenDateRange; - initHiddenDays(): void; - trimHiddenDays(range: DateRange): DateRange | null; - isHiddenDay(day: any): boolean; - skipHiddenDays(date: DateMarker, inc?: number, isExclusive?: boolean): Date; - } - export function isDateProfilesEqual(p0: DateProfile, p1: DateProfile): boolean; -} - -declare module '@fullcalendar/core/structs/view-def' { - import { ViewClass, ViewConfigHash } from '@fullcalendar/core/structs/view-config'; - export interface ViewDef { - type: string; - class: ViewClass; - overrides: any; - defaults: any; - } - export type ViewDefHash = { - [viewType: string]: ViewDef; - }; - export function compileViewDefs(defaultConfigs: ViewConfigHash, overrideConfigs: ViewConfigHash): ViewDefHash; -} - -declare module '@fullcalendar/core/structs/view-spec' { - import { Duration } from '@fullcalendar/core/datelib/duration'; - import OptionsManager from '@fullcalendar/core/OptionsManager'; - import { ViewConfigInputHash, ViewClass } from '@fullcalendar/core/structs/view-config'; - export interface ViewSpec { - type: string; - class: ViewClass; - duration: Duration; - durationUnit: string; - singleUnit: string; - options: any; - buttonTextOverride: string; - buttonTextDefault: string; - } - export type ViewSpecHash = { - [viewType: string]: ViewSpec; - }; - export function buildViewSpecs(defaultInputs: ViewConfigInputHash, optionsManager: OptionsManager): ViewSpecHash; -} - -declare module '@fullcalendar/core/structs/date-span' { - import { DateRange, OpenDateRange } from '@fullcalendar/core/datelib/date-range'; - import { DateInput, DateEnv } from '@fullcalendar/core/datelib/env'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { EventRenderRange } from '@fullcalendar/core/component/event-rendering'; - import { EventUiHash } from '@fullcalendar/core/component/event-ui'; - import Calendar from '@fullcalendar/core/Calendar'; - export interface OpenDateSpanInput { - start?: DateInput; - end?: DateInput; - allDay?: boolean; - [otherProp: string]: any; - } - export interface DateSpanInput extends OpenDateSpanInput { - start: DateInput; - end: DateInput; - } - export interface OpenDateSpan { - range: OpenDateRange; - allDay: boolean; - [otherProp: string]: any; - } - export interface DateSpan extends OpenDateSpan { - range: DateRange; - } - export interface DateSpanApi { - start: Date; - end: Date; - startStr: string; - endStr: string; - allDay: boolean; - } - export interface DatePointApi { - date: Date; - dateStr: string; - allDay: boolean; - } - export function parseDateSpan(raw: DateSpanInput, dateEnv: DateEnv, defaultDuration?: Duration): DateSpan | null; - export function parseOpenDateSpan(raw: OpenDateSpanInput, dateEnv: DateEnv): OpenDateSpan | null; - export function isDateSpansEqual(span0: DateSpan, span1: DateSpan): boolean; - export function buildDateSpanApi(span: DateSpan, dateEnv: DateEnv): DateSpanApi; - export function buildDatePointApi(span: DateSpan, dateEnv: DateEnv): DatePointApi; - export function fabricateEventRange(dateSpan: DateSpan, eventUiBases: EventUiHash, calendar: Calendar): EventRenderRange; -} - -declare module '@fullcalendar/core/datelib/marker' { - import { Duration } from '@fullcalendar/core/datelib/duration'; - export type DateMarker = Date; - export const DAY_IDS: string[]; - export function addWeeks(m: DateMarker, n: number): Date; - export function addDays(m: DateMarker, n: number): Date; - export function addMs(m: DateMarker, n: number): Date; - export function diffWeeks(m0: any, m1: any): number; - export function diffDays(m0: any, m1: any): number; - export function diffHours(m0: any, m1: any): number; - export function diffMinutes(m0: any, m1: any): number; - export function diffSeconds(m0: any, m1: any): number; - export function diffDayAndTime(m0: DateMarker, m1: DateMarker): Duration; - export function diffWholeWeeks(m0: DateMarker, m1: DateMarker): number; - export function diffWholeDays(m0: DateMarker, m1: DateMarker): number; - export function startOfDay(m: DateMarker): DateMarker; - export function startOfHour(m: DateMarker): Date; - export function startOfMinute(m: DateMarker): Date; - export function startOfSecond(m: DateMarker): Date; - export function weekOfYear(marker: any, dow: any, doy: any): number; - export function dateToLocalArray(date: any): any[]; - export function arrayToLocalDate(a: any): Date; - export function dateToUtcArray(date: any): any[]; - export function arrayToUtcDate(a: any): Date; - export function isValidDate(m: DateMarker): boolean; - export function timeAsMs(m: DateMarker): number; -} - -declare module '@fullcalendar/core/datelib/duration' { - export type DurationInput = DurationObjectInput | string | number; - export interface DurationObjectInput { - years?: number; - year?: number; - months?: number; - month?: number; - weeks?: number; - week?: number; - days?: number; - day?: number; - hours?: number; - hour?: number; - minutes?: number; - minute?: number; - seconds?: number; - second?: number; - milliseconds?: number; - millisecond?: number; - ms?: number; - } - export interface Duration { - years: number; - months: number; - days: number; - milliseconds: number; - } - export function createDuration(input: DurationInput, unit?: string): Duration | null; - export function getWeeksFromInput(obj: DurationObjectInput): number; - export function durationsEqual(d0: Duration, d1: Duration): boolean; - export function isSingleDay(dur: Duration): boolean; - export function addDurations(d0: Duration, d1: Duration): { - years: number; - months: number; - days: number; - milliseconds: number; - }; - export function subtractDurations(d1: Duration, d0: Duration): Duration; - export function multiplyDuration(d: Duration, n: number): { - years: number; - months: number; - days: number; - milliseconds: number; - }; - export function asRoughYears(dur: Duration): number; - export function asRoughMonths(dur: Duration): number; - export function asRoughDays(dur: Duration): number; - export function asRoughHours(dur: Duration): number; - export function asRoughMinutes(dur: Duration): number; - export function asRoughSeconds(dur: Duration): number; - export function asRoughMs(dur: Duration): number; - export function wholeDivideDurations(numerator: Duration, denominator: Duration): number; - export function greatestDurationDenominator(dur: Duration, dontReturnWeeks?: boolean): { - unit: string; - value: number; - }; -} - -declare module '@fullcalendar/core/datelib/env' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { CalendarSystem } from '@fullcalendar/core/datelib/calendar-system'; - import { Locale } from '@fullcalendar/core/datelib/locale'; - import { NamedTimeZoneImpl, NamedTimeZoneImplClass } from '@fullcalendar/core/datelib/timezone'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { DateFormatter } from '@fullcalendar/core/datelib/formatting'; - import { CmdFormatterFunc } from '@fullcalendar/core/datelib/formatting-cmd'; - export interface DateEnvSettings { - timeZone: string; - namedTimeZoneImpl?: NamedTimeZoneImplClass; - calendarSystem: string; - locale: Locale; - weekNumberCalculation?: any; - firstDay?: any; - weekLabel?: string; - cmdFormatter?: CmdFormatterFunc; - } - export type DateInput = Date | string | number | number[]; - export interface DateMarkerMeta { - marker: DateMarker; - isTimeUnspecified: boolean; - forcedTzo: number | null; - } - export class DateEnv { - timeZone: string; - namedTimeZoneImpl: NamedTimeZoneImpl; - canComputeOffset: boolean; - calendarSystem: CalendarSystem; - locale: Locale; - weekDow: number; - weekDoy: number; - weekNumberFunc: any; - weekLabel: string; - cmdFormatter?: CmdFormatterFunc; - constructor(settings: DateEnvSettings); - createMarker(input: DateInput): DateMarker; - createNowMarker(): DateMarker; - createMarkerMeta(input: DateInput): DateMarkerMeta; - parse(s: string): { - marker: Date; - isTimeUnspecified: boolean; - forcedTzo: any; - }; - getYear(marker: DateMarker): number; - getMonth(marker: DateMarker): number; - add(marker: DateMarker, dur: Duration): DateMarker; - subtract(marker: DateMarker, dur: Duration): DateMarker; - addYears(marker: DateMarker, n: number): Date; - addMonths(marker: DateMarker, n: number): Date; - diffWholeYears(m0: DateMarker, m1: DateMarker): number; - diffWholeMonths(m0: DateMarker, m1: DateMarker): number; - greatestWholeUnit(m0: DateMarker, m1: DateMarker): { - unit: string; - value: number; - }; - countDurationsBetween(m0: DateMarker, m1: DateMarker, d: Duration): number; - startOf(m: DateMarker, unit: string): Date; - startOfYear(m: DateMarker): DateMarker; - startOfMonth(m: DateMarker): DateMarker; - startOfWeek(m: DateMarker): DateMarker; - computeWeekNumber(marker: DateMarker): number; - format(marker: DateMarker, formatter: DateFormatter, dateOptions?: { - forcedTzo?: number; - }): any; - formatRange(start: DateMarker, end: DateMarker, formatter: DateFormatter, dateOptions?: { - forcedStartTzo?: number; - forcedEndTzo?: number; - isEndExclusive?: boolean; - }): any; - formatIso(marker: DateMarker, extraOptions?: any): string; - timestampToMarker(ms: number): Date; - offsetForMarker(m: DateMarker): number; - toDate(m: DateMarker, forcedTzo?: number): Date; - } -} - -declare module '@fullcalendar/core/datelib/formatting' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { CalendarSystem } from '@fullcalendar/core/datelib/calendar-system'; - import { Locale } from '@fullcalendar/core/datelib/locale'; - import { CmdFormatterFunc } from '@fullcalendar/core/datelib/formatting-cmd'; - import { FuncFormatterFunc } from '@fullcalendar/core/datelib/formatting-func'; - export interface ZonedMarker { - marker: DateMarker; - timeZoneOffset: number; - } - export interface ExpandedZonedMarker extends ZonedMarker { - array: number[]; - year: number; - month: number; - day: number; - hour: number; - minute: number; - second: number; - millisecond: number; - } - export interface VerboseFormattingArg { - date: ExpandedZonedMarker; - start: ExpandedZonedMarker; - end?: ExpandedZonedMarker; - timeZone: string; - localeCodes: string[]; - separator: string; - } - export interface DateFormattingContext { - timeZone: string; - locale: Locale; - calendarSystem: CalendarSystem; - computeWeekNumber: (d: DateMarker) => number; - weekLabel: string; - cmdFormatter?: CmdFormatterFunc; - } - export interface DateFormatter { - format(date: ZonedMarker, context: DateFormattingContext): any; - formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext): any; - } - export type FormatterInput = object | string | FuncFormatterFunc; - export function createFormatter(input: FormatterInput, defaultSeparator?: string): DateFormatter; - export function buildIsoString(marker: DateMarker, timeZoneOffset?: number, stripZeroTime?: boolean): string; - export function formatIsoTimeString(marker: DateMarker): string; - export function formatTimeZoneOffset(minutes: number, doIso?: boolean): string; - export function createVerboseFormattingArg(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, separator?: string): VerboseFormattingArg; -} - -declare module '@fullcalendar/core/datelib/timezone' { - export abstract class NamedTimeZoneImpl { - timeZoneName: string; - constructor(timeZoneName: string); - abstract offsetForArray(a: number[]): number; - abstract timestampToArray(ms: number): number[]; - } - export type NamedTimeZoneImplClass = { - new (timeZoneName: string): NamedTimeZoneImpl; - }; -} - -declare module '@fullcalendar/core/datelib/parsing' { - export function parse(str: any): { - marker: Date; - isTimeUnspecified: boolean; - timeZoneOffset: any; - }; -} - -declare module '@fullcalendar/core/structs/event-source' { - import { EventInput } from '@fullcalendar/core/structs/event'; - import Calendar from '@fullcalendar/core/Calendar'; - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - import { EventSourceFunc } from '@fullcalendar/core/event-sources/func-event-source'; - import { EventUi } from '@fullcalendar/core/component/event-ui'; - import { ConstraintInput, AllowFunc } from '@fullcalendar/core/validation'; - export type EventSourceError = { - message: string; - response?: any; - [otherProp: string]: any; - }; - export type EventInputTransformer = (eventInput: EventInput) => EventInput | null; - export type EventSourceSuccessResponseHandler = (rawData: any, response: any) => EventInput[] | void; - export type EventSourceErrorResponseHandler = (error: EventSourceError) => void; - export interface ExtendedEventSourceInput { - id?: string | number; - allDayDefault?: boolean; - eventDataTransform?: EventInputTransformer; - events?: EventInput[] | EventSourceFunc; - url?: string; - method?: string; - extraParams?: object | (() => object); - startParam?: string; - endParam?: string; - timeZoneParam?: string; - success?: EventSourceSuccessResponseHandler; - failure?: EventSourceErrorResponseHandler; - editable?: boolean; - startEditable?: boolean; - durationEditable?: boolean; - constraint?: ConstraintInput; - overlap?: boolean; - allow?: AllowFunc; - className?: string[] | string; - classNames?: string[] | string; - backgroundColor?: string; - borderColor?: string; - textColor?: string; - color?: string; - [otherProp: string]: any; - } - export type EventSourceInput = ExtendedEventSourceInput | // object in extended form - EventSourceFunc | // just a function - string; - export interface EventSource { - _raw: any; - sourceId: string; - sourceDefId: number; - meta: any; - publicId: string; - isFetching: boolean; - latestFetchId: string; - fetchRange: DateRange | null; - allDayDefault: boolean | null; - eventDataTransform: EventInputTransformer; - ui: EventUi; - success: EventSourceSuccessResponseHandler | null; - failure: EventSourceErrorResponseHandler | null; - extendedProps: any; - } - export type EventSourceHash = { - [sourceId: string]: EventSource; - }; - export type EventSourceFetcher = (arg: { - eventSource: EventSource; - calendar: Calendar; - range: DateRange; - }, success: (res: { - rawEvents: EventInput[]; - xhr?: XMLHttpRequest; - }) => void, failure: (error: EventSourceError) => void) => (void | PromiseLike); - export interface EventSourceDef { - ignoreRange?: boolean; - parseMeta: (raw: EventSourceInput) => object | null; - fetch: EventSourceFetcher; - } - export function doesSourceNeedRange(eventSource: EventSource, calendar: Calendar): boolean; - export function parseEventSource(raw: EventSourceInput, calendar: Calendar): EventSource | null; -} - -declare module '@fullcalendar/core/interactions/interaction' { - import DateComponent from '@fullcalendar/core/component/DateComponent'; - export abstract class Interaction { - component: DateComponent; - constructor(settings: InteractionSettings); - destroy(): void; - } - export type InteractionClass = { - new (settings: InteractionSettings): Interaction; - }; - export interface InteractionSettingsInput { - el: HTMLElement; - useEventCenter?: boolean; - } - export interface InteractionSettings { - component: DateComponent; - el: HTMLElement; - useEventCenter: boolean; - } - export type InteractionSettingsStore = { - [componenUid: string]: InteractionSettings; - }; - export function parseInteractionSettings(component: DateComponent, input: InteractionSettingsInput): InteractionSettings; - export function interactionSettingsToStore(settings: InteractionSettings): { - [x: string]: InteractionSettings; - }; - export let interactionSettingsStore: InteractionSettingsStore; -} - -declare module '@fullcalendar/core/interactions/pointer' { - export interface PointerDragEvent { - origEvent: UIEvent; - isTouch: boolean; - subjectEl: EventTarget; - pageX: number; - pageY: number; - deltaX: number; - deltaY: number; - } -} - -declare module '@fullcalendar/core/interactions/hit' { - import DateComponent from '@fullcalendar/core/component/DateComponent'; - import { DateSpan } from '@fullcalendar/core/structs/date-span'; - import { Rect } from '@fullcalendar/core/util/geom'; - export interface Hit { - component: DateComponent; - dateSpan: DateSpan; - dayEl: HTMLElement; - rect: Rect; - layer: number; - } -} - -declare module '@fullcalendar/core/interactions/date-selecting' { - import { Hit } from '@fullcalendar/core/interactions/hit'; - export type dateSelectionJoinTransformer = (hit0: Hit, hit1: Hit) => any; -} - -declare module '@fullcalendar/core/interactions/event-dragging' { - import Calendar from '@fullcalendar/core/Calendar'; - import { EventMutation } from '@fullcalendar/core/structs/event-mutation'; - import { Hit } from '@fullcalendar/core/interactions/hit'; - import { EventDef } from '@fullcalendar/core/structs/event'; - import { EventUi } from '@fullcalendar/core/component/event-ui'; - import { View } from '@fullcalendar/core'; - export type eventDragMutationMassager = (mutation: EventMutation, hit0: Hit, hit1: Hit) => void; - export type EventDropTransformers = (mutation: EventMutation, calendar: Calendar) => any; - export type eventIsDraggableTransformer = (val: boolean, eventDef: EventDef, eventUi: EventUi, view: View) => boolean; -} - -declare module '@fullcalendar/core/interactions/event-resizing' { - import { Hit } from '@fullcalendar/core/interactions/hit'; - export type EventResizeJoinTransforms = (hit0: Hit, hit1: Hit) => false | object; -} - -declare module '@fullcalendar/core/interactions/ElementDragging' { - import EmitterMixin from '@fullcalendar/core/common/EmitterMixin'; - export { ElementDragging as default, ElementDragging }; - abstract class ElementDragging { - emitter: EmitterMixin; - constructor(el: HTMLElement); - destroy(): void; - abstract setIgnoreMove(bool: boolean): void; - setMirrorIsVisible(bool: boolean): void; - setMirrorNeedsRevert(bool: boolean): void; - setAutoScrollEnabled(bool: boolean): void; - } - export type ElementDraggingClass = { - new (el: HTMLElement): ElementDragging; - }; -} - -declare module '@fullcalendar/core/formatting-api' { - import { DateInput } from '@fullcalendar/core/datelib/env'; - export function formatDate(dateInput: DateInput, settings?: {}): any; - export function formatRange(startInput: DateInput, endInput: DateInput, settings: any): any; -} - -declare module '@fullcalendar/core/options' { - import { PluginDef } from '@fullcalendar/core/plugin-system'; - export const config: any; - export const globalDefaults: { - defaultRangeSeparator: string; - titleRangeSeparator: string; - defaultTimedEventDuration: string; - defaultAllDayEventDuration: { - day: number; - }; - forceEventDuration: boolean; - nextDayThreshold: string; - columnHeader: boolean; - defaultView: string; - aspectRatio: number; - header: { - left: string; - center: string; - right: string; - }; - weekends: boolean; - weekNumbers: boolean; - weekNumberCalculation: string; - editable: boolean; - scrollTime: string; - minTime: string; - maxTime: string; - showNonCurrentDates: boolean; - lazyFetching: boolean; - startParam: string; - endParam: string; - timeZoneParam: string; - timeZone: string; - locales: any[]; - locale: string; - timeGridEventMinHeight: number; - themeSystem: string; - dragRevertDuration: number; - dragScroll: boolean; - allDayMaintainDuration: boolean; - unselectAuto: boolean; - dropAccept: string; - eventOrder: string; - eventLimit: boolean; - eventLimitClick: string; - dayPopoverFormat: { - month: string; - day: string; - year: string; - }; - handleWindowResize: boolean; - windowResizeDelay: number; - longPressDelay: number; - eventDragMinDistance: number; - }; - export const rtlDefaults: { - header: { - left: string; - center: string; - right: string; - }; - buttonIcons: { - prev: string; - next: string; - prevYear: string; - nextYear: string; - }; - }; - export function mergeOptions(optionObjs: any): any; - export function refinePluginDefs(pluginInputs: any[]): PluginDef[]; -} - -declare module '@fullcalendar/core/structs/recurring-event' { - import { EventInput, EventDef } from '@fullcalendar/core/structs/event'; - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - import { DateEnv } from '@fullcalendar/core/datelib/env'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - export interface ParsedRecurring { - typeData: any; - allDayGuess: boolean | null; - duration: Duration | null; - } - export interface RecurringType { - parse: (rawEvent: EventInput, leftoverProps: any, dateEnv: DateEnv) => ParsedRecurring | null; - expand: (typeData: any, framingRange: DateRange, dateEnv: DateEnv) => DateMarker[]; - } - export function parseRecurring(eventInput: EventInput, allDayDefault: boolean | null, dateEnv: DateEnv, recurringTypes: RecurringType[], leftovers: any): { - allDay: any; - duration: Duration; - typeData: any; - typeId: number; - }; - export function expandRecurringRanges(eventDef: EventDef, duration: Duration, framingRange: DateRange, dateEnv: DateEnv, recurringTypes: RecurringType[]): DateMarker[]; -} - -declare module '@fullcalendar/core/structs/drag-meta' { - import { Duration, DurationInput } from '@fullcalendar/core/datelib/duration'; - import { EventNonDateInput } from '@fullcalendar/core/structs/event'; - export interface DragMetaInput extends EventNonDateInput { - startTime?: DurationInput; - duration?: DurationInput; - create?: boolean; - sourceId?: string; - } - export interface DragMeta { - startTime: Duration | null; - duration: Duration | null; - create: boolean; - sourceId: string; - leftoverProps: object; - } - export function parseDragMeta(raw: DragMetaInput): DragMeta; -} - -declare module '@fullcalendar/core/plugin-system' { - import { reducerFunc } from '@fullcalendar/core/reducers/types'; - import { eventDefParserFunc } from '@fullcalendar/core/structs/event'; - import { eventDefMutationApplier } from '@fullcalendar/core/structs/event-mutation'; - import Calendar, { DatePointTransform, DateSpanTransform, CalendarInteractionClass, OptionChangeHandlerMap } from '@fullcalendar/core/Calendar'; - import { ViewConfigInputHash } from '@fullcalendar/core/structs/view-config'; - import { ViewSpec } from '@fullcalendar/core/structs/view-spec'; - import { ViewProps } from '@fullcalendar/core/View'; - import { CalendarComponentProps } from '@fullcalendar/core/CalendarComponent'; - import { isPropsValidTester } from '@fullcalendar/core/validation'; - import { eventDragMutationMassager, eventIsDraggableTransformer, EventDropTransformers } from '@fullcalendar/core/interactions/event-dragging'; - import { dateSelectionJoinTransformer } from '@fullcalendar/core/interactions/date-selecting'; - import { EventResizeJoinTransforms } from '@fullcalendar/core/interactions/event-resizing'; - import { ExternalDefTransform } from '@fullcalendar/core/interactions/external-element-dragging'; - import { InteractionClass } from '@fullcalendar/core/interactions/interaction'; - import { ThemeClass } from '@fullcalendar/core/theme/Theme'; - import { EventSourceDef } from '@fullcalendar/core/structs/event-source'; - import { CmdFormatterFunc } from '@fullcalendar/core/datelib/formatting-cmd'; - import { RecurringType } from '@fullcalendar/core/structs/recurring-event'; - import { NamedTimeZoneImplClass } from '@fullcalendar/core/datelib/timezone'; - import { ElementDraggingClass } from '@fullcalendar/core/interactions/ElementDragging'; - export interface PluginDefInput { - deps?: PluginDef[]; - reducers?: reducerFunc[]; - eventDefParsers?: eventDefParserFunc[]; - isDraggableTransformers?: eventIsDraggableTransformer[]; - eventDragMutationMassagers?: eventDragMutationMassager[]; - eventDefMutationAppliers?: eventDefMutationApplier[]; - dateSelectionTransformers?: dateSelectionJoinTransformer[]; - datePointTransforms?: DatePointTransform[]; - dateSpanTransforms?: DateSpanTransform[]; - views?: ViewConfigInputHash; - viewPropsTransformers?: ViewPropsTransformerClass[]; - isPropsValid?: isPropsValidTester; - externalDefTransforms?: ExternalDefTransform[]; - eventResizeJoinTransforms?: EventResizeJoinTransforms[]; - viewContainerModifiers?: ViewContainerModifier[]; - eventDropTransformers?: EventDropTransformers[]; - componentInteractions?: InteractionClass[]; - calendarInteractions?: CalendarInteractionClass[]; - themeClasses?: { - [themeSystemName: string]: ThemeClass; - }; - eventSourceDefs?: EventSourceDef[]; - cmdFormatter?: CmdFormatterFunc; - recurringTypes?: RecurringType[]; - namedTimeZonedImpl?: NamedTimeZoneImplClass; - defaultView?: string; - elementDraggingImpl?: ElementDraggingClass; - optionChangeHandlers?: OptionChangeHandlerMap; - } - export interface PluginHooks { - reducers: reducerFunc[]; - eventDefParsers: eventDefParserFunc[]; - isDraggableTransformers: eventIsDraggableTransformer[]; - eventDragMutationMassagers: eventDragMutationMassager[]; - eventDefMutationAppliers: eventDefMutationApplier[]; - dateSelectionTransformers: dateSelectionJoinTransformer[]; - datePointTransforms: DatePointTransform[]; - dateSpanTransforms: DateSpanTransform[]; - views: ViewConfigInputHash; - viewPropsTransformers: ViewPropsTransformerClass[]; - isPropsValid: isPropsValidTester | null; - externalDefTransforms: ExternalDefTransform[]; - eventResizeJoinTransforms: EventResizeJoinTransforms[]; - viewContainerModifiers: ViewContainerModifier[]; - eventDropTransformers: EventDropTransformers[]; - componentInteractions: InteractionClass[]; - calendarInteractions: CalendarInteractionClass[]; - themeClasses: { - [themeSystemName: string]: ThemeClass; - }; - eventSourceDefs: EventSourceDef[]; - cmdFormatter?: CmdFormatterFunc; - recurringTypes: RecurringType[]; - namedTimeZonedImpl?: NamedTimeZoneImplClass; - defaultView: string; - elementDraggingImpl?: ElementDraggingClass; - optionChangeHandlers: OptionChangeHandlerMap; - } - export interface PluginDef extends PluginHooks { - id: string; - deps: PluginDef[]; - } - export type ViewPropsTransformerClass = new () => ViewPropsTransformer; - export interface ViewPropsTransformer { - transform(viewProps: ViewProps, viewSpec: ViewSpec, calendarProps: CalendarComponentProps, allOptions: any): any; - } - export type ViewContainerModifier = (contentEl: HTMLElement, calendar: Calendar) => void; - export function createPlugin(input: PluginDefInput): PluginDef; - export class PluginSystem { - hooks: PluginHooks; - addedHash: { - [pluginId: string]: true; - }; - constructor(); - add(plugin: PluginDef): void; - } -} - -declare module '@fullcalendar/core/reducers/types' { - import { EventInput, EventInstanceHash } from '@fullcalendar/core/structs/event'; - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { EventMutation } from '@fullcalendar/core/structs/event-mutation'; - import { EventSource, EventSourceHash, EventSourceError } from '@fullcalendar/core/structs/event-source'; - import { DateProfile } from '@fullcalendar/core/DateProfileGenerator'; - import { EventInteractionState } from '@fullcalendar/core/interactions/event-interaction-state'; - import { DateSpan } from '@fullcalendar/core/structs/date-span'; - import { DateEnv } from '@fullcalendar/core/datelib/env'; - import Calendar from '@fullcalendar/core/Calendar'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - export interface CalendarState { - eventSources: EventSourceHash; - eventSourceLoadingLevel: number; - loadingLevel: number; - viewType: string; - currentDate: DateMarker; - dateProfile: DateProfile | null; - eventStore: EventStore; - dateSelection: DateSpan | null; - eventSelection: string; - eventDrag: EventInteractionState | null; - eventResize: EventInteractionState | null; - } - export type reducerFunc = (state: CalendarState, action: Action, calendar: Calendar) => CalendarState; - export type Action = { - type: 'INIT'; - } | // wont it create another rerender? - { - type: 'PREV'; - } | { - type: 'NEXT'; - } | { - type: 'SET_DATE'; - dateMarker: DateMarker; - } | { - type: 'SET_VIEW_TYPE'; - viewType: string; - dateMarker?: DateMarker; - } | { - type: 'SELECT_DATES'; - selection: DateSpan; - } | { - type: 'UNSELECT_DATES'; - } | { - type: 'SELECT_EVENT'; - eventInstanceId: string; - } | { - type: 'UNSELECT_EVENT'; - } | { - type: 'SET_EVENT_DRAG'; - state: EventInteractionState; - } | { - type: 'UNSET_EVENT_DRAG'; - } | { - type: 'SET_EVENT_RESIZE'; - state: EventInteractionState; - } | { - type: 'UNSET_EVENT_RESIZE'; - } | { - type: 'ADD_EVENT_SOURCES'; - sources: EventSource[]; - } | { - type: 'REMOVE_EVENT_SOURCE'; - sourceId: string; - } | { - type: 'REMOVE_ALL_EVENT_SOURCES'; - } | { - type: 'FETCH_EVENT_SOURCES'; - sourceIds?: string[]; - } | // if no sourceIds, fetch all - { - type: 'CHANGE_TIMEZONE'; - oldDateEnv: DateEnv; - } | { - type: 'RECEIVE_EVENTS'; - sourceId: string; - fetchId: string; - fetchRange: DateRange | null; - rawEvents: EventInput[]; - } | { - type: 'RECEIVE_EVENT_ERROR'; - sourceId: string; - fetchId: string; - fetchRange: DateRange | null; - error: EventSourceError; - } | // need all these? - { - type: 'ADD_EVENTS'; - eventStore: EventStore; - } | { - type: 'MERGE_EVENTS'; - eventStore: EventStore; - } | { - type: 'MUTATE_EVENTS'; - instanceId: string; - mutation: EventMutation; - fromApi?: boolean; - } | { - type: 'REMOVE_EVENT_DEF'; - defId: string; - } | { - type: 'REMOVE_EVENT_INSTANCES'; - instances: EventInstanceHash; - } | { - type: 'REMOVE_ALL_EVENTS'; - } | { - type: 'RESET_EVENTS'; - }; -} - -declare module '@fullcalendar/core/CalendarComponent' { - import Component, { ComponentContext } from '@fullcalendar/core/component/Component'; - import { ViewSpec } from '@fullcalendar/core/structs/view-spec'; - import View from '@fullcalendar/core/View'; - import Toolbar from '@fullcalendar/core/Toolbar'; - import DateProfileGenerator, { DateProfile } from '@fullcalendar/core/DateProfileGenerator'; - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { EventUiHash } from '@fullcalendar/core/component/event-ui'; - import { BusinessHoursInput } from '@fullcalendar/core/structs/business-hours'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { CalendarState } from '@fullcalendar/core/reducers/types'; - export interface CalendarComponentProps extends CalendarState { - viewSpec: ViewSpec; - dateProfileGenerator: DateProfileGenerator; - eventUiBases: EventUiHash; - } - export { CalendarComponent as default, CalendarComponent }; - class CalendarComponent extends Component { - view: View; - header: Toolbar; - footer: Toolbar; - computeTitle: (dateProfile: any, viewOptions: any) => string; - parseBusinessHours: (input: BusinessHoursInput) => EventStore; - el: HTMLElement; - contentEl: HTMLElement; - elClassNames: string[]; - savedScroll: any; - isHeightAuto: boolean; - viewHeight: number; - constructor(el: HTMLElement); - render(props: CalendarComponentProps, context: ComponentContext): void; - destroy(): void; - _renderSkeleton(context: ComponentContext): void; - _unrenderSkeleton(): void; - removeElClassNames(): void; - updateElClassNames(context: ComponentContext): void; - _renderToolbars(viewSpec: ViewSpec, dateProfile: DateProfile, currentDate: DateMarker, title: string): void; - _unrenderToolbars(): void; - renderView(props: CalendarComponentProps, title: string): void; - updateSize(isResize?: boolean): void; - computeHeightVars(): void; - queryToolbarsHeight(): number; - freezeHeight(): void; - thawHeight(): void; - } -} - -declare module '@fullcalendar/core/common/DayHeader' { - import Component, { ComponentContext } from '@fullcalendar/core/component/Component'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { DateProfile } from '@fullcalendar/core/DateProfileGenerator'; - export interface DayTableHeaderProps { - dates: DateMarker[]; - dateProfile: DateProfile; - datesRepDistinctDays: boolean; - renderIntroHtml?: () => string; - } - export { DayHeader as default, DayHeader }; - class DayHeader extends Component { - parentEl: HTMLElement; - el: HTMLElement; - thead: HTMLElement; - constructor(parentEl: HTMLElement); - render(props: DayTableHeaderProps, context: ComponentContext): void; - destroy(): void; - _renderSkeleton(context: ComponentContext): void; - _unrenderSkeleton(): void; - } -} - -declare module '@fullcalendar/core/common/table-utils' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { DateProfile } from '@fullcalendar/core/DateProfileGenerator'; - import { ComponentContext } from '@fullcalendar/core/component/Component'; - export function computeFallbackHeaderFormat(datesRepDistinctDays: boolean, dayCnt: number): { - weekday: string; - month?: undefined; - day?: undefined; - omitCommas?: undefined; - } | { - weekday: string; - month: string; - day: string; - omitCommas: boolean; - }; - export function renderDateCell(dateMarker: DateMarker, dateProfile: DateProfile, datesRepDistinctDays: any, colCnt: any, colHeadFormat: any, context: ComponentContext, colspan?: any, otherAttrs?: any): string; -} - -declare module '@fullcalendar/core/common/DaySeries' { - import DateProfileGenerator from '@fullcalendar/core/DateProfileGenerator'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - export interface DaySeriesSeg { - firstIndex: number; - lastIndex: number; - isStart: boolean; - isEnd: boolean; - } - export { DaySeries as default, DaySeries }; - class DaySeries { - cnt: number; - dates: DateMarker[]; - indices: number[]; - constructor(range: DateRange, dateProfileGenerator: DateProfileGenerator); - sliceRange(range: DateRange): DaySeriesSeg | null; - } -} - -declare module '@fullcalendar/core/interactions/event-interaction-state' { - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { Seg } from '@fullcalendar/core/component/DateComponent'; - export interface EventInteractionState { - affectedEvents: EventStore; - mutatedEvents: EventStore; - isEvent: boolean; - origSeg: Seg | null; - } -} - -declare module '@fullcalendar/core/component/event-rendering' { - import { EventDef, EventTuple, EventDefHash } from '@fullcalendar/core/structs/event'; - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { Seg } from '@fullcalendar/core/component/DateComponent'; - import { EventUi, EventUiHash } from '@fullcalendar/core/component/event-ui'; - import { ComponentContext } from '@fullcalendar/core/component/Component'; - export interface EventRenderRange extends EventTuple { - ui: EventUi; - range: DateRange; - isStart: boolean; - isEnd: boolean; - } - export function sliceEventStore(eventStore: EventStore, eventUiBases: EventUiHash, framingRange: DateRange, nextDayThreshold?: Duration): { - bg: EventRenderRange[]; - fg: EventRenderRange[]; - }; - export function hasBgRendering(def: EventDef): boolean; - export function filterSegsViaEls(context: ComponentContext, segs: Seg[], isMirror: boolean): Seg[]; - export function getElSeg(el: HTMLElement): Seg | null; - export function compileEventUis(eventDefs: EventDefHash, eventUiBases: EventUiHash): { - [key: string]: EventUi; - }; - export function compileEventUi(eventDef: EventDef, eventUiBases: EventUiHash): EventUi; - export function triggerRenderedSegs(context: ComponentContext, segs: Seg[], isMirrors: boolean): void; - export function triggerWillRemoveSegs(context: ComponentContext, segs: Seg[], isMirrors: boolean): void; - export function computeEventDraggable(context: ComponentContext, eventDef: EventDef, eventUi: EventUi): boolean; - export function computeEventStartResizable(context: ComponentContext, eventDef: EventDef, eventUi: EventUi): any; - export function computeEventEndResizable(context: ComponentContext, eventDef: EventDef, eventUi: EventUi): boolean; -} - -declare module '@fullcalendar/core/common/DayTable' { - import DaySeries from '@fullcalendar/core/common/DaySeries'; - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import { Seg } from '@fullcalendar/core/component/DateComponent'; - export interface DayTableSeg extends Seg { - row: number; - firstCol: number; - lastCol: number; - } - export interface DayTableCell { - date: DateMarker; - htmlAttrs?: string; - } - export { DayTable as default, DayTable }; - class DayTable { - rowCnt: number; - colCnt: number; - cells: DayTableCell[][]; - headerDates: DateMarker[]; - constructor(daySeries: DaySeries, breakOnWeeks: boolean); - sliceRange(range: DateRange): DayTableSeg[]; - } -} - -declare module '@fullcalendar/core/common/slicing-utils' { - import { DateRange } from '@fullcalendar/core/datelib/date-range'; - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { EventUiHash } from '@fullcalendar/core/component/event-ui'; - import { DateProfile } from '@fullcalendar/core/DateProfileGenerator'; - import DateComponent, { Seg, EventSegUiInteractionState } from '@fullcalendar/core/component/DateComponent'; - import { DateSpan } from '@fullcalendar/core/structs/date-span'; - import { EventInteractionState } from '@fullcalendar/core/interactions/event-interaction-state'; - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - import Calendar from '@fullcalendar/core/Calendar'; - export interface SliceableProps { - dateSelection: DateSpan; - businessHours: EventStore; - eventStore: EventStore; - eventDrag: EventInteractionState | null; - eventResize: EventInteractionState | null; - eventSelection: string; - eventUiBases: EventUiHash; - } - export interface SlicedProps { - dateSelectionSegs: SegType[]; - businessHourSegs: SegType[]; - fgEventSegs: SegType[]; - bgEventSegs: SegType[]; - eventDrag: EventSegUiInteractionState | null; - eventResize: EventSegUiInteractionState | null; - eventSelection: string; - } - export { Slicer as default, Slicer }; - abstract class Slicer { - abstract sliceRange(dateRange: DateRange, ...extraArgs: ExtraArgs): SegType[]; - sliceProps(props: SliceableProps, dateProfile: DateProfile, nextDayThreshold: Duration | null, calendar: Calendar, component: DateComponent, // TODO: kill - ...extraArgs: ExtraArgs): SlicedProps; - sliceNowDate(// does not memoize - date: DateMarker, component: DateComponent, // TODO: kill - ...extraArgs: ExtraArgs): SegType[]; - } -} - -declare module '@fullcalendar/core/structs/event-mutation' { - import { Duration } from '@fullcalendar/core/datelib/duration'; - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import { EventDef } from '@fullcalendar/core/structs/event'; - import Calendar from '@fullcalendar/core/Calendar'; - import { EventUiHash } from '@fullcalendar/core/component/event-ui'; - export interface EventMutation { - datesDelta?: Duration; - startDelta?: Duration; - endDelta?: Duration; - standardProps?: any; - extendedProps?: any; - } - export function applyMutationToEventStore(eventStore: EventStore, eventConfigBase: EventUiHash, mutation: EventMutation, calendar: Calendar): EventStore; - export type eventDefMutationApplier = (eventDef: EventDef, mutation: EventMutation, calendar: Calendar) => void; -} - -declare module '@fullcalendar/core/validation' { - import { EventStore } from '@fullcalendar/core/structs/event-store'; - import Calendar from '@fullcalendar/core/Calendar'; - import { DateSpan, DateSpanApi } from '@fullcalendar/core/structs/date-span'; - import EventApi from '@fullcalendar/core/api/EventApi'; - import { EventInput } from '@fullcalendar/core/structs/event'; - import { EventInteractionState } from '@fullcalendar/core/interactions/event-interaction-state'; - import { SplittableProps } from '@fullcalendar/core/component/event-splitting'; - export type ConstraintInput = 'businessHours' | string | EventInput | EventInput[]; - export type Constraint = 'businessHours' | string | EventStore | false; - export type OverlapFunc = ((stillEvent: EventApi, movingEvent: EventApi | null) => boolean); - export type AllowFunc = (span: DateSpanApi, movingEvent: EventApi | null) => boolean; - export type isPropsValidTester = (props: SplittableProps, calendar: Calendar) => boolean; - export function isInteractionValid(interaction: EventInteractionState, calendar: Calendar): boolean; - export function isDateSelectionValid(dateSelection: DateSpan, calendar: Calendar): boolean; - export function isPropsValid(state: SplittableProps, calendar: Calendar, dateSpanMeta?: {}, filterConfig?: any): boolean; - export function normalizeConstraint(input: ConstraintInput, calendar: Calendar): Constraint | null; -} - -declare module '@fullcalendar/core/api/EventApi' { - import Calendar from '@fullcalendar/core/Calendar'; - import { EventDef, EventInstance } from '@fullcalendar/core/structs/event'; - import { EventMutation } from '@fullcalendar/core/structs/event-mutation'; - import { DateInput } from '@fullcalendar/core/datelib/env'; - import { DurationInput } from '@fullcalendar/core/datelib/duration'; - import { FormatterInput } from '@fullcalendar/core/datelib/formatting'; - import EventSourceApi from '@fullcalendar/core/api/EventSourceApi'; - export { EventApi as default, EventApi }; - class EventApi { - _calendar: Calendar; - _def: EventDef; - _instance: EventInstance | null; - constructor(calendar: Calendar, def: EventDef, instance?: EventInstance); - setProp(name: string, val: string): void; - setExtendedProp(name: string, val: any): void; - setStart(startInput: DateInput, options?: { - granularity?: string; - maintainDuration?: boolean; - }): void; - setEnd(endInput: DateInput | null, options?: { - granularity?: string; - }): void; - setDates(startInput: DateInput, endInput: DateInput | null, options?: { - allDay?: boolean; - granularity?: string; - }): void; - moveStart(deltaInput: DurationInput): void; - moveEnd(deltaInput: DurationInput): void; - moveDates(deltaInput: DurationInput): void; - setAllDay(allDay: boolean, options?: { - maintainDuration?: boolean; - }): void; - formatRange(formatInput: FormatterInput): any; - mutate(mutation: EventMutation): void; - remove(): void; - readonly source: EventSourceApi | null; - readonly start: Date | null; - readonly end: Date | null; - readonly id: string; - readonly groupId: string; - readonly allDay: boolean; - readonly title: string; - readonly url: string; - readonly rendering: string; - readonly startEditable: boolean; - readonly durationEditable: boolean; - readonly constraint: any; - readonly overlap: any; - readonly allow: any; - readonly backgroundColor: string; - readonly borderColor: string; - readonly textColor: string; - readonly classNames: string[]; - readonly extendedProps: any; - } -} - -declare module '@fullcalendar/core/util/requestJson' { - export default function requestJson(method: string, url: string, params: object, successCallback: any, failureCallback: any): void; -} - -declare module '@fullcalendar/core/datelib/locale' { - export type LocaleCodeArg = string | string[]; - export type LocaleSingularArg = LocaleCodeArg | RawLocale; - export interface Locale { - codeArg: LocaleCodeArg; - codes: string[]; - week: { - dow: number; - doy: number; - }; - simpleNumberFormat: Intl.NumberFormat; - options: any; - } - export interface RawLocale { - code: string; - [otherProp: string]: any; - } - export type RawLocaleMap = { - [code: string]: RawLocale; - }; - export interface RawLocaleInfo { - map: RawLocaleMap; - defaultCode: string; - } - export function parseRawLocales(explicitRawLocales: RawLocale[]): RawLocaleInfo; - export function buildLocale(inputSingular: LocaleSingularArg, available: RawLocaleMap): Locale; -} - -declare module '@fullcalendar/core/OptionsManager' { - export { OptionsManager as default, OptionsManager }; - class OptionsManager { - dirDefaults: any; - localeDefaults: any; - overrides: any; - dynamicOverrides: any; - computed: any; - constructor(overrides: any); - mutate(updates: any, removals: string[], isDynamic?: boolean): void; - compute(): void; - } -} - -declare module '@fullcalendar/core/api/EventSourceApi' { - import Calendar from '@fullcalendar/core/Calendar'; - import { EventSource } from '@fullcalendar/core/structs/event-source'; - export { EventSourceApi as default, EventSourceApi }; - class EventSourceApi { - calendar: Calendar; - internalEventSource: EventSource; - constructor(calendar: Calendar, internalEventSource: EventSource); - remove(): void; - refetch(): void; - readonly id: string; - readonly url: string; - } -} - -declare module '@fullcalendar/core/structs/view-config' { - import View from '@fullcalendar/core/View'; - import { ViewSpec } from '@fullcalendar/core/structs/view-spec'; - export type ViewClass = new (viewSpec: ViewSpec, parentEl: HTMLElement) => View; - export interface ViewConfigObjectInput { - type?: string; - class?: ViewClass; - [optionName: string]: any; - } - export type ViewConfigInput = ViewClass | ViewConfigObjectInput; - export type ViewConfigInputHash = { - [viewType: string]: ViewConfigInput; - }; - export interface ViewConfig { - superType: string; - class: ViewClass | null; - options: any; - } - export type ViewConfigHash = { - [viewType: string]: ViewConfig; - }; - export function parseViewConfigs(inputs: ViewConfigInputHash): ViewConfigHash; -} - -declare module '@fullcalendar/core/datelib/calendar-system' { - import { DateMarker } from '@fullcalendar/core/datelib/marker'; - export interface CalendarSystem { - getMarkerYear(d: DateMarker): number; - getMarkerMonth(d: DateMarker): number; - getMarkerDay(d: DateMarker): number; - arrayToMarker(arr: number[]): DateMarker; - markerToArray(d: DateMarker): number[]; - } - export function registerCalendarSystem(name: any, theClass: any): void; - export function createCalendarSystem(name: any): any; -} - -declare module '@fullcalendar/core/datelib/formatting-cmd' { - import { DateFormatter, DateFormattingContext, ZonedMarker, VerboseFormattingArg } from '@fullcalendar/core/datelib/formatting'; - export type CmdFormatterFunc = (cmd: string, arg: VerboseFormattingArg) => string; - export class CmdFormatter implements DateFormatter { - cmdStr: string; - separator: string; - constructor(cmdStr: string, separator?: string); - format(date: ZonedMarker, context: DateFormattingContext): string; - formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext): string; - } -} - -declare module '@fullcalendar/core/datelib/formatting-func' { - import { DateFormatter, DateFormattingContext, ZonedMarker, VerboseFormattingArg } from '@fullcalendar/core/datelib/formatting'; - export type FuncFormatterFunc = (arg: VerboseFormattingArg) => string; - export class FuncFormatter implements DateFormatter { - func: FuncFormatterFunc; - constructor(func: FuncFormatterFunc); - format(date: ZonedMarker, context: DateFormattingContext): string; - formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext): string; - } -} - -declare module '@fullcalendar/core/event-sources/func-event-source' { - import { EventSourceError } from '@fullcalendar/core/structs/event-source'; - import { EventInput } from '@fullcalendar/core/structs/event'; - export type EventSourceFunc = (arg: { - start: Date; - end: Date; - timeZone: string; - }, successCallback: (events: EventInput[]) => void, failureCallback: (error: EventSourceError) => void) => (void | PromiseLike); - const _default: import("@fullcalendar/core/plugin-system").PluginDef; - export default _default; -} - -declare module '@fullcalendar/core/interactions/external-element-dragging' { - import { DateSpan } from '@fullcalendar/core/structs/date-span'; - import { DragMeta } from '@fullcalendar/core/structs/drag-meta'; - export type ExternalDefTransform = (dateSpan: DateSpan, dragMeta: DragMeta) => any; -} - -declare module '@fullcalendar/core/Toolbar' { - import Component from '@fullcalendar/core/component/Component'; - export interface ToolbarRenderProps { - layout: any; - title: string; - activeButton: string; - isTodayEnabled: boolean; - isPrevEnabled: boolean; - isNextEnabled: boolean; - } - export { Toolbar as default, Toolbar }; - class Toolbar extends Component { - el: HTMLElement; - viewsWithButtons: any; - constructor(extraClassName: any); - destroy(): void; - render(props: ToolbarRenderProps): void; - renderLayout(layout: any): void; - unrenderLayout(): void; - renderSection(position: any, buttonStr: any): HTMLElement; - updateToday(isTodayEnabled: any): void; - updatePrev(isPrevEnabled: any): void; - updateNext(isNextEnabled: any): void; - updateTitle(text: any): void; - updateActiveButton(buttonName?: any): void; - toggleButtonEnabled(buttonName: any, bool: any): void; - } -} - diff --git a/plugins/ion-rangeslider/License.md b/plugins/ion-rangeslider/License.md new file mode 100644 index 000000000..b0300b634 --- /dev/null +++ b/plugins/ion-rangeslider/License.md @@ -0,0 +1,9 @@ +## The MIT License + +Copyright © 2019 by Denis Ineshin (http://ionden.com) + +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/plugins/ion-rangeslider/less/_base.less b/plugins/ion-rangeslider/less/_base.less deleted file mode 100644 index ad480666a..000000000 --- a/plugins/ion-rangeslider/less/_base.less +++ /dev/null @@ -1,145 +0,0 @@ -@import (reference) "_mixins"; - -.irs { - .pos-r(); - -webkit-touch-callout: none; - .no-click(); - font-size: 12px; - font-family: Arial, sans-serif; - - &-line { - .pos-r(); - overflow: hidden; - outline: none !important; - } - - &-bar { - .pos-a(); - left: 0; - width: 0; - } - - &-shadow { - position: absolute; - display: none; - left: 0; - width: 0; - } - - &-handle { - .pos-a(); - box-sizing: border-box; - cursor: default; - z-index: 1; - - &.single, - &.from, - &.to {} - - &.type_last { - z-index: 2; - } - } - - &-min, - &-max { - .pos-a(); - cursor: default; - } - - &-min { - left: 0; - } - - &-max { - right: 0; - } - - &-from, - &-to, - &-single { - .pos-a(); - top: 0; - left: 0; - cursor: default; - white-space: nowrap; - } - - &-grid { - position: absolute; - display: none; - bottom: 0; - left: 0; - width: 100%; - height: 20px; - - .irs-with-grid & { - display: block; - } - - &-pol { - position: absolute; - top: 0; - left: 0; - width: 1px; - height: 8px; - background: #000; - - &.small { - height: 4px; - } - } - - &-text { - position: absolute; - bottom: 0; - left: 0; - white-space: nowrap; - text-align: center; - font-size: 9px; - line-height: 9px; - padding: 0 3px; - color: #000; - } - } - - &-disable-mask { - .pos-a(); - top: 0; - left: -1%; - width: 102%; - height: 100%; - cursor: default; - background: rgba(0,0,0,0.0); - z-index: 2; - - .lt-ie9 & { - background: #000; - filter: alpha(opacity=0); - cursor: not-allowed; - } - } - - &-disabled { - opacity: 0.4; - } - - &-hidden-input { - position: absolute !important; - display: block !important; - top: 0 !important; - left: 0 !important; - width: 0 !important; - height: 0 !important; - font-size: 0 !important; - line-height: 0 !important; - padding: 0 !important; - margin: 0 !important; - overflow: hidden; - outline: none !important; - z-index: -9999 !important; - background: none !important; - border-style: solid !important; - border-color: transparent !important; - } -} diff --git a/plugins/ion-rangeslider/less/_mixins.less b/plugins/ion-rangeslider/less/_mixins.less deleted file mode 100644 index 243348121..000000000 --- a/plugins/ion-rangeslider/less/_mixins.less +++ /dev/null @@ -1,17 +0,0 @@ -.no-click () { - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.pos-r () { - position: relative; - display: block; -} - -.pos-a () { - position: absolute; - display: block; -} diff --git a/plugins/ion-rangeslider/less/irs.less b/plugins/ion-rangeslider/less/irs.less deleted file mode 100644 index d7bb4226e..000000000 --- a/plugins/ion-rangeslider/less/irs.less +++ /dev/null @@ -1,10 +0,0 @@ -// Base styles -@import "_base"; - -// Skins styles -@import "skins/flat"; -@import "skins/big"; -@import "skins/modern"; -@import "skins/sharp"; -@import "skins/round"; -@import "skins/square"; diff --git a/plugins/ion-rangeslider/less/skins/big.less b/plugins/ion-rangeslider/less/skins/big.less deleted file mode 100644 index ed28bfbb5..000000000 --- a/plugins/ion-rangeslider/less/skins/big.less +++ /dev/null @@ -1,109 +0,0 @@ -.irs--big { - @name: irs; - - @top: 33px; - @bottom: 16px; - @line_height: 12px; - @handle_width: 30px; - @handle_height: 30px; - @custom_radius: 3px; - - @line_color_1: white; - @line_color_2: #ccc; - @line_color_3: #ddd; - @bar_color: #428bca; - @handle_color_1: #cbcfd5; - @handle_color_2: #B4B9BE; - @handle_color_3: white; - @handle_color_4: #919BA5; - @minmax_text_color: white; - @minmax_bg_color: #9f9f9f; - @label_color_1: #428bca; - @label_color_2: white; - @grid_color_1: #428bca; - - - - height: 55px; - - &.irs-with-grid { - height: 70px; - } - - .@{name}-line { - top: @top; - height: @line_height; - background-color: @line_color_1; - background: linear-gradient(to bottom, @line_color_3 -50%, @line_color_1 150%); - border: 1px solid @line_color_2; - border-radius: @line_height; - } - - .@{name}-bar { - top: @top; - height: @line_height; - background-color: lighten(@bar_color, 20%); - border: 1px solid @bar_color; - background: linear-gradient(to bottom, lighten(@bar_color, 70%) 0%, @bar_color 30%, lighten(@bar_color, 30%) 100%); - box-shadow: inset 0 0 1px 1px rgba(255,255,255,0.5); - - &--single { - border-radius: @line_height 0 0 @line_height; - } - } - - .@{name}-shadow { - height: 1px; - bottom: @bottom; - background-color: fade(@bar_color, 50%); - } - - .@{name}-handle { - top: 25px; - width: @handle_width; - height: @handle_height; - border: 1px solid rgba(0,0,0,0.3); - background-color: @handle_color_1; - background: linear-gradient(to bottom, @handle_color_3 0%, @handle_color_2 30%, @handle_color_3 100%); - box-shadow: 1px 1px 2px rgba(0,0,0,0.2), inset 0 0 3px 1px @handle_color_3; - border-radius: @handle_width; - - &.state_hover, - &:hover { - border-color: rgba(0,0,0,0.45); - background-color: darken(@handle_color_1, 20%); - background: linear-gradient(to bottom, @handle_color_3 0%, @handle_color_4 30%, @handle_color_3 100%); - } - } - - .@{name}-min, - .@{name}-max { - top: 0; - padding: 1px 5px; - color: @minmax_text_color; - text-shadow: none; - background-color: @minmax_bg_color; - border-radius: @custom_radius; - } - - .@{name}-from, - .@{name}-to, - .@{name}-single { - color: @label_color_2; - text-shadow: none; - padding: 1px 5px; - background-color: @label_color_1; - background: linear-gradient(to bottom, @label_color_1 0%, darken(@label_color_1, 10%) 100%); - border-radius: @custom_radius; - } - - .@{name}-grid { - &-pol { - background-color: @grid_color_1; - } - - &-text { - color: @grid_color_1; - } - } -} diff --git a/plugins/ion-rangeslider/less/skins/flat.less b/plugins/ion-rangeslider/less/skins/flat.less deleted file mode 100644 index f68a56fe9..000000000 --- a/plugins/ion-rangeslider/less/skins/flat.less +++ /dev/null @@ -1,125 +0,0 @@ -.irs--flat { - @name: irs; - - @top: 25px; - @bottom: 16px; - @line_height: 12px; - @handle_width: 16px; - @handle_height: 18px; - @custom_radius: 4px; - - @line_color: #e1e4e9; - @bar_color: #ed5565; - @handle_color_1: #da4453; - @handle_color_2: #a43540; - @minmax_text_color: #999; - @minmax_bg_color: #e1e4e9; - @label_color_1: #ed5565; - @label_color_2: white; - @grid_color_1: #e1e4e9; - @grid_color_2: #999; - - - - height: 40px; - - &.irs-with-grid { - height: 60px; - } - - .@{name}-line { - top: @top; - height: @line_height; - background-color: @line_color; - border-radius: @custom_radius; - } - - .@{name}-bar { - top: @top; - height: @line_height; - background-color: @bar_color; - - &--single { - border-radius: @custom_radius 0 0 @custom_radius; - } - } - - .@{name}-shadow { - height: 1px; - bottom: @bottom; - background-color: @line_color; - } - - .@{name}-handle { - top: 22px; - width: @handle_width; - height: @handle_height; - background-color: transparent; - - & > i:first-child { - position: absolute; - display: block; - top: 0; - left: 50%; - width: 2px; - height: 100%; - margin-left: -1px; - background-color: @handle_color_1; - } - - &.state_hover, - &:hover { - & > i:first-child { - background-color: @handle_color_2; - } - } - } - - .@{name}-min, - .@{name}-max { - top: 0; - padding: 1px 3px; - color: @minmax_text_color; - font-size: 10px; - line-height: 1.333; - text-shadow: none; - background-color: @minmax_bg_color; - border-radius: @custom_radius; - } - - .@{name}-from, - .@{name}-to, - .@{name}-single { - color: @label_color_2; - font-size: 10px; - line-height: 1.333; - text-shadow: none; - padding: 1px 5px; - background-color: @label_color_1; - border-radius: @custom_radius; - - &:before { - position: absolute; - display: block; - content: ""; - bottom: -6px; - left: 50%; - width: 0; - height: 0; - margin-left: -3px; - overflow: hidden; - border: 3px solid transparent; - border-top-color: @label_color_1; - } - } - - .@{name}-grid { - &-pol { - background-color: @grid_color_1; - } - - &-text { - color: @grid_color_2; - } - } -} diff --git a/plugins/ion-rangeslider/less/skins/modern.less b/plugins/ion-rangeslider/less/skins/modern.less deleted file mode 100644 index 0bc57488f..000000000 --- a/plugins/ion-rangeslider/less/skins/modern.less +++ /dev/null @@ -1,165 +0,0 @@ -.irs--modern { - @name: irs; - - @top: 25px; - @bottom: 21px; - @line_height: 5px; - @handle_width: 12px; - @handle_height: 13px; - - @line_color: #d1d6e0; - @bar_color: #20b426; - @handle_color_1: #e9e6e6; - @handle_color_2: white; - @handle_color_3: black; - @minmax_text_color: white; - @minmax_bg_color: #d1d6e0; - @label_color_1: #20b426; - @label_color_2: white; - @grid_color_1: #dedede; - @grid_color_2: silver; - - - - height: 55px; - - &.irs-with-grid { - height: 55px; - } - - .@{name}-line { - top: @top; - height: @line_height; - background-color: @line_color; - background: linear-gradient(to bottom, lighten(@line_color, 5%) 0%, @line_color 100%); - border: 1px solid darken(@line_color, 15%); - border-bottom-width: 0; - border-radius: @line_height; - } - - .@{name}-bar { - top: @top; - height: @line_height; - background: @bar_color; - background: linear-gradient(to bottom, @bar_color 0%, darken(@bar_color, 10%) 100%); - - &--single { - border-radius: @line_height 0 0 @line_height; - } - } - - .@{name}-shadow { - height: 1px; - bottom: @bottom; - background-color: fade(@line_color, 50%); - } - - .@{name}-handle { - top: 37px; - width: @handle_width; - height: @handle_height; - border: 1px solid darken(@line_color, 15%); - border-top-width: 0; - box-shadow: 1px 1px 1px rgba(0,0,0,0.1); - border-radius: 0 0 3px 3px; - - & > i:nth-child(1) { - position: absolute; - display: block; - top: -4px; left: 1px; - width: (@handle_width - 6px); - height: (@handle_width - 6px); - border: 1px solid darken(@line_color, 15%); - background: @handle_color_2; - transform: rotate(45deg); - } - - & > i:nth-child(2) { - position: absolute; - display: block; - box-sizing: border-box; - top: 0; left: 0; - width: (@handle_width - 2); - height: (@handle_height - 1); - background: @handle_color_1; - background: linear-gradient(to bottom, @handle_color_2 0%, @handle_color_1 100%); - border-radius: 0 0 3px 3px; - } - - & > i:nth-child(3) { - position: absolute; - display: block; - box-sizing: border-box; - top: 3px; left: 3px; - width: 4px; height: 5px; - border-left: 1px solid darken(@line_color, 15%); - border-right: 1px solid darken(@line_color, 15%); - } - - &.state_hover, - &:hover { - border-color: darken(@line_color, 30%); - background: #c3c7cd; - background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(145,155,165,1) 30%,rgba(255,255,255,1) 100%); - - & > i:nth-child(1) { - border-color: darken(@line_color, 30%); - } - - & > i:nth-child(3) { - border-color: darken(@line_color, 50%); - } - } - } - - .@{name}-min, - .@{name}-max { - top: 0; - font-size: 10px; - line-height: 1.333; - text-shadow: none; - padding: 1px 5px; - color: @minmax_text_color; - background-color: @minmax_bg_color; - border-radius: @line_height; - } - - .@{name}-from, - .@{name}-to, - .@{name}-single { - font-size: 10px; - line-height: 1.333; - text-shadow: none; - padding: 1px 5px; - background-color: @label_color_1; - color: @label_color_2; - border-radius: @line_height; - - &:before { - position: absolute; - display: block; - content: ""; - bottom: -6px; - left: 50%; - width: 0; - height: 0; - margin-left: -3px; - overflow: hidden; - border: 3px solid transparent; - border-top-color: @label_color_1; - } - } - - .@{name}-grid { - height: 25px; - - &-pol { - background-color: @grid_color_1; - } - - &-text { - color: @grid_color_2; - font-size: 13px; - } - } -} diff --git a/plugins/ion-rangeslider/less/skins/round.less b/plugins/ion-rangeslider/less/skins/round.less deleted file mode 100644 index deb547ccd..000000000 --- a/plugins/ion-rangeslider/less/skins/round.less +++ /dev/null @@ -1,120 +0,0 @@ -// Skin design by Veaceslav Grimalschi -// https://github.com/grimalschi - -.irs--round { - @name: irs; - - @top: 36px; - @bottom: 21px; - @line_height: 4px; - @handle_width: 24px; - @handle_height: 24px; - - @line_color: #dee4ec; - @bar_color: #006cfa; - @handle_color_1: #006cfa; - @handle_color_2: white; - @handle_color_3: #f0f6ff; - @minmax_text_color: #333; - @minmax_bg_color: rgba(0,0,0,0.1); - @label_color_1: #006cfa; - @label_color_2: white; - @grid_color_1: #dedede; - @grid_color_2: silver; - - - - height: 50px; - - &.irs-with-grid { - height: 65px; - } - - .@{name}-line { - top: @top; - height: @line_height; - background-color: @line_color; - border-radius: @line_height; - } - - .@{name}-bar { - top: @top; - height: @line_height; - background-color: @bar_color; - - &--single { - border-radius: @line_height 0 0 @line_height; - } - } - - .@{name}-shadow { - height: 4px; - bottom: @bottom; - background-color: fade(@line_color, 50%); - } - - .@{name}-handle { - top: 26px; - width: @handle_width; - height: @handle_height; - border: 4px solid @handle_color_1; - background-color: @handle_color_2; - border-radius: @handle_width; - box-shadow: 0 1px 3px rgba(0, 0, 255, 0.3); - - &.state_hover, - &:hover { - background-color: @handle_color_3; - } - } - - .@{name}-min, - .@{name}-max { - color: @minmax_text_color; - font-size: 14px; - line-height: 1; - top: 0; - padding: 3px 5px; - background-color: @minmax_bg_color; - border-radius: @line_height; - } - - .@{name}-from, - .@{name}-to, - .@{name}-single { - font-size: 14px; - line-height: 1; - text-shadow: none; - padding: 3px 5px; - background-color: @label_color_1; - color: @label_color_2; - border-radius: @line_height; - - &:before { - position: absolute; - display: block; - content: ""; - bottom: -6px; - left: 50%; - width: 0; - height: 0; - margin-left: -3px; - overflow: hidden; - border: 3px solid transparent; - border-top-color: @label_color_1; - } - } - - .@{name}-grid { - height: 25px; - - &-pol { - background-color: @grid_color_1; - } - - &-text { - color: @grid_color_2; - font-size: 13px; - } - } -} diff --git a/plugins/ion-rangeslider/less/skins/sharp.less b/plugins/ion-rangeslider/less/skins/sharp.less deleted file mode 100644 index 57fdde96e..000000000 --- a/plugins/ion-rangeslider/less/skins/sharp.less +++ /dev/null @@ -1,132 +0,0 @@ -.irs--sharp { - @name: irs; - - @top: 30px; - @bottom: 21px; - @line_height: 2px; - @handle_width: 10px; - @handle_height: 10px; - - @line_color: black; - @bar_color: #ee22fa; - @handle_color_1: darken(#ee22fa, 20%); - @handle_color_2: white; - @handle_color_3: black; - @minmax_text_color: white; - @minmax_bg_color: darken(#ee22fa, 20%); - @label_color_1: darken(#ee22fa, 20%); - @label_color_2: white; - @grid_color_1: #dedede; - @grid_color_2: silver; - - - - height: 50px; - font-size: 12px; - line-height: 1; - - &.irs-with-grid { - height: 57px; - } - - .@{name}-line { - top: @top; - height: @line_height; - background-color: @line_color; - border-radius: @line_height; - } - - .@{name}-bar { - top: @top; - height: @line_height; - background-color: @bar_color; - - &--single { - border-radius: @line_height 0 0 @line_height; - } - } - - .@{name}-shadow { - height: 1px; - bottom: @bottom; - background-color: fade(@line_color, 50%); - } - - .@{name}-handle { - top: (@top - 5px); - width: @handle_width; - height: @handle_height; - background-color: @handle_color_1; - - & > i:first-child { - position: absolute; - display: block; - top: 100%; - left: 0; - width: 0; - height: 0; - border: 5px solid transparent; - border-top-color: @handle_color_1; - } - - &.state_hover, - &:hover { - background-color: @handle_color_3; - - & > i:first-child { - border-top-color: @handle_color_3; - } - } - } - - .@{name}-min, - .@{name}-max { - color: @minmax_text_color; - font-size: 14px; - line-height: 1; - top: 0; - padding: 3px 4px; - opacity: 0.4; - background-color: @minmax_bg_color; - border-radius: @line_height; - } - - .@{name}-from, - .@{name}-to, - .@{name}-single { - font-size: 14px; - line-height: 1; - text-shadow: none; - padding: 3px 4px; - background-color: @label_color_1; - color: @label_color_2; - border-radius: @line_height; - - &:before { - position: absolute; - display: block; - content: ""; - bottom: -6px; - left: 50%; - width: 0; - height: 0; - margin-left: -3px; - overflow: hidden; - border: 3px solid transparent; - border-top-color: @label_color_1; - } - } - - .@{name}-grid { - height: 25px; - - &-pol { - background-color: @grid_color_1; - } - - &-text { - color: @grid_color_2; - font-size: 13px; - } - } -} diff --git a/plugins/ion-rangeslider/less/skins/square.less b/plugins/ion-rangeslider/less/skins/square.less deleted file mode 100644 index 957f957be..000000000 --- a/plugins/ion-rangeslider/less/skins/square.less +++ /dev/null @@ -1,100 +0,0 @@ -// Skin design by Veaceslav Grimalschi -// https://github.com/grimalschi - -.irs--square { - @name: irs; - - @top: 31px; - @bottom: 21px; - @line_height: 4px; - @handle_width: 16px; - @handle_height: 16px; - - @line_color: #dedede; - @bar_color: black; - @handle_color_1: black; - @handle_color_2: white; - @handle_color_3: #f0f6ff; - @minmax_text_color: #333; - @minmax_bg_color: rgba(0,0,0,0.1); - @label_color_1: black; - @label_color_2: white; - @grid_color_1: #dedede; - @grid_color_2: silver; - - - - height: 50px; - - &.irs-with-grid { - height: 60px; - } - - .@{name}-line { - top: @top; - height: @line_height; - background-color: @line_color; - } - - .@{name}-bar { - top: @top; - height: @line_height; - background-color: @bar_color; - } - - .@{name}-shadow { - height: 2px; - bottom: @bottom; - background-color: @line_color; - } - - .@{name}-handle { - top: (@top - 6px); - width: @handle_width; - height: @handle_height; - border: 3px solid @handle_color_1; - background-color: @handle_color_2; - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); - transform: rotate(45deg); - - &.state_hover, - &:hover { - background-color: @handle_color_3; - } - } - - .@{name}-min, - .@{name}-max { - color: @minmax_text_color; - font-size: 14px; - line-height: 1; - top: 0; - padding: 3px 5px; - background-color: @minmax_bg_color; - } - - .@{name}-from, - .@{name}-to, - .@{name}-single { - font-size: 14px; - line-height: 1; - text-shadow: none; - padding: 3px 5px; - background-color: @label_color_1; - color: @label_color_2; - } - - .@{name}-grid { - height: 25px; - - &-pol { - background-color: @grid_color_1; - } - - &-text { - color: @grid_color_2; - font-size: 11px; - } - } -} diff --git a/plugins/jsgrid/demos/basic.html b/plugins/jsgrid/demos/basic.html deleted file mode 100755 index 023d2a617..000000000 --- a/plugins/jsgrid/demos/basic.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - jsGrid - Basic Scenario - - - - - - - - - - - - - - - - - - - - - -

Basic Scenario

-
- - - - diff --git a/plugins/jsgrid/demos/batch-delete.html b/plugins/jsgrid/demos/batch-delete.html deleted file mode 100755 index c2adf2d18..000000000 --- a/plugins/jsgrid/demos/batch-delete.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - jsGrid - Batch Delete - - - - - - - - - - - - - - - - - - - -

Batch Delete

- -
- - - - diff --git a/plugins/jsgrid/demos/custom-grid-field.html b/plugins/jsgrid/demos/custom-grid-field.html deleted file mode 100755 index de1bda204..000000000 --- a/plugins/jsgrid/demos/custom-grid-field.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - jsGrid - Custom Grid Field Scenario - - - - - - - - - - - - - - - - - - - - - - - -

Custom Grid DateField

-
- - - - diff --git a/plugins/jsgrid/demos/custom-load-indicator.html b/plugins/jsgrid/demos/custom-load-indicator.html deleted file mode 100755 index 637517017..000000000 --- a/plugins/jsgrid/demos/custom-load-indicator.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - jsGrid - Custom Load Indicator - - - - - - - - - - - - - - - - - - - - - -

Custom Load Indicator

-
- - - - diff --git a/plugins/jsgrid/demos/custom-row-renderer.html b/plugins/jsgrid/demos/custom-row-renderer.html deleted file mode 100755 index 7c8153b1b..000000000 --- a/plugins/jsgrid/demos/custom-row-renderer.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - jsGrid - Custom Row Renderer - - - - - - - - - - - - - - - - - -

Custom Row Renderer

-
- - - - diff --git a/plugins/jsgrid/demos/custom-view.html b/plugins/jsgrid/demos/custom-view.html deleted file mode 100755 index a68354fae..000000000 --- a/plugins/jsgrid/demos/custom-view.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - jsGrid - Custom View Scenario - - - - - - - - - - - - - - - - - - - - - - - -

Custom View

-
- - - - - - - -
- -
- - - - diff --git a/plugins/jsgrid/demos/data-manipulation.html b/plugins/jsgrid/demos/data-manipulation.html deleted file mode 100755 index 700e1a553..000000000 --- a/plugins/jsgrid/demos/data-manipulation.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - jsGrid - Data Manipulation - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Manipulation

-
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
-
- - - - diff --git a/plugins/jsgrid/demos/db.js b/plugins/jsgrid/demos/db.js deleted file mode 100644 index 07ef1eef7..000000000 --- a/plugins/jsgrid/demos/db.js +++ /dev/null @@ -1,884 +0,0 @@ -(function() { - - var db = { - - loadData: function(filter) { - return $.grep(this.clients, function(client) { - return (!filter.Name || client.Name.indexOf(filter.Name) > -1) - && (filter.Age === undefined || client.Age === filter.Age) - && (!filter.Address || client.Address.indexOf(filter.Address) > -1) - && (!filter.Country || client.Country === filter.Country) - && (filter.Married === undefined || client.Married === filter.Married); - }); - }, - - insertItem: function(insertingClient) { - this.clients.push(insertingClient); - }, - - updateItem: function(updatingClient) { }, - - deleteItem: function(deletingClient) { - var clientIndex = $.inArray(deletingClient, this.clients); - this.clients.splice(clientIndex, 1); - } - - }; - - window.db = db; - - - db.countries = [ - { Name: "", Id: 0 }, - { Name: "United States", Id: 1 }, - { Name: "Canada", Id: 2 }, - { Name: "United Kingdom", Id: 3 }, - { Name: "France", Id: 4 }, - { Name: "Brazil", Id: 5 }, - { Name: "China", Id: 6 }, - { Name: "Russia", Id: 7 } - ]; - - db.clients = [ - { - "Name": "Otto Clay", - "Age": 61, - "Country": 6, - "Address": "Ap #897-1459 Quam Avenue", - "Married": false - }, - { - "Name": "Connor Johnston", - "Age": 73, - "Country": 7, - "Address": "Ap #370-4647 Dis Av.", - "Married": false - }, - { - "Name": "Lacey Hess", - "Age": 29, - "Country": 7, - "Address": "Ap #365-8835 Integer St.", - "Married": false - }, - { - "Name": "Timothy Henson", - "Age": 78, - "Country": 1, - "Address": "911-5143 Luctus Ave", - "Married": false - }, - { - "Name": "Ramona Benton", - "Age": 43, - "Country": 5, - "Address": "Ap #614-689 Vehicula Street", - "Married": true - }, - { - "Name": "Ezra Tillman", - "Age": 51, - "Country": 1, - "Address": "P.O. Box 738, 7583 Quisque St.", - "Married": true - }, - { - "Name": "Dante Carter", - "Age": 59, - "Country": 1, - "Address": "P.O. Box 976, 6316 Lorem, St.", - "Married": false - }, - { - "Name": "Christopher Mcclure", - "Age": 58, - "Country": 1, - "Address": "847-4303 Dictum Av.", - "Married": true - }, - { - "Name": "Ruby Rocha", - "Age": 62, - "Country": 2, - "Address": "5212 Sagittis Ave", - "Married": false - }, - { - "Name": "Imelda Hardin", - "Age": 39, - "Country": 5, - "Address": "719-7009 Auctor Av.", - "Married": false - }, - { - "Name": "Jonah Johns", - "Age": 28, - "Country": 5, - "Address": "P.O. Box 939, 9310 A Ave", - "Married": false - }, - { - "Name": "Herman Rosa", - "Age": 49, - "Country": 7, - "Address": "718-7162 Molestie Av.", - "Married": true - }, - { - "Name": "Arthur Gay", - "Age": 20, - "Country": 7, - "Address": "5497 Neque Street", - "Married": false - }, - { - "Name": "Xena Wilkerson", - "Age": 63, - "Country": 1, - "Address": "Ap #303-6974 Proin Street", - "Married": true - }, - { - "Name": "Lilah Atkins", - "Age": 33, - "Country": 5, - "Address": "622-8602 Gravida Ave", - "Married": true - }, - { - "Name": "Malik Shepard", - "Age": 59, - "Country": 1, - "Address": "967-5176 Tincidunt Av.", - "Married": false - }, - { - "Name": "Keely Silva", - "Age": 24, - "Country": 1, - "Address": "P.O. Box 153, 8995 Praesent Ave", - "Married": false - }, - { - "Name": "Hunter Pate", - "Age": 73, - "Country": 7, - "Address": "P.O. Box 771, 7599 Ante, Road", - "Married": false - }, - { - "Name": "Mikayla Roach", - "Age": 55, - "Country": 5, - "Address": "Ap #438-9886 Donec Rd.", - "Married": true - }, - { - "Name": "Upton Joseph", - "Age": 48, - "Country": 4, - "Address": "Ap #896-7592 Habitant St.", - "Married": true - }, - { - "Name": "Jeanette Pate", - "Age": 59, - "Country": 2, - "Address": "P.O. Box 177, 7584 Amet, St.", - "Married": false - }, - { - "Name": "Kaden Hernandez", - "Age": 79, - "Country": 3, - "Address": "366 Ut St.", - "Married": true - }, - { - "Name": "Kenyon Stevens", - "Age": 20, - "Country": 3, - "Address": "P.O. Box 704, 4580 Gravida Rd.", - "Married": false - }, - { - "Name": "Jerome Harper", - "Age": 31, - "Country": 5, - "Address": "2464 Porttitor Road", - "Married": false - }, - { - "Name": "Jelani Patel", - "Age": 36, - "Country": 2, - "Address": "P.O. Box 541, 5805 Nec Av.", - "Married": true - }, - { - "Name": "Keaton Oconnor", - "Age": 21, - "Country": 1, - "Address": "Ap #657-1093 Nec, Street", - "Married": false - }, - { - "Name": "Bree Johnston", - "Age": 31, - "Country": 2, - "Address": "372-5942 Vulputate Avenue", - "Married": false - }, - { - "Name": "Maisie Hodges", - "Age": 70, - "Country": 7, - "Address": "P.O. Box 445, 3880 Odio, Rd.", - "Married": false - }, - { - "Name": "Kuame Calhoun", - "Age": 39, - "Country": 2, - "Address": "P.O. Box 609, 4105 Rutrum St.", - "Married": true - }, - { - "Name": "Carlos Cameron", - "Age": 38, - "Country": 5, - "Address": "Ap #215-5386 A, Avenue", - "Married": false - }, - { - "Name": "Fulton Parsons", - "Age": 25, - "Country": 7, - "Address": "P.O. Box 523, 3705 Sed Rd.", - "Married": false - }, - { - "Name": "Wallace Christian", - "Age": 43, - "Country": 3, - "Address": "416-8816 Mauris Avenue", - "Married": true - }, - { - "Name": "Caryn Maldonado", - "Age": 40, - "Country": 1, - "Address": "108-282 Nonummy Ave", - "Married": false - }, - { - "Name": "Whilemina Frank", - "Age": 20, - "Country": 7, - "Address": "P.O. Box 681, 3938 Egestas. Av.", - "Married": true - }, - { - "Name": "Emery Moon", - "Age": 41, - "Country": 4, - "Address": "Ap #717-8556 Non Road", - "Married": true - }, - { - "Name": "Price Watkins", - "Age": 35, - "Country": 4, - "Address": "832-7810 Nunc Rd.", - "Married": false - }, - { - "Name": "Lydia Castillo", - "Age": 59, - "Country": 7, - "Address": "5280 Placerat, Ave", - "Married": true - }, - { - "Name": "Lawrence Conway", - "Age": 53, - "Country": 1, - "Address": "Ap #452-2808 Imperdiet St.", - "Married": false - }, - { - "Name": "Kalia Nicholson", - "Age": 67, - "Country": 5, - "Address": "P.O. Box 871, 3023 Tellus Road", - "Married": true - }, - { - "Name": "Brielle Baxter", - "Age": 45, - "Country": 3, - "Address": "Ap #822-9526 Ut, Road", - "Married": true - }, - { - "Name": "Valentine Brady", - "Age": 72, - "Country": 7, - "Address": "8014 Enim. Road", - "Married": true - }, - { - "Name": "Rebecca Gardner", - "Age": 57, - "Country": 4, - "Address": "8655 Arcu. Road", - "Married": true - }, - { - "Name": "Vladimir Tate", - "Age": 26, - "Country": 1, - "Address": "130-1291 Non, Rd.", - "Married": true - }, - { - "Name": "Vernon Hays", - "Age": 56, - "Country": 4, - "Address": "964-5552 In Rd.", - "Married": true - }, - { - "Name": "Allegra Hull", - "Age": 22, - "Country": 4, - "Address": "245-8891 Donec St.", - "Married": true - }, - { - "Name": "Hu Hendrix", - "Age": 65, - "Country": 7, - "Address": "428-5404 Tempus Ave", - "Married": true - }, - { - "Name": "Kenyon Battle", - "Age": 32, - "Country": 2, - "Address": "921-6804 Lectus St.", - "Married": false - }, - { - "Name": "Gloria Nielsen", - "Age": 24, - "Country": 4, - "Address": "Ap #275-4345 Lorem, Street", - "Married": true - }, - { - "Name": "Illiana Kidd", - "Age": 59, - "Country": 2, - "Address": "7618 Lacus. Av.", - "Married": false - }, - { - "Name": "Adria Todd", - "Age": 68, - "Country": 6, - "Address": "1889 Tincidunt Road", - "Married": false - }, - { - "Name": "Kirsten Mayo", - "Age": 71, - "Country": 1, - "Address": "100-8640 Orci, Avenue", - "Married": false - }, - { - "Name": "Willa Hobbs", - "Age": 60, - "Country": 6, - "Address": "P.O. Box 323, 158 Tristique St.", - "Married": false - }, - { - "Name": "Alexis Clements", - "Age": 69, - "Country": 5, - "Address": "P.O. Box 176, 5107 Proin Rd.", - "Married": false - }, - { - "Name": "Akeem Conrad", - "Age": 60, - "Country": 2, - "Address": "282-495 Sed Ave", - "Married": true - }, - { - "Name": "Montana Silva", - "Age": 79, - "Country": 6, - "Address": "P.O. Box 120, 9766 Consectetuer St.", - "Married": false - }, - { - "Name": "Kaseem Hensley", - "Age": 77, - "Country": 6, - "Address": "Ap #510-8903 Mauris. Av.", - "Married": true - }, - { - "Name": "Christopher Morton", - "Age": 35, - "Country": 5, - "Address": "P.O. Box 234, 3651 Sodales Avenue", - "Married": false - }, - { - "Name": "Wade Fernandez", - "Age": 49, - "Country": 6, - "Address": "740-5059 Dolor. Road", - "Married": true - }, - { - "Name": "Illiana Kirby", - "Age": 31, - "Country": 2, - "Address": "527-3553 Mi Ave", - "Married": false - }, - { - "Name": "Kimberley Hurley", - "Age": 65, - "Country": 5, - "Address": "P.O. Box 637, 9915 Dictum St.", - "Married": false - }, - { - "Name": "Arthur Olsen", - "Age": 74, - "Country": 5, - "Address": "887-5080 Eget St.", - "Married": false - }, - { - "Name": "Brody Potts", - "Age": 59, - "Country": 2, - "Address": "Ap #577-7690 Sem Road", - "Married": false - }, - { - "Name": "Dillon Ford", - "Age": 60, - "Country": 1, - "Address": "Ap #885-9289 A, Av.", - "Married": true - }, - { - "Name": "Hannah Juarez", - "Age": 61, - "Country": 2, - "Address": "4744 Sapien, Rd.", - "Married": true - }, - { - "Name": "Vincent Shaffer", - "Age": 25, - "Country": 2, - "Address": "9203 Nunc St.", - "Married": true - }, - { - "Name": "George Holt", - "Age": 27, - "Country": 6, - "Address": "4162 Cras Rd.", - "Married": false - }, - { - "Name": "Tobias Bartlett", - "Age": 74, - "Country": 4, - "Address": "792-6145 Mauris St.", - "Married": true - }, - { - "Name": "Xavier Hooper", - "Age": 35, - "Country": 1, - "Address": "879-5026 Interdum. Rd.", - "Married": false - }, - { - "Name": "Declan Dorsey", - "Age": 31, - "Country": 2, - "Address": "Ap #926-4171 Aenean Road", - "Married": true - }, - { - "Name": "Clementine Tran", - "Age": 43, - "Country": 4, - "Address": "P.O. Box 176, 9865 Eu Rd.", - "Married": true - }, - { - "Name": "Pamela Moody", - "Age": 55, - "Country": 6, - "Address": "622-6233 Luctus Rd.", - "Married": true - }, - { - "Name": "Julie Leon", - "Age": 43, - "Country": 6, - "Address": "Ap #915-6782 Sem Av.", - "Married": true - }, - { - "Name": "Shana Nolan", - "Age": 79, - "Country": 5, - "Address": "P.O. Box 603, 899 Eu St.", - "Married": false - }, - { - "Name": "Vaughan Moody", - "Age": 37, - "Country": 5, - "Address": "880 Erat Rd.", - "Married": false - }, - { - "Name": "Randall Reeves", - "Age": 44, - "Country": 3, - "Address": "1819 Non Street", - "Married": false - }, - { - "Name": "Dominic Raymond", - "Age": 68, - "Country": 1, - "Address": "Ap #689-4874 Nisi Rd.", - "Married": true - }, - { - "Name": "Lev Pugh", - "Age": 69, - "Country": 5, - "Address": "Ap #433-6844 Auctor Avenue", - "Married": true - }, - { - "Name": "Desiree Hughes", - "Age": 80, - "Country": 4, - "Address": "605-6645 Fermentum Avenue", - "Married": true - }, - { - "Name": "Idona Oneill", - "Age": 23, - "Country": 7, - "Address": "751-8148 Aliquam Avenue", - "Married": true - }, - { - "Name": "Lani Mayo", - "Age": 76, - "Country": 1, - "Address": "635-2704 Tristique St.", - "Married": true - }, - { - "Name": "Cathleen Bonner", - "Age": 40, - "Country": 1, - "Address": "916-2910 Dolor Av.", - "Married": false - }, - { - "Name": "Sydney Murray", - "Age": 44, - "Country": 5, - "Address": "835-2330 Fringilla St.", - "Married": false - }, - { - "Name": "Brenna Rodriguez", - "Age": 77, - "Country": 6, - "Address": "3687 Imperdiet Av.", - "Married": true - }, - { - "Name": "Alfreda Mcdaniel", - "Age": 38, - "Country": 7, - "Address": "745-8221 Aliquet Rd.", - "Married": true - }, - { - "Name": "Zachery Atkins", - "Age": 30, - "Country": 1, - "Address": "549-2208 Auctor. Road", - "Married": true - }, - { - "Name": "Amelia Rich", - "Age": 56, - "Country": 4, - "Address": "P.O. Box 734, 4717 Nunc Rd.", - "Married": false - }, - { - "Name": "Kiayada Witt", - "Age": 62, - "Country": 3, - "Address": "Ap #735-3421 Malesuada Avenue", - "Married": false - }, - { - "Name": "Lysandra Pierce", - "Age": 36, - "Country": 1, - "Address": "Ap #146-2835 Curabitur St.", - "Married": true - }, - { - "Name": "Cara Rios", - "Age": 58, - "Country": 4, - "Address": "Ap #562-7811 Quam. Ave", - "Married": true - }, - { - "Name": "Austin Andrews", - "Age": 55, - "Country": 7, - "Address": "P.O. Box 274, 5505 Sociis Rd.", - "Married": false - }, - { - "Name": "Lillian Peterson", - "Age": 39, - "Country": 2, - "Address": "6212 A Avenue", - "Married": false - }, - { - "Name": "Adria Beach", - "Age": 29, - "Country": 2, - "Address": "P.O. Box 183, 2717 Nunc Avenue", - "Married": true - }, - { - "Name": "Oleg Durham", - "Age": 80, - "Country": 4, - "Address": "931-3208 Nunc Rd.", - "Married": false - }, - { - "Name": "Casey Reese", - "Age": 60, - "Country": 4, - "Address": "383-3675 Ultrices, St.", - "Married": false - }, - { - "Name": "Kane Burnett", - "Age": 80, - "Country": 1, - "Address": "759-8212 Dolor. Ave", - "Married": false - }, - { - "Name": "Stewart Wilson", - "Age": 46, - "Country": 7, - "Address": "718-7845 Sagittis. Av.", - "Married": false - }, - { - "Name": "Charity Holcomb", - "Age": 31, - "Country": 6, - "Address": "641-7892 Enim. Ave", - "Married": false - }, - { - "Name": "Kyra Cummings", - "Age": 43, - "Country": 4, - "Address": "P.O. Box 702, 6621 Mus. Av.", - "Married": false - }, - { - "Name": "Stuart Wallace", - "Age": 25, - "Country": 7, - "Address": "648-4990 Sed Rd.", - "Married": true - }, - { - "Name": "Carter Clarke", - "Age": 59, - "Country": 6, - "Address": "Ap #547-2921 A Street", - "Married": false - } - ]; - - db.users = [ - { - "ID": "x", - "Account": "A758A693-0302-03D1-AE53-EEFE22855556", - "Name": "Carson Kelley", - "RegisterDate": "2002-04-20T22:55:52-07:00" - }, - { - "Account": "D89FF524-1233-0CE7-C9E1-56EFF017A321", - "Name": "Prescott Griffin", - "RegisterDate": "2011-02-22T05:59:55-08:00" - }, - { - "Account": "06FAAD9A-5114-08F6-D60C-961B2528B4F0", - "Name": "Amir Saunders", - "RegisterDate": "2014-08-13T09:17:49-07:00" - }, - { - "Account": "EED7653D-7DD9-A722-64A8-36A55ECDBE77", - "Name": "Derek Thornton", - "RegisterDate": "2012-02-27T01:31:07-08:00" - }, - { - "Account": "2A2E6D40-FEBD-C643-A751-9AB4CAF1E2F6", - "Name": "Fletcher Romero", - "RegisterDate": "2010-06-25T15:49:54-07:00" - }, - { - "Account": "3978F8FA-DFF0-DA0E-0A5D-EB9D281A3286", - "Name": "Thaddeus Stein", - "RegisterDate": "2013-11-10T07:29:41-08:00" - }, - { - "Account": "658DBF5A-176E-569A-9273-74FB5F69FA42", - "Name": "Nash Knapp", - "RegisterDate": "2005-06-24T09:11:19-07:00" - }, - { - "Account": "76D2EE4B-7A73-1212-F6F2-957EF8C1F907", - "Name": "Quamar Vega", - "RegisterDate": "2011-04-13T20:06:29-07:00" - }, - { - "Account": "00E46809-A595-CE82-C5B4-D1CAEB7E3E58", - "Name": "Philip Galloway", - "RegisterDate": "2008-08-21T18:59:38-07:00" - }, - { - "Account": "C196781C-DDCC-AF83-DDC2-CA3E851A47A0", - "Name": "Mason French", - "RegisterDate": "2000-11-15T00:38:37-08:00" - }, - { - "Account": "5911F201-818A-B393-5888-13157CE0D63F", - "Name": "Ross Cortez", - "RegisterDate": "2010-05-27T17:35:32-07:00" - }, - { - "Account": "B8BB78F9-E1A1-A956-086F-E12B6FE168B6", - "Name": "Logan King", - "RegisterDate": "2003-07-08T16:58:06-07:00" - }, - { - "Account": "06F636C3-9599-1A2D-5FD5-86B24ADDE626", - "Name": "Cedric Leblanc", - "RegisterDate": "2011-06-30T14:30:10-07:00" - }, - { - "Account": "FE880CDD-F6E7-75CB-743C-64C6DE192412", - "Name": "Simon Sullivan", - "RegisterDate": "2013-06-11T16:35:07-07:00" - }, - { - "Account": "BBEDD673-E2C1-4872-A5D3-C4EBD4BE0A12", - "Name": "Jamal West", - "RegisterDate": "2001-03-16T20:18:29-08:00" - }, - { - "Account": "19BC22FA-C52E-0CC6-9552-10365C755FAC", - "Name": "Hector Morales", - "RegisterDate": "2012-11-01T01:56:34-07:00" - }, - { - "Account": "A8292214-2C13-5989-3419-6B83DD637D6C", - "Name": "Herrod Hart", - "RegisterDate": "2008-03-13T19:21:04-07:00" - }, - { - "Account": "0285564B-F447-0E7F-EAA1-7FB8F9C453C8", - "Name": "Clark Maxwell", - "RegisterDate": "2004-08-05T08:22:24-07:00" - }, - { - "Account": "EA78F076-4F6E-4228-268C-1F51272498AE", - "Name": "Reuben Walter", - "RegisterDate": "2011-01-23T01:55:59-08:00" - }, - { - "Account": "6A88C194-EA21-426F-4FE2-F2AE33F51793", - "Name": "Ira Ingram", - "RegisterDate": "2008-08-15T05:57:46-07:00" - }, - { - "Account": "4275E873-439C-AD26-56B3-8715E336508E", - "Name": "Damian Morrow", - "RegisterDate": "2015-09-13T01:50:55-07:00" - }, - { - "Account": "A0D733C4-9070-B8D6-4387-D44F0BA515BE", - "Name": "Macon Farrell", - "RegisterDate": "2011-03-14T05:41:40-07:00" - }, - { - "Account": "B3683DE8-C2FA-7CA0-A8A6-8FA7E954F90A", - "Name": "Joel Galloway", - "RegisterDate": "2003-02-03T04:19:01-08:00" - }, - { - "Account": "01D95A8E-91BC-2050-F5D0-4437AAFFD11F", - "Name": "Rigel Horton", - "RegisterDate": "2015-06-20T11:53:11-07:00" - }, - { - "Account": "F0D12CC0-31AC-A82E-FD73-EEEFDBD21A36", - "Name": "Sylvester Gaines", - "RegisterDate": "2004-03-12T09:57:13-08:00" - }, - { - "Account": "874FCC49-9A61-71BC-2F4E-2CE88348AD7B", - "Name": "Abbot Mckay", - "RegisterDate": "2008-12-26T20:42:57-08:00" - }, - { - "Account": "B8DA1912-20A0-FB6E-0031-5F88FD63EF90", - "Name": "Solomon Green", - "RegisterDate": "2013-09-04T01:44:47-07:00" - } - ]; - -}()); \ No newline at end of file diff --git a/plugins/jsgrid/demos/demos.css b/plugins/jsgrid/demos/demos.css deleted file mode 100644 index d1f0ca28e..000000000 --- a/plugins/jsgrid/demos/demos.css +++ /dev/null @@ -1,82 +0,0 @@ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -html { - height: 100%; -} - -body { - height: 100%; - padding: 10px; - color: #262626; - font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica; - font-size: 14px; - font-weight: 300; -} - -h1 { - margin: 0 0 8px 0; - font-size: 24px; - font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica; - font-weight: 300; -} - -h2 { - margin: 16px 0 8px 0; - font-size: 18px; - font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica; - font-weight: 300; -} - -ul { - list-style: none; -} - -a { - color: #2ba6cb; - text-decoration: none; -} - -a:hover { - text-decoration: underline; - color: #258faf; -} - -input, button, select { - font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica; - font-weight: 300; - font-size: 14px; - padding: 2px; -} - -.navigation { - width: 200px; - position: absolute; - top: 0; - bottom: 0; - left: 0; - padding: 10px; - border-right: 1px solid #e9e9e9; -} - -.navigation li { - margin: 10px 0; -} - -.demo-frame { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 200px; -} - -iframe[name='demo'] { - display: block; - width: 100%; - height: 100%; - border: none; -} \ No newline at end of file diff --git a/plugins/jsgrid/demos/external-pager.html b/plugins/jsgrid/demos/external-pager.html deleted file mode 100755 index 94b8f99ff..000000000 --- a/plugins/jsgrid/demos/external-pager.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - jsGrid - External Pager Scenario - - - - - - - - - - - - - - - - - - - - - - -

External Customized Pager

-
- -
- - - - diff --git a/plugins/jsgrid/demos/index.html b/plugins/jsgrid/demos/index.html deleted file mode 100644 index eb5949cd4..000000000 --- a/plugins/jsgrid/demos/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - jsGrid - Simple jQuery DataGrid - Demos - - - - - -
- -
- - \ No newline at end of file diff --git a/plugins/jsgrid/demos/loading-by-page.html b/plugins/jsgrid/demos/loading-by-page.html deleted file mode 100755 index f70af2b3a..000000000 --- a/plugins/jsgrid/demos/loading-by-page.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - jsGrid - Loading Data by Page Scenario - - - - - - - - - - - - - - - - - - - - - - -

Loading Data by Page

-
- -
- -
- - - - diff --git a/plugins/jsgrid/demos/localization.html b/plugins/jsgrid/demos/localization.html deleted file mode 100755 index 4591af0be..000000000 --- a/plugins/jsgrid/demos/localization.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - jsGrid - Localization (FR) - - - - - - - - - - - - - - - - - - - - - - - -

Localization (FR)

-
- - - - diff --git a/plugins/jsgrid/demos/odata-service.html b/plugins/jsgrid/demos/odata-service.html deleted file mode 100755 index c5182bd0f..000000000 --- a/plugins/jsgrid/demos/odata-service.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - jsGrid - OData Service Scenario - - - - - - - - - - - - - - - - - - - - -

OData Service

-
- - - - diff --git a/plugins/jsgrid/demos/rows-reordering.html b/plugins/jsgrid/demos/rows-reordering.html deleted file mode 100644 index 9f098d506..000000000 --- a/plugins/jsgrid/demos/rows-reordering.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - jsGrid - Rows Reordering Scenario - - - - - - - - - - - - - - - - - - - - - - - -

Rows Reordering Scenario

-
- - - - diff --git a/plugins/jsgrid/demos/sorting.html b/plugins/jsgrid/demos/sorting.html deleted file mode 100755 index 67cfb2640..000000000 --- a/plugins/jsgrid/demos/sorting.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - jsGrid - Sorting Scenario - - - - - - - - - - - - - - - - - - - - - - -

Sorting

-
- -
- -
- - - - diff --git a/plugins/jsgrid/demos/static-data.html b/plugins/jsgrid/demos/static-data.html deleted file mode 100755 index 892292701..000000000 --- a/plugins/jsgrid/demos/static-data.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - jsGrid - Static Data Scenario - - - - - - - - - - - - - - - - - - - - -

Static Data

-
- - - - diff --git a/plugins/jsgrid/demos/validation.html b/plugins/jsgrid/demos/validation.html deleted file mode 100755 index 916195f4d..000000000 --- a/plugins/jsgrid/demos/validation.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - jsGrid - Validation - - - - - - - - - - - - - - - - - - - - - - -

Validation

-
- - - - diff --git a/plugins/raphael/bower.json b/plugins/raphael/bower.json deleted file mode 100644 index b7572b7f0..000000000 --- a/plugins/raphael/bower.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "raphael", - "main": "raphael.js", - "description": "JavaScript Vector Library", - "dependencies": { - "eve-raphael": "0.5.0" - }, - "devDependencies": { - "requirejs": "2.3.2" - }, - "moduleType": [ - "amd", - "globals" - ], - "keywords": ["svg", "vml", "javascript"], - "authors": [ - "Dmitry Baranovskiy" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "*.html", - "*.json", - "*.markdown", - "*.md", - "copy.js", - "Gruntfile.js", - "reference.js" - ] -} diff --git a/plugins/raphael/dev/banner.txt b/plugins/raphael/dev/banner.txt deleted file mode 100644 index 0c20a214b..000000000 --- a/plugins/raphael/dev/banner.txt +++ /dev/null @@ -1,8 +0,0 @@ -// ┌───────────────────────────────────────────────────────────────────────────────────────────────────────┐ \\ -// │ Raphaël 2.3.0 - JavaScript Vector Library │ \\ -// ├───────────────────────────────────────────────────────────────────────────────────────────────────────┤ \\ -// │ Copyright © 2008-2016 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ -// │ Copyright © 2008-2016 Sencha Labs (http://sencha.com) │ \\ -// ├───────────────────────────────────────────────────────────────────────────────────────────────────────┤ \\ -// │ Licensed under the MIT (https://github.com/DmitryBaranovskiy/raphael/blob/master/license.txt) license.│ \\ -// └───────────────────────────────────────────────────────────────────────────────────────────────────────┘ \\ diff --git a/plugins/raphael/dev/raphael.amd.js b/plugins/raphael/dev/raphael.amd.js deleted file mode 100644 index 50cdf07f9..000000000 --- a/plugins/raphael/dev/raphael.amd.js +++ /dev/null @@ -1,5 +0,0 @@ -define(["./raphael.core", "./raphael.svg", "./raphael.vml"], function(R) { - - return R; - -}); \ No newline at end of file diff --git a/plugins/raphael/dev/raphael.core.js b/plugins/raphael/dev/raphael.core.js deleted file mode 100644 index 68e1054a7..000000000 --- a/plugins/raphael/dev/raphael.core.js +++ /dev/null @@ -1,5416 +0,0 @@ -define(["eve"], function(eve) { - - /*\ - * Raphael - [ method ] - ** - * Creates a canvas object on which to draw. - * You must do this first, as all future calls to drawing methods - * from this instance will be bound to this canvas. - > Parameters - ** - - container (HTMLElement|string) DOM element or its ID which is going to be a parent for drawing surface - - width (number) - - height (number) - - callback (function) #optional callback function which is going to be executed in the context of newly created paper - * or - - x (number) - - y (number) - - width (number) - - height (number) - - callback (function) #optional callback function which is going to be executed in the context of newly created paper - * or - - all (array) (first 3 or 4 elements in the array are equal to [containerID, width, height] or [x, y, width, height]. The rest are element descriptions in format {type: type, }). See @Paper.add. - - callback (function) #optional callback function which is going to be executed in the context of newly created paper - * or - - onReadyCallback (function) function that is going to be called on DOM ready event. You can also subscribe to this event via Eve’s “DOMLoad” event. In this case method returns `undefined`. - = (object) @Paper - > Usage - | // Each of the following examples create a canvas - | // that is 320px wide by 200px high. - | // Canvas is created at the viewport’s 10,50 coordinate. - | var paper = Raphael(10, 50, 320, 200); - | // Canvas is created at the top left corner of the #notepad element - | // (or its top right corner in dir="rtl" elements) - | var paper = Raphael(document.getElementById("notepad"), 320, 200); - | // Same as above - | var paper = Raphael("notepad", 320, 200); - | // Image dump - | var set = Raphael(["notepad", 320, 200, { - | type: "rect", - | x: 10, - | y: 10, - | width: 25, - | height: 25, - | stroke: "#f00" - | }, { - | type: "text", - | x: 30, - | y: 40, - | text: "Dump" - | }]); - \*/ - function R(first) { - if (R.is(first, "function")) { - return loaded ? first() : eve.on("raphael.DOMload", first); - } else if (R.is(first, array)) { - return R._engine.create[apply](R, first.splice(0, 3 + R.is(first[0], nu))).add(first); - } else { - var args = Array.prototype.slice.call(arguments, 0); - if (R.is(args[args.length - 1], "function")) { - var f = args.pop(); - return loaded ? f.call(R._engine.create[apply](R, args)) : eve.on("raphael.DOMload", function () { - f.call(R._engine.create[apply](R, args)); - }); - } else { - return R._engine.create[apply](R, arguments); - } - } - } - R.version = "2.3.0"; - R.eve = eve; - var loaded, - separator = /[, ]+/, - elements = {circle: 1, rect: 1, path: 1, ellipse: 1, text: 1, image: 1}, - formatrg = /\{(\d+)\}/g, - proto = "prototype", - has = "hasOwnProperty", - g = { - doc: document, - win: window - }, - oldRaphael = { - was: Object.prototype[has].call(g.win, "Raphael"), - is: g.win.Raphael - }, - Paper = function () { - /*\ - * Paper.ca - [ property (object) ] - ** - * Shortcut for @Paper.customAttributes - \*/ - /*\ - * Paper.customAttributes - [ property (object) ] - ** - * If you have a set of attributes that you would like to represent - * as a function of some number you can do it easily with custom attributes: - > Usage - | paper.customAttributes.hue = function (num) { - | num = num % 1; - | return {fill: "hsb(" + num + ", 0.75, 1)"}; - | }; - | // Custom attribute “hue” will change fill - | // to be given hue with fixed saturation and brightness. - | // Now you can use it like this: - | var c = paper.circle(10, 10, 10).attr({hue: .45}); - | // or even like this: - | c.animate({hue: 1}, 1e3); - | - | // You could also create custom attribute - | // with multiple parameters: - | paper.customAttributes.hsb = function (h, s, b) { - | return {fill: "hsb(" + [h, s, b].join(",") + ")"}; - | }; - | c.attr({hsb: "0.5 .8 1"}); - | c.animate({hsb: [1, 0, 0.5]}, 1e3); - \*/ - this.ca = this.customAttributes = {}; - }, - paperproto, - appendChild = "appendChild", - apply = "apply", - concat = "concat", - //taken from Modernizr touch test: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js#L40 - supportsTouch = ('ontouchstart' in window) || window.TouchEvent || window.DocumentTouch && document instanceof DocumentTouch, - E = "", - S = " ", - Str = String, - split = "split", - events = "click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[split](S), - touchMap = { - mousedown: "touchstart", - mousemove: "touchmove", - mouseup: "touchend" - }, - lowerCase = Str.prototype.toLowerCase, - math = Math, - mmax = math.max, - mmin = math.min, - abs = math.abs, - pow = math.pow, - PI = math.PI, - nu = "number", - string = "string", - array = "array", - toString = "toString", - fillString = "fill", - objectToString = Object.prototype.toString, - paper = {}, - push = "push", - ISURL = R._ISURL = /^url\(['"]?(.+?)['"]?\)$/i, - colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i, - isnan = {"NaN": 1, "Infinity": 1, "-Infinity": 1}, - bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/, - round = math.round, - setAttribute = "setAttribute", - toFloat = parseFloat, - toInt = parseInt, - upperCase = Str.prototype.toUpperCase, - availableAttrs = R._availableAttrs = { - "arrow-end": "none", - "arrow-start": "none", - blur: 0, - "clip-rect": "0 0 1e9 1e9", - cursor: "default", - cx: 0, - cy: 0, - fill: "#fff", - "fill-opacity": 1, - font: '10px "Arial"', - "font-family": '"Arial"', - "font-size": "10", - "font-style": "normal", - "font-weight": 400, - gradient: 0, - height: 0, - href: "http://raphaeljs.com/", - "letter-spacing": 0, - opacity: 1, - path: "M0,0", - r: 0, - rx: 0, - ry: 0, - src: "", - stroke: "#000", - "stroke-dasharray": "", - "stroke-linecap": "butt", - "stroke-linejoin": "butt", - "stroke-miterlimit": 0, - "stroke-opacity": 1, - "stroke-width": 1, - target: "_blank", - "text-anchor": "middle", - title: "Raphael", - transform: "", - width: 0, - x: 0, - y: 0, - "class": "" - }, - availableAnimAttrs = R._availableAnimAttrs = { - blur: nu, - "clip-rect": "csv", - cx: nu, - cy: nu, - fill: "colour", - "fill-opacity": nu, - "font-size": nu, - height: nu, - opacity: nu, - path: "path", - r: nu, - rx: nu, - ry: nu, - stroke: "colour", - "stroke-opacity": nu, - "stroke-width": nu, - transform: "transform", - width: nu, - x: nu, - y: nu - }, - whitespace = /[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]/g, - commaSpaces = /[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/, - hsrg = {hs: 1, rg: 1}, - p2s = /,?([achlmqrstvxz]),?/gi, - pathCommand = /([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig, - tCommand = /([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig, - pathValues = /(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/ig, - radial_gradient = R._radial_gradient = /^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/, - eldata = {}, - sortByKey = function (a, b) { - return a.key - b.key; - }, - sortByNumber = function (a, b) { - return toFloat(a) - toFloat(b); - }, - fun = function () {}, - pipe = function (x) { - return x; - }, - rectPath = R._rectPath = function (x, y, w, h, r) { - if (r) { - return [["M", x + r, y], ["l", w - r * 2, 0], ["a", r, r, 0, 0, 1, r, r], ["l", 0, h - r * 2], ["a", r, r, 0, 0, 1, -r, r], ["l", r * 2 - w, 0], ["a", r, r, 0, 0, 1, -r, -r], ["l", 0, r * 2 - h], ["a", r, r, 0, 0, 1, r, -r], ["z"]]; - } - return [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]]; - }, - ellipsePath = function (x, y, rx, ry) { - if (ry == null) { - ry = rx; - } - return [["M", x, y], ["m", 0, -ry], ["a", rx, ry, 0, 1, 1, 0, 2 * ry], ["a", rx, ry, 0, 1, 1, 0, -2 * ry], ["z"]]; - }, - getPath = R._getPath = { - path: function (el) { - return el.attr("path"); - }, - circle: function (el) { - var a = el.attrs; - return ellipsePath(a.cx, a.cy, a.r); - }, - ellipse: function (el) { - var a = el.attrs; - return ellipsePath(a.cx, a.cy, a.rx, a.ry); - }, - rect: function (el) { - var a = el.attrs; - return rectPath(a.x, a.y, a.width, a.height, a.r); - }, - image: function (el) { - var a = el.attrs; - return rectPath(a.x, a.y, a.width, a.height); - }, - text: function (el) { - var bbox = el._getBBox(); - return rectPath(bbox.x, bbox.y, bbox.width, bbox.height); - }, - set : function(el) { - var bbox = el._getBBox(); - return rectPath(bbox.x, bbox.y, bbox.width, bbox.height); - } - }, - /*\ - * Raphael.mapPath - [ method ] - ** - * Transform the path string with given matrix. - > Parameters - - path (string) path string - - matrix (object) see @Matrix - = (string) transformed path string - \*/ - mapPath = R.mapPath = function (path, matrix) { - if (!matrix) { - return path; - } - var x, y, i, j, ii, jj, pathi; - path = path2curve(path); - for (i = 0, ii = path.length; i < ii; i++) { - pathi = path[i]; - for (j = 1, jj = pathi.length; j < jj; j += 2) { - x = matrix.x(pathi[j], pathi[j + 1]); - y = matrix.y(pathi[j], pathi[j + 1]); - pathi[j] = x; - pathi[j + 1] = y; - } - } - return path; - }; - - R._g = g; - /*\ - * Raphael.type - [ property (string) ] - ** - * Can be “SVG”, “VML” or empty, depending on browser support. - \*/ - R.type = (g.win.SVGAngle || g.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") ? "SVG" : "VML"); - if (R.type == "VML") { - var d = g.doc.createElement("div"), - b; - d.innerHTML = ''; - b = d.firstChild; - b.style.behavior = "url(#default#VML)"; - if (!(b && typeof b.adj == "object")) { - return (R.type = E); - } - d = null; - } - /*\ - * Raphael.svg - [ property (boolean) ] - ** - * `true` if browser supports SVG. - \*/ - /*\ - * Raphael.vml - [ property (boolean) ] - ** - * `true` if browser supports VML. - \*/ - R.svg = !(R.vml = R.type == "VML"); - R._Paper = Paper; - /*\ - * Raphael.fn - [ property (object) ] - ** - * You can add your own method to the canvas. For example if you want to draw a pie chart, - * you can create your own pie chart function and ship it as a Raphaël plugin. To do this - * you need to extend the `Raphael.fn` object. You should modify the `fn` object before a - * Raphaël instance is created, otherwise it will take no effect. Please note that the - * ability for namespaced plugins was removed in Raphael 2.0. It is up to the plugin to - * ensure any namespacing ensures proper context. - > Usage - | Raphael.fn.arrow = function (x1, y1, x2, y2, size) { - | return this.path( ... ); - | }; - | // or create namespace - | Raphael.fn.mystuff = { - | arrow: function () {…}, - | star: function () {…}, - | // etc… - | }; - | var paper = Raphael(10, 10, 630, 480); - | // then use it - | paper.arrow(10, 10, 30, 30, 5).attr({fill: "#f00"}); - | paper.mystuff.arrow(); - | paper.mystuff.star(); - \*/ - R.fn = paperproto = Paper.prototype = R.prototype; - R._id = 0; - /*\ - * Raphael.is - [ method ] - ** - * Handful of replacements for `typeof` operator. - > Parameters - - o (…) any object or primitive - - type (string) name of the type, i.e. “string”, “function”, “number”, etc. - = (boolean) is given value is of given type - \*/ - R.is = function (o, type) { - type = lowerCase.call(type); - if (type == "finite") { - return !isnan[has](+o); - } - if (type == "array") { - return o instanceof Array; - } - return (type == "null" && o === null) || - (type == typeof o && o !== null) || - (type == "object" && o === Object(o)) || - (type == "array" && Array.isArray && Array.isArray(o)) || - objectToString.call(o).slice(8, -1).toLowerCase() == type; - }; - - function clone(obj) { - if (typeof obj == "function" || Object(obj) !== obj) { - return obj; - } - var res = new obj.constructor; - for (var key in obj) if (obj[has](key)) { - res[key] = clone(obj[key]); - } - return res; - } - - /*\ - * Raphael.angle - [ method ] - ** - * Returns angle between two or three points - > Parameters - - x1 (number) x coord of first point - - y1 (number) y coord of first point - - x2 (number) x coord of second point - - y2 (number) y coord of second point - - x3 (number) #optional x coord of third point - - y3 (number) #optional y coord of third point - = (number) angle in degrees. - \*/ - R.angle = function (x1, y1, x2, y2, x3, y3) { - if (x3 == null) { - var x = x1 - x2, - y = y1 - y2; - if (!x && !y) { - return 0; - } - return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360; - } else { - return R.angle(x1, y1, x3, y3) - R.angle(x2, y2, x3, y3); - } - }; - /*\ - * Raphael.rad - [ method ] - ** - * Transform angle to radians - > Parameters - - deg (number) angle in degrees - = (number) angle in radians. - \*/ - R.rad = function (deg) { - return deg % 360 * PI / 180; - }; - /*\ - * Raphael.deg - [ method ] - ** - * Transform angle to degrees - > Parameters - - rad (number) angle in radians - = (number) angle in degrees. - \*/ - R.deg = function (rad) { - return Math.round ((rad * 180 / PI% 360)* 1000) / 1000; - }; - /*\ - * Raphael.snapTo - [ method ] - ** - * Snaps given value to given grid. - > Parameters - - values (array|number) given array of values or step of the grid - - value (number) value to adjust - - tolerance (number) #optional tolerance for snapping. Default is `10`. - = (number) adjusted value. - \*/ - R.snapTo = function (values, value, tolerance) { - tolerance = R.is(tolerance, "finite") ? tolerance : 10; - if (R.is(values, array)) { - var i = values.length; - while (i--) if (abs(values[i] - value) <= tolerance) { - return values[i]; - } - } else { - values = +values; - var rem = value % values; - if (rem < tolerance) { - return value - rem; - } - if (rem > values - tolerance) { - return value - rem + values; - } - } - return value; - }; - - /*\ - * Raphael.createUUID - [ method ] - ** - * Returns RFC4122, version 4 ID - \*/ - var createUUID = R.createUUID = (function (uuidRegEx, uuidReplacer) { - return function () { - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(uuidRegEx, uuidReplacer).toUpperCase(); - }; - })(/[xy]/g, function (c) { - var r = math.random() * 16 | 0, - v = c == "x" ? r : (r & 3 | 8); - return v.toString(16); - }); - - /*\ - * Raphael.setWindow - [ method ] - ** - * Used when you need to draw in `<iframe>`. Switched window to the iframe one. - > Parameters - - newwin (window) new window object - \*/ - R.setWindow = function (newwin) { - eve("raphael.setWindow", R, g.win, newwin); - g.win = newwin; - g.doc = g.win.document; - if (R._engine.initWin) { - R._engine.initWin(g.win); - } - }; - var toHex = function (color) { - if (R.vml) { - // http://dean.edwards.name/weblog/2009/10/convert-any-colour-value-to-hex-in-msie/ - var trim = /^\s+|\s+$/g; - var bod; - try { - var docum = new ActiveXObject("htmlfile"); - docum.write(""); - docum.close(); - bod = docum.body; - } catch(e) { - bod = createPopup().document.body; - } - var range = bod.createTextRange(); - toHex = cacher(function (color) { - try { - bod.style.color = Str(color).replace(trim, E); - var value = range.queryCommandValue("ForeColor"); - value = ((value & 255) << 16) | (value & 65280) | ((value & 16711680) >>> 16); - return "#" + ("000000" + value.toString(16)).slice(-6); - } catch(e) { - return "none"; - } - }); - } else { - var i = g.doc.createElement("i"); - i.title = "Rapha\xebl Colour Picker"; - i.style.display = "none"; - g.doc.body.appendChild(i); - toHex = cacher(function (color) { - i.style.color = color; - return g.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color"); - }); - } - return toHex(color); - }, - hsbtoString = function () { - return "hsb(" + [this.h, this.s, this.b] + ")"; - }, - hsltoString = function () { - return "hsl(" + [this.h, this.s, this.l] + ")"; - }, - rgbtoString = function () { - return this.hex; - }, - prepareRGB = function (r, g, b) { - if (g == null && R.is(r, "object") && "r" in r && "g" in r && "b" in r) { - b = r.b; - g = r.g; - r = r.r; - } - if (g == null && R.is(r, string)) { - var clr = R.getRGB(r); - r = clr.r; - g = clr.g; - b = clr.b; - } - if (r > 1 || g > 1 || b > 1) { - r /= 255; - g /= 255; - b /= 255; - } - - return [r, g, b]; - }, - packageRGB = function (r, g, b, o) { - r *= 255; - g *= 255; - b *= 255; - var rgb = { - r: r, - g: g, - b: b, - hex: R.rgb(r, g, b), - toString: rgbtoString - }; - R.is(o, "finite") && (rgb.opacity = o); - return rgb; - }; - - /*\ - * Raphael.color - [ method ] - ** - * Parses the color string and returns object with all values for the given color. - > Parameters - - clr (string) color string in one of the supported formats (see @Raphael.getRGB) - = (object) Combined RGB & HSB object in format: - o { - o r (number) red, - o g (number) green, - o b (number) blue, - o hex (string) color in HTML/CSS format: #••••••, - o error (boolean) `true` if string can’t be parsed, - o h (number) hue, - o s (number) saturation, - o v (number) value (brightness), - o l (number) lightness - o } - \*/ - R.color = function (clr) { - var rgb; - if (R.is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) { - rgb = R.hsb2rgb(clr); - clr.r = rgb.r; - clr.g = rgb.g; - clr.b = rgb.b; - clr.hex = rgb.hex; - } else if (R.is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) { - rgb = R.hsl2rgb(clr); - clr.r = rgb.r; - clr.g = rgb.g; - clr.b = rgb.b; - clr.hex = rgb.hex; - } else { - if (R.is(clr, "string")) { - clr = R.getRGB(clr); - } - if (R.is(clr, "object") && "r" in clr && "g" in clr && "b" in clr) { - rgb = R.rgb2hsl(clr); - clr.h = rgb.h; - clr.s = rgb.s; - clr.l = rgb.l; - rgb = R.rgb2hsb(clr); - clr.v = rgb.b; - } else { - clr = {hex: "none"}; - clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1; - } - } - clr.toString = rgbtoString; - return clr; - }; - /*\ - * Raphael.hsb2rgb - [ method ] - ** - * Converts HSB values to RGB object. - > Parameters - - h (number) hue - - s (number) saturation - - v (number) value or brightness - = (object) RGB object in format: - o { - o r (number) red, - o g (number) green, - o b (number) blue, - o hex (string) color in HTML/CSS format: #•••••• - o } - \*/ - R.hsb2rgb = function (h, s, v, o) { - if (this.is(h, "object") && "h" in h && "s" in h && "b" in h) { - v = h.b; - s = h.s; - o = h.o; - h = h.h; - } - h *= 360; - var R, G, B, X, C; - h = (h % 360) / 60; - C = v * s; - X = C * (1 - abs(h % 2 - 1)); - R = G = B = v - C; - - h = ~~h; - R += [C, X, 0, 0, X, C][h]; - G += [X, C, C, X, 0, 0][h]; - B += [0, 0, X, C, C, X][h]; - return packageRGB(R, G, B, o); - }; - /*\ - * Raphael.hsl2rgb - [ method ] - ** - * Converts HSL values to RGB object. - > Parameters - - h (number) hue - - s (number) saturation - - l (number) luminosity - = (object) RGB object in format: - o { - o r (number) red, - o g (number) green, - o b (number) blue, - o hex (string) color in HTML/CSS format: #•••••• - o } - \*/ - R.hsl2rgb = function (h, s, l, o) { - if (this.is(h, "object") && "h" in h && "s" in h && "l" in h) { - l = h.l; - s = h.s; - h = h.h; - } - if (h > 1 || s > 1 || l > 1) { - h /= 360; - s /= 100; - l /= 100; - } - h *= 360; - var R, G, B, X, C; - h = (h % 360) / 60; - C = 2 * s * (l < .5 ? l : 1 - l); - X = C * (1 - abs(h % 2 - 1)); - R = G = B = l - C / 2; - - h = ~~h; - R += [C, X, 0, 0, X, C][h]; - G += [X, C, C, X, 0, 0][h]; - B += [0, 0, X, C, C, X][h]; - return packageRGB(R, G, B, o); - }; - /*\ - * Raphael.rgb2hsb - [ method ] - ** - * Converts RGB values to HSB object. - > Parameters - - r (number) red - - g (number) green - - b (number) blue - = (object) HSB object in format: - o { - o h (number) hue - o s (number) saturation - o b (number) brightness - o } - \*/ - R.rgb2hsb = function (r, g, b) { - b = prepareRGB(r, g, b); - r = b[0]; - g = b[1]; - b = b[2]; - - var H, S, V, C; - V = mmax(r, g, b); - C = V - mmin(r, g, b); - H = (C == 0 ? null : - V == r ? (g - b) / C : - V == g ? (b - r) / C + 2 : - (r - g) / C + 4 - ); - H = ((H + 360) % 6) * 60 / 360; - S = C == 0 ? 0 : C / V; - return {h: H, s: S, b: V, toString: hsbtoString}; - }; - /*\ - * Raphael.rgb2hsl - [ method ] - ** - * Converts RGB values to HSL object. - > Parameters - - r (number) red - - g (number) green - - b (number) blue - = (object) HSL object in format: - o { - o h (number) hue - o s (number) saturation - o l (number) luminosity - o } - \*/ - R.rgb2hsl = function (r, g, b) { - b = prepareRGB(r, g, b); - r = b[0]; - g = b[1]; - b = b[2]; - - var H, S, L, M, m, C; - M = mmax(r, g, b); - m = mmin(r, g, b); - C = M - m; - H = (C == 0 ? null : - M == r ? (g - b) / C : - M == g ? (b - r) / C + 2 : - (r - g) / C + 4); - H = ((H + 360) % 6) * 60 / 360; - L = (M + m) / 2; - S = (C == 0 ? 0 : - L < .5 ? C / (2 * L) : - C / (2 - 2 * L)); - return {h: H, s: S, l: L, toString: hsltoString}; - }; - R._path2string = function () { - return this.join(",").replace(p2s, "$1"); - }; - function repush(array, item) { - for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) { - return array.push(array.splice(i, 1)[0]); - } - } - function cacher(f, scope, postprocessor) { - function newf() { - var arg = Array.prototype.slice.call(arguments, 0), - args = arg.join("\u2400"), - cache = newf.cache = newf.cache || {}, - count = newf.count = newf.count || []; - if (cache[has](args)) { - repush(count, args); - return postprocessor ? postprocessor(cache[args]) : cache[args]; - } - count.length >= 1e3 && delete cache[count.shift()]; - count.push(args); - cache[args] = f[apply](scope, arg); - return postprocessor ? postprocessor(cache[args]) : cache[args]; - } - return newf; - } - - var preload = R._preload = function (src, f) { - var img = g.doc.createElement("img"); - img.style.cssText = "position:absolute;left:-9999em;top:-9999em"; - img.onload = function () { - f.call(this); - this.onload = null; - g.doc.body.removeChild(this); - }; - img.onerror = function () { - g.doc.body.removeChild(this); - }; - g.doc.body.appendChild(img); - img.src = src; - }; - - function clrToString() { - return this.hex; - } - - /*\ - * Raphael.getRGB - [ method ] - ** - * Parses colour string as RGB object - > Parameters - - colour (string) colour string in one of formats: - #
    - #
  • Colour name (“red”, “green”, “cornflowerblue”, etc)
  • - #
  • #••• — shortened HTML colour: (“#000”, “#fc0”, etc)
  • - #
  • #•••••• — full length HTML colour: (“#000000”, “#bd2300”)
  • - #
  • rgb(•••, •••, •••) — red, green and blue channels’ values: (“rgb(200, 100, 0)”)
  • - #
  • rgb(•••%, •••%, •••%) — same as above, but in %: (“rgb(100%, 175%, 0%)”)
  • - #
  • hsb(•••, •••, •••) — hue, saturation and brightness values: (“hsb(0.5, 0.25, 1)”)
  • - #
  • hsb(•••%, •••%, •••%) — same as above, but in %
  • - #
  • hsl(•••, •••, •••) — same as hsb
  • - #
  • hsl(•••%, •••%, •••%) — same as hsb
  • - #
- = (object) RGB object in format: - o { - o r (number) red, - o g (number) green, - o b (number) blue - o hex (string) color in HTML/CSS format: #••••••, - o error (boolean) true if string can’t be parsed - o } - \*/ - R.getRGB = cacher(function (colour) { - if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) { - return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: clrToString}; - } - if (colour == "none") { - return {r: -1, g: -1, b: -1, hex: "none", toString: clrToString}; - } - !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour)); - var res, - red, - green, - blue, - opacity, - t, - values, - rgb = colour.match(colourRegExp); - if (rgb) { - if (rgb[2]) { - blue = toInt(rgb[2].substring(5), 16); - green = toInt(rgb[2].substring(3, 5), 16); - red = toInt(rgb[2].substring(1, 3), 16); - } - if (rgb[3]) { - blue = toInt((t = rgb[3].charAt(3)) + t, 16); - green = toInt((t = rgb[3].charAt(2)) + t, 16); - red = toInt((t = rgb[3].charAt(1)) + t, 16); - } - if (rgb[4]) { - values = rgb[4][split](commaSpaces); - red = toFloat(values[0]); - values[0].slice(-1) == "%" && (red *= 2.55); - green = toFloat(values[1]); - values[1].slice(-1) == "%" && (green *= 2.55); - blue = toFloat(values[2]); - values[2].slice(-1) == "%" && (blue *= 2.55); - rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3])); - values[3] && values[3].slice(-1) == "%" && (opacity /= 100); - } - if (rgb[5]) { - values = rgb[5][split](commaSpaces); - red = toFloat(values[0]); - values[0].slice(-1) == "%" && (red *= 2.55); - green = toFloat(values[1]); - values[1].slice(-1) == "%" && (green *= 2.55); - blue = toFloat(values[2]); - values[2].slice(-1) == "%" && (blue *= 2.55); - (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360); - rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3])); - values[3] && values[3].slice(-1) == "%" && (opacity /= 100); - return R.hsb2rgb(red, green, blue, opacity); - } - if (rgb[6]) { - values = rgb[6][split](commaSpaces); - red = toFloat(values[0]); - values[0].slice(-1) == "%" && (red *= 2.55); - green = toFloat(values[1]); - values[1].slice(-1) == "%" && (green *= 2.55); - blue = toFloat(values[2]); - values[2].slice(-1) == "%" && (blue *= 2.55); - (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360); - rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3])); - values[3] && values[3].slice(-1) == "%" && (opacity /= 100); - return R.hsl2rgb(red, green, blue, opacity); - } - rgb = {r: red, g: green, b: blue, toString: clrToString}; - rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1); - R.is(opacity, "finite") && (rgb.opacity = opacity); - return rgb; - } - return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: clrToString}; - }, R); - /*\ - * Raphael.hsb - [ method ] - ** - * Converts HSB values to hex representation of the colour. - > Parameters - - h (number) hue - - s (number) saturation - - b (number) value or brightness - = (string) hex representation of the colour. - \*/ - R.hsb = cacher(function (h, s, b) { - return R.hsb2rgb(h, s, b).hex; - }); - /*\ - * Raphael.hsl - [ method ] - ** - * Converts HSL values to hex representation of the colour. - > Parameters - - h (number) hue - - s (number) saturation - - l (number) luminosity - = (string) hex representation of the colour. - \*/ - R.hsl = cacher(function (h, s, l) { - return R.hsl2rgb(h, s, l).hex; - }); - /*\ - * Raphael.rgb - [ method ] - ** - * Converts RGB values to hex representation of the colour. - > Parameters - - r (number) red - - g (number) green - - b (number) blue - = (string) hex representation of the colour. - \*/ - R.rgb = cacher(function (r, g, b) { - function round(x) { return (x + 0.5) | 0; } - return "#" + (16777216 | round(b) | (round(g) << 8) | (round(r) << 16)).toString(16).slice(1); - }); - /*\ - * Raphael.getColor - [ method ] - ** - * On each call returns next colour in the spectrum. To reset it back to red call @Raphael.getColor.reset - > Parameters - - value (number) #optional brightness, default is `0.75` - = (string) hex representation of the colour. - \*/ - R.getColor = function (value) { - var start = this.getColor.start = this.getColor.start || {h: 0, s: 1, b: value || .75}, - rgb = this.hsb2rgb(start.h, start.s, start.b); - start.h += .075; - if (start.h > 1) { - start.h = 0; - start.s -= .2; - start.s <= 0 && (this.getColor.start = {h: 0, s: 1, b: start.b}); - } - return rgb.hex; - }; - /*\ - * Raphael.getColor.reset - [ method ] - ** - * Resets spectrum position for @Raphael.getColor back to red. - \*/ - R.getColor.reset = function () { - delete this.start; - }; - - // http://schepers.cc/getting-to-the-point - function catmullRom2bezier(crp, z) { - var d = []; - for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) { - var p = [ - {x: +crp[i - 2], y: +crp[i - 1]}, - {x: +crp[i], y: +crp[i + 1]}, - {x: +crp[i + 2], y: +crp[i + 3]}, - {x: +crp[i + 4], y: +crp[i + 5]} - ]; - if (z) { - if (!i) { - p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]}; - } else if (iLen - 4 == i) { - p[3] = {x: +crp[0], y: +crp[1]}; - } else if (iLen - 2 == i) { - p[2] = {x: +crp[0], y: +crp[1]}; - p[3] = {x: +crp[2], y: +crp[3]}; - } - } else { - if (iLen - 4 == i) { - p[3] = p[2]; - } else if (!i) { - p[0] = {x: +crp[i], y: +crp[i + 1]}; - } - } - d.push(["C", - (-p[0].x + 6 * p[1].x + p[2].x) / 6, - (-p[0].y + 6 * p[1].y + p[2].y) / 6, - (p[1].x + 6 * p[2].x - p[3].x) / 6, - (p[1].y + 6*p[2].y - p[3].y) / 6, - p[2].x, - p[2].y - ]); - } - - return d; - } - /*\ - * Raphael.parsePathString - [ method ] - ** - * Utility method - ** - * Parses given path string into an array of arrays of path segments. - > Parameters - - pathString (string|array) path string or array of segments (in the last case it will be returned straight away) - = (array) array of segments. - \*/ - R.parsePathString = function (pathString) { - if (!pathString) { - return null; - } - var pth = paths(pathString); - if (pth.arr) { - return pathClone(pth.arr); - } - - var paramCounts = {a: 7, c: 6, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, z: 0}, - data = []; - if (R.is(pathString, array) && R.is(pathString[0], array)) { // rough assumption - data = pathClone(pathString); - } - if (!data.length) { - Str(pathString).replace(pathCommand, function (a, b, c) { - var params = [], - name = b.toLowerCase(); - c.replace(pathValues, function (a, b) { - b && params.push(+b); - }); - if (name == "m" && params.length > 2) { - data.push([b][concat](params.splice(0, 2))); - name = "l"; - b = b == "m" ? "l" : "L"; - } - if (name == "r") { - data.push([b][concat](params)); - } else while (params.length >= paramCounts[name]) { - data.push([b][concat](params.splice(0, paramCounts[name]))); - if (!paramCounts[name]) { - break; - } - } - }); - } - data.toString = R._path2string; - pth.arr = pathClone(data); - return data; - }; - /*\ - * Raphael.parseTransformString - [ method ] - ** - * Utility method - ** - * Parses given path string into an array of transformations. - > Parameters - - TString (string|array) transform string or array of transformations (in the last case it will be returned straight away) - = (array) array of transformations. - \*/ - R.parseTransformString = cacher(function (TString) { - if (!TString) { - return null; - } - var paramCounts = {r: 3, s: 4, t: 2, m: 6}, - data = []; - if (R.is(TString, array) && R.is(TString[0], array)) { // rough assumption - data = pathClone(TString); - } - if (!data.length) { - Str(TString).replace(tCommand, function (a, b, c) { - var params = [], - name = lowerCase.call(b); - c.replace(pathValues, function (a, b) { - b && params.push(+b); - }); - data.push([b][concat](params)); - }); - } - data.toString = R._path2string; - return data; - }, this, function(elem) { - if (!elem) return elem; - var newData = []; - for (var i = 0; i < elem.length; i++) { - var newLevel = []; - for (var j = 0; j < elem[i].length; j++) { - newLevel.push(elem[i][j]); - } - newData.push(newLevel); - } - return newData; } ); - // PATHS - var paths = function (ps) { - var p = paths.ps = paths.ps || {}; - if (p[ps]) { - p[ps].sleep = 100; - } else { - p[ps] = { - sleep: 100 - }; - } - setTimeout(function () { - for (var key in p) if (p[has](key) && key != ps) { - p[key].sleep--; - !p[key].sleep && delete p[key]; - } - }); - return p[ps]; - }; - /*\ - * Raphael.findDotsAtSegment - [ method ] - ** - * Utility method - ** - * Find dot coordinates on the given cubic bezier curve at the given t. - > Parameters - - p1x (number) x of the first point of the curve - - p1y (number) y of the first point of the curve - - c1x (number) x of the first anchor of the curve - - c1y (number) y of the first anchor of the curve - - c2x (number) x of the second anchor of the curve - - c2y (number) y of the second anchor of the curve - - p2x (number) x of the second point of the curve - - p2y (number) y of the second point of the curve - - t (number) position on the curve (0..1) - = (object) point information in format: - o { - o x: (number) x coordinate of the point - o y: (number) y coordinate of the point - o m: { - o x: (number) x coordinate of the left anchor - o y: (number) y coordinate of the left anchor - o } - o n: { - o x: (number) x coordinate of the right anchor - o y: (number) y coordinate of the right anchor - o } - o start: { - o x: (number) x coordinate of the start of the curve - o y: (number) y coordinate of the start of the curve - o } - o end: { - o x: (number) x coordinate of the end of the curve - o y: (number) y coordinate of the end of the curve - o } - o alpha: (number) angle of the curve derivative at the point - o } - \*/ - R.findDotsAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) { - var t1 = 1 - t, - t13 = pow(t1, 3), - t12 = pow(t1, 2), - t2 = t * t, - t3 = t2 * t, - x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x, - y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y, - mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x), - my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y), - nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x), - ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y), - ax = t1 * p1x + t * c1x, - ay = t1 * p1y + t * c1y, - cx = t1 * c2x + t * p2x, - cy = t1 * c2y + t * p2y, - alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI); - (mx > nx || my < ny) && (alpha += 180); - return { - x: x, - y: y, - m: {x: mx, y: my}, - n: {x: nx, y: ny}, - start: {x: ax, y: ay}, - end: {x: cx, y: cy}, - alpha: alpha - }; - }; - /*\ - * Raphael.bezierBBox - [ method ] - ** - * Utility method - ** - * Return bounding box of a given cubic bezier curve - > Parameters - - p1x (number) x of the first point of the curve - - p1y (number) y of the first point of the curve - - c1x (number) x of the first anchor of the curve - - c1y (number) y of the first anchor of the curve - - c2x (number) x of the second anchor of the curve - - c2y (number) y of the second anchor of the curve - - p2x (number) x of the second point of the curve - - p2y (number) y of the second point of the curve - * or - - bez (array) array of six points for bezier curve - = (object) point information in format: - o { - o min: { - o x: (number) x coordinate of the left point - o y: (number) y coordinate of the top point - o } - o max: { - o x: (number) x coordinate of the right point - o y: (number) y coordinate of the bottom point - o } - o } - \*/ - R.bezierBBox = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) { - if (!R.is(p1x, "array")) { - p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y]; - } - var bbox = curveDim.apply(null, p1x); - return { - x: bbox.min.x, - y: bbox.min.y, - x2: bbox.max.x, - y2: bbox.max.y, - width: bbox.max.x - bbox.min.x, - height: bbox.max.y - bbox.min.y - }; - }; - /*\ - * Raphael.isPointInsideBBox - [ method ] - ** - * Utility method - ** - * Returns `true` if given point is inside bounding boxes. - > Parameters - - bbox (string) bounding box - - x (string) x coordinate of the point - - y (string) y coordinate of the point - = (boolean) `true` if point inside - \*/ - R.isPointInsideBBox = function (bbox, x, y) { - return x >= bbox.x && x <= bbox.x2 && y >= bbox.y && y <= bbox.y2; - }; - /*\ - * Raphael.isBBoxIntersect - [ method ] - ** - * Utility method - ** - * Returns `true` if two bounding boxes intersect - > Parameters - - bbox1 (string) first bounding box - - bbox2 (string) second bounding box - = (boolean) `true` if they intersect - \*/ - R.isBBoxIntersect = function (bbox1, bbox2) { - var i = R.isPointInsideBBox; - return i(bbox2, bbox1.x, bbox1.y) - || i(bbox2, bbox1.x2, bbox1.y) - || i(bbox2, bbox1.x, bbox1.y2) - || i(bbox2, bbox1.x2, bbox1.y2) - || i(bbox1, bbox2.x, bbox2.y) - || i(bbox1, bbox2.x2, bbox2.y) - || i(bbox1, bbox2.x, bbox2.y2) - || i(bbox1, bbox2.x2, bbox2.y2) - || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) - && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y); - }; - function base3(t, p1, p2, p3, p4) { - var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4, - t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3; - return t * t2 - 3 * p1 + 3 * p2; - } - function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) { - if (z == null) { - z = 1; - } - z = z > 1 ? 1 : z < 0 ? 0 : z; - var z2 = z / 2, - n = 12, - Tvalues = [-0.1252,0.1252,-0.3678,0.3678,-0.5873,0.5873,-0.7699,0.7699,-0.9041,0.9041,-0.9816,0.9816], - Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472], - sum = 0; - for (var i = 0; i < n; i++) { - var ct = z2 * Tvalues[i] + z2, - xbase = base3(ct, x1, x2, x3, x4), - ybase = base3(ct, y1, y2, y3, y4), - comb = xbase * xbase + ybase * ybase; - sum += Cvalues[i] * math.sqrt(comb); - } - return z2 * sum; - } - function getTatLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) { - if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) { - return; - } - var t = 1, - step = t / 2, - t2 = t - step, - l, - e = .01; - l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); - while (abs(l - ll) > e) { - step /= 2; - t2 += (l < ll ? 1 : -1) * step; - l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); - } - return t2; - } - function intersect(x1, y1, x2, y2, x3, y3, x4, y4) { - if ( - mmax(x1, x2) < mmin(x3, x4) || - mmin(x1, x2) > mmax(x3, x4) || - mmax(y1, y2) < mmin(y3, y4) || - mmin(y1, y2) > mmax(y3, y4) - ) { - return; - } - var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4), - ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4), - denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); - - if (!denominator) { - return; - } - var px = nx / denominator, - py = ny / denominator, - px2 = +px.toFixed(2), - py2 = +py.toFixed(2); - if ( - px2 < +mmin(x1, x2).toFixed(2) || - px2 > +mmax(x1, x2).toFixed(2) || - px2 < +mmin(x3, x4).toFixed(2) || - px2 > +mmax(x3, x4).toFixed(2) || - py2 < +mmin(y1, y2).toFixed(2) || - py2 > +mmax(y1, y2).toFixed(2) || - py2 < +mmin(y3, y4).toFixed(2) || - py2 > +mmax(y3, y4).toFixed(2) - ) { - return; - } - return {x: px, y: py}; - } - function inter(bez1, bez2) { - return interHelper(bez1, bez2); - } - function interCount(bez1, bez2) { - return interHelper(bez1, bez2, 1); - } - function interHelper(bez1, bez2, justCount) { - var bbox1 = R.bezierBBox(bez1), - bbox2 = R.bezierBBox(bez2); - if (!R.isBBoxIntersect(bbox1, bbox2)) { - return justCount ? 0 : []; - } - var l1 = bezlen.apply(0, bez1), - l2 = bezlen.apply(0, bez2), - n1 = mmax(~~(l1 / 5), 1), - n2 = mmax(~~(l2 / 5), 1), - dots1 = [], - dots2 = [], - xy = {}, - res = justCount ? 0 : []; - for (var i = 0; i < n1 + 1; i++) { - var p = R.findDotsAtSegment.apply(R, bez1.concat(i / n1)); - dots1.push({x: p.x, y: p.y, t: i / n1}); - } - for (i = 0; i < n2 + 1; i++) { - p = R.findDotsAtSegment.apply(R, bez2.concat(i / n2)); - dots2.push({x: p.x, y: p.y, t: i / n2}); - } - for (i = 0; i < n1; i++) { - for (var j = 0; j < n2; j++) { - var di = dots1[i], - di1 = dots1[i + 1], - dj = dots2[j], - dj1 = dots2[j + 1], - ci = abs(di1.x - di.x) < .001 ? "y" : "x", - cj = abs(dj1.x - dj.x) < .001 ? "y" : "x", - is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y); - if (is) { - if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) { - continue; - } - xy[is.x.toFixed(4)] = is.y.toFixed(4); - var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t), - t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t); - if (t1 >= 0 && t1 <= 1.001 && t2 >= 0 && t2 <= 1.001) { - if (justCount) { - res++; - } else { - res.push({ - x: is.x, - y: is.y, - t1: mmin(t1, 1), - t2: mmin(t2, 1) - }); - } - } - } - } - } - return res; - } - /*\ - * Raphael.pathIntersection - [ method ] - ** - * Utility method - ** - * Finds intersections of two paths - > Parameters - - path1 (string) path string - - path2 (string) path string - = (array) dots of intersection - o [ - o { - o x: (number) x coordinate of the point - o y: (number) y coordinate of the point - o t1: (number) t value for segment of path1 - o t2: (number) t value for segment of path2 - o segment1: (number) order number for segment of path1 - o segment2: (number) order number for segment of path2 - o bez1: (array) eight coordinates representing beziér curve for the segment of path1 - o bez2: (array) eight coordinates representing beziér curve for the segment of path2 - o } - o ] - \*/ - R.pathIntersection = function (path1, path2) { - return interPathHelper(path1, path2); - }; - R.pathIntersectionNumber = function (path1, path2) { - return interPathHelper(path1, path2, 1); - }; - function interPathHelper(path1, path2, justCount) { - path1 = R._path2curve(path1); - path2 = R._path2curve(path2); - var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2, - res = justCount ? 0 : []; - for (var i = 0, ii = path1.length; i < ii; i++) { - var pi = path1[i]; - if (pi[0] == "M") { - x1 = x1m = pi[1]; - y1 = y1m = pi[2]; - } else { - if (pi[0] == "C") { - bez1 = [x1, y1].concat(pi.slice(1)); - x1 = bez1[6]; - y1 = bez1[7]; - } else { - bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m]; - x1 = x1m; - y1 = y1m; - } - for (var j = 0, jj = path2.length; j < jj; j++) { - var pj = path2[j]; - if (pj[0] == "M") { - x2 = x2m = pj[1]; - y2 = y2m = pj[2]; - } else { - if (pj[0] == "C") { - bez2 = [x2, y2].concat(pj.slice(1)); - x2 = bez2[6]; - y2 = bez2[7]; - } else { - bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m]; - x2 = x2m; - y2 = y2m; - } - var intr = interHelper(bez1, bez2, justCount); - if (justCount) { - res += intr; - } else { - for (var k = 0, kk = intr.length; k < kk; k++) { - intr[k].segment1 = i; - intr[k].segment2 = j; - intr[k].bez1 = bez1; - intr[k].bez2 = bez2; - } - res = res.concat(intr); - } - } - } - } - } - return res; - } - /*\ - * Raphael.isPointInsidePath - [ method ] - ** - * Utility method - ** - * Returns `true` if given point is inside a given closed path. - > Parameters - - path (string) path string - - x (number) x of the point - - y (number) y of the point - = (boolean) true, if point is inside the path - \*/ - R.isPointInsidePath = function (path, x, y) { - var bbox = R.pathBBox(path); - return R.isPointInsideBBox(bbox, x, y) && - interPathHelper(path, [["M", x, y], ["H", bbox.x2 + 10]], 1) % 2 == 1; - }; - R._removedFactory = function (methodname) { - return function () { - eve("raphael.log", null, "Rapha\xebl: you are calling to method \u201c" + methodname + "\u201d of removed object", methodname); - }; - }; - /*\ - * Raphael.pathBBox - [ method ] - ** - * Utility method - ** - * Return bounding box of a given path - > Parameters - - path (string) path string - = (object) bounding box - o { - o x: (number) x coordinate of the left top point of the box - o y: (number) y coordinate of the left top point of the box - o x2: (number) x coordinate of the right bottom point of the box - o y2: (number) y coordinate of the right bottom point of the box - o width: (number) width of the box - o height: (number) height of the box - o cx: (number) x coordinate of the center of the box - o cy: (number) y coordinate of the center of the box - o } - \*/ - var pathDimensions = R.pathBBox = function (path) { - var pth = paths(path); - if (pth.bbox) { - return clone(pth.bbox); - } - if (!path) { - return {x: 0, y: 0, width: 0, height: 0, x2: 0, y2: 0}; - } - path = path2curve(path); - var x = 0, - y = 0, - X = [], - Y = [], - p; - for (var i = 0, ii = path.length; i < ii; i++) { - p = path[i]; - if (p[0] == "M") { - x = p[1]; - y = p[2]; - X.push(x); - Y.push(y); - } else { - var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]); - X = X[concat](dim.min.x, dim.max.x); - Y = Y[concat](dim.min.y, dim.max.y); - x = p[5]; - y = p[6]; - } - } - var xmin = mmin[apply](0, X), - ymin = mmin[apply](0, Y), - xmax = mmax[apply](0, X), - ymax = mmax[apply](0, Y), - width = xmax - xmin, - height = ymax - ymin, - bb = { - x: xmin, - y: ymin, - x2: xmax, - y2: ymax, - width: width, - height: height, - cx: xmin + width / 2, - cy: ymin + height / 2 - }; - pth.bbox = clone(bb); - return bb; - }, - pathClone = function (pathArray) { - var res = clone(pathArray); - res.toString = R._path2string; - return res; - }, - pathToRelative = R._pathToRelative = function (pathArray) { - var pth = paths(pathArray); - if (pth.rel) { - return pathClone(pth.rel); - } - if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption - pathArray = R.parsePathString(pathArray); - } - var res = [], - x = 0, - y = 0, - mx = 0, - my = 0, - start = 0; - if (pathArray[0][0] == "M") { - x = pathArray[0][1]; - y = pathArray[0][2]; - mx = x; - my = y; - start++; - res.push(["M", x, y]); - } - for (var i = start, ii = pathArray.length; i < ii; i++) { - var r = res[i] = [], - pa = pathArray[i]; - if (pa[0] != lowerCase.call(pa[0])) { - r[0] = lowerCase.call(pa[0]); - switch (r[0]) { - case "a": - r[1] = pa[1]; - r[2] = pa[2]; - r[3] = pa[3]; - r[4] = pa[4]; - r[5] = pa[5]; - r[6] = +(pa[6] - x).toFixed(3); - r[7] = +(pa[7] - y).toFixed(3); - break; - case "v": - r[1] = +(pa[1] - y).toFixed(3); - break; - case "m": - mx = pa[1]; - my = pa[2]; - default: - for (var j = 1, jj = pa.length; j < jj; j++) { - r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3); - } - } - } else { - r = res[i] = []; - if (pa[0] == "m") { - mx = pa[1] + x; - my = pa[2] + y; - } - for (var k = 0, kk = pa.length; k < kk; k++) { - res[i][k] = pa[k]; - } - } - var len = res[i].length; - switch (res[i][0]) { - case "z": - x = mx; - y = my; - break; - case "h": - x += +res[i][len - 1]; - break; - case "v": - y += +res[i][len - 1]; - break; - default: - x += +res[i][len - 2]; - y += +res[i][len - 1]; - } - } - res.toString = R._path2string; - pth.rel = pathClone(res); - return res; - }, - pathToAbsolute = R._pathToAbsolute = function (pathArray) { - var pth = paths(pathArray); - if (pth.abs) { - return pathClone(pth.abs); - } - if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption - pathArray = R.parsePathString(pathArray); - } - if (!pathArray || !pathArray.length) { - return [["M", 0, 0]]; - } - var res = [], - x = 0, - y = 0, - mx = 0, - my = 0, - start = 0; - if (pathArray[0][0] == "M") { - x = +pathArray[0][1]; - y = +pathArray[0][2]; - mx = x; - my = y; - start++; - res[0] = ["M", x, y]; - } - var crz = pathArray.length == 3 && pathArray[0][0] == "M" && pathArray[1][0].toUpperCase() == "R" && pathArray[2][0].toUpperCase() == "Z"; - for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) { - res.push(r = []); - pa = pathArray[i]; - if (pa[0] != upperCase.call(pa[0])) { - r[0] = upperCase.call(pa[0]); - switch (r[0]) { - case "A": - r[1] = pa[1]; - r[2] = pa[2]; - r[3] = pa[3]; - r[4] = pa[4]; - r[5] = pa[5]; - r[6] = +(pa[6] + x); - r[7] = +(pa[7] + y); - break; - case "V": - r[1] = +pa[1] + y; - break; - case "H": - r[1] = +pa[1] + x; - break; - case "R": - var dots = [x, y][concat](pa.slice(1)); - for (var j = 2, jj = dots.length; j < jj; j++) { - dots[j] = +dots[j] + x; - dots[++j] = +dots[j] + y; - } - res.pop(); - res = res[concat](catmullRom2bezier(dots, crz)); - break; - case "M": - mx = +pa[1] + x; - my = +pa[2] + y; - default: - for (j = 1, jj = pa.length; j < jj; j++) { - r[j] = +pa[j] + ((j % 2) ? x : y); - } - } - } else if (pa[0] == "R") { - dots = [x, y][concat](pa.slice(1)); - res.pop(); - res = res[concat](catmullRom2bezier(dots, crz)); - r = ["R"][concat](pa.slice(-2)); - } else { - for (var k = 0, kk = pa.length; k < kk; k++) { - r[k] = pa[k]; - } - } - switch (r[0]) { - case "Z": - x = mx; - y = my; - break; - case "H": - x = r[1]; - break; - case "V": - y = r[1]; - break; - case "M": - mx = r[r.length - 2]; - my = r[r.length - 1]; - default: - x = r[r.length - 2]; - y = r[r.length - 1]; - } - } - res.toString = R._path2string; - pth.abs = pathClone(res); - return res; - }, - l2c = function (x1, y1, x2, y2) { - return [x1, y1, x2, y2, x2, y2]; - }, - q2c = function (x1, y1, ax, ay, x2, y2) { - var _13 = 1 / 3, - _23 = 2 / 3; - return [ - _13 * x1 + _23 * ax, - _13 * y1 + _23 * ay, - _13 * x2 + _23 * ax, - _13 * y2 + _23 * ay, - x2, - y2 - ]; - }, - a2c = function (x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) { - // for more information of where this math came from visit: - // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes - var _120 = PI * 120 / 180, - rad = PI / 180 * (+angle || 0), - res = [], - xy, - rotate = cacher(function (x, y, rad) { - var X = x * math.cos(rad) - y * math.sin(rad), - Y = x * math.sin(rad) + y * math.cos(rad); - return {x: X, y: Y}; - }); - if (!recursive) { - xy = rotate(x1, y1, -rad); - x1 = xy.x; - y1 = xy.y; - xy = rotate(x2, y2, -rad); - x2 = xy.x; - y2 = xy.y; - var cos = math.cos(PI / 180 * angle), - sin = math.sin(PI / 180 * angle), - x = (x1 - x2) / 2, - y = (y1 - y2) / 2; - var h = (x * x) / (rx * rx) + (y * y) / (ry * ry); - if (h > 1) { - h = math.sqrt(h); - rx = h * rx; - ry = h * ry; - } - var rx2 = rx * rx, - ry2 = ry * ry, - k = (large_arc_flag == sweep_flag ? -1 : 1) * - math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))), - cx = k * rx * y / ry + (x1 + x2) / 2, - cy = k * -ry * x / rx + (y1 + y2) / 2, - f1 = math.asin(((y1 - cy) / ry).toFixed(9)), - f2 = math.asin(((y2 - cy) / ry).toFixed(9)); - - f1 = x1 < cx ? PI - f1 : f1; - f2 = x2 < cx ? PI - f2 : f2; - f1 < 0 && (f1 = PI * 2 + f1); - f2 < 0 && (f2 = PI * 2 + f2); - if (sweep_flag && f1 > f2) { - f1 = f1 - PI * 2; - } - if (!sweep_flag && f2 > f1) { - f2 = f2 - PI * 2; - } - } else { - f1 = recursive[0]; - f2 = recursive[1]; - cx = recursive[2]; - cy = recursive[3]; - } - var df = f2 - f1; - if (abs(df) > _120) { - var f2old = f2, - x2old = x2, - y2old = y2; - f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1); - x2 = cx + rx * math.cos(f2); - y2 = cy + ry * math.sin(f2); - res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]); - } - df = f2 - f1; - var c1 = math.cos(f1), - s1 = math.sin(f1), - c2 = math.cos(f2), - s2 = math.sin(f2), - t = math.tan(df / 4), - hx = 4 / 3 * rx * t, - hy = 4 / 3 * ry * t, - m1 = [x1, y1], - m2 = [x1 + hx * s1, y1 - hy * c1], - m3 = [x2 + hx * s2, y2 - hy * c2], - m4 = [x2, y2]; - m2[0] = 2 * m1[0] - m2[0]; - m2[1] = 2 * m1[1] - m2[1]; - if (recursive) { - return [m2, m3, m4][concat](res); - } else { - res = [m2, m3, m4][concat](res).join()[split](","); - var newres = []; - for (var i = 0, ii = res.length; i < ii; i++) { - newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x; - } - return newres; - } - }, - findDotAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) { - var t1 = 1 - t; - return { - x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x, - y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y - }; - }, - curveDim = cacher(function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) { - var a = (c2x - 2 * c1x + p1x) - (p2x - 2 * c2x + c1x), - b = 2 * (c1x - p1x) - 2 * (c2x - c1x), - c = p1x - c1x, - t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a, - t2 = (-b - math.sqrt(b * b - 4 * a * c)) / 2 / a, - y = [p1y, p2y], - x = [p1x, p2x], - dot; - abs(t1) > "1e12" && (t1 = .5); - abs(t2) > "1e12" && (t2 = .5); - if (t1 > 0 && t1 < 1) { - dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t1); - x.push(dot.x); - y.push(dot.y); - } - if (t2 > 0 && t2 < 1) { - dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t2); - x.push(dot.x); - y.push(dot.y); - } - a = (c2y - 2 * c1y + p1y) - (p2y - 2 * c2y + c1y); - b = 2 * (c1y - p1y) - 2 * (c2y - c1y); - c = p1y - c1y; - t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a; - t2 = (-b - math.sqrt(b * b - 4 * a * c)) / 2 / a; - abs(t1) > "1e12" && (t1 = .5); - abs(t2) > "1e12" && (t2 = .5); - if (t1 > 0 && t1 < 1) { - dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t1); - x.push(dot.x); - y.push(dot.y); - } - if (t2 > 0 && t2 < 1) { - dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t2); - x.push(dot.x); - y.push(dot.y); - } - return { - min: {x: mmin[apply](0, x), y: mmin[apply](0, y)}, - max: {x: mmax[apply](0, x), y: mmax[apply](0, y)} - }; - }), - path2curve = R._path2curve = cacher(function (path, path2) { - var pth = !path2 && paths(path); - if (!path2 && pth.curve) { - return pathClone(pth.curve); - } - var p = pathToAbsolute(path), - p2 = path2 && pathToAbsolute(path2), - attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null}, - attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null}, - processPath = function (path, d, pcom) { - var nx, ny, tq = {T:1, Q:1}; - if (!path) { - return ["C", d.x, d.y, d.x, d.y, d.x, d.y]; - } - !(path[0] in tq) && (d.qx = d.qy = null); - switch (path[0]) { - case "M": - d.X = path[1]; - d.Y = path[2]; - break; - case "A": - path = ["C"][concat](a2c[apply](0, [d.x, d.y][concat](path.slice(1)))); - break; - case "S": - if (pcom == "C" || pcom == "S") { // In "S" case we have to take into account, if the previous command is C/S. - nx = d.x * 2 - d.bx; // And reflect the previous - ny = d.y * 2 - d.by; // command's control point relative to the current point. - } - else { // or some else or nothing - nx = d.x; - ny = d.y; - } - path = ["C", nx, ny][concat](path.slice(1)); - break; - case "T": - if (pcom == "Q" || pcom == "T") { // In "T" case we have to take into account, if the previous command is Q/T. - d.qx = d.x * 2 - d.qx; // And make a reflection similar - d.qy = d.y * 2 - d.qy; // to case "S". - } - else { // or something else or nothing - d.qx = d.x; - d.qy = d.y; - } - path = ["C"][concat](q2c(d.x, d.y, d.qx, d.qy, path[1], path[2])); - break; - case "Q": - d.qx = path[1]; - d.qy = path[2]; - path = ["C"][concat](q2c(d.x, d.y, path[1], path[2], path[3], path[4])); - break; - case "L": - path = ["C"][concat](l2c(d.x, d.y, path[1], path[2])); - break; - case "H": - path = ["C"][concat](l2c(d.x, d.y, path[1], d.y)); - break; - case "V": - path = ["C"][concat](l2c(d.x, d.y, d.x, path[1])); - break; - case "Z": - path = ["C"][concat](l2c(d.x, d.y, d.X, d.Y)); - break; - } - return path; - }, - fixArc = function (pp, i) { - if (pp[i].length > 7) { - pp[i].shift(); - var pi = pp[i]; - while (pi.length) { - pcoms1[i]="A"; // if created multiple C:s, their original seg is saved - p2 && (pcoms2[i]="A"); // the same as above - pp.splice(i++, 0, ["C"][concat](pi.splice(0, 6))); - } - pp.splice(i, 1); - ii = mmax(p.length, p2 && p2.length || 0); - } - }, - fixM = function (path1, path2, a1, a2, i) { - if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") { - path2.splice(i, 0, ["M", a2.x, a2.y]); - a1.bx = 0; - a1.by = 0; - a1.x = path1[i][1]; - a1.y = path1[i][2]; - ii = mmax(p.length, p2 && p2.length || 0); - } - }, - pcoms1 = [], // path commands of original path p - pcoms2 = [], // path commands of original path p2 - pfirst = "", // temporary holder for original path command - pcom = ""; // holder for previous path command of original path - for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) { - p[i] && (pfirst = p[i][0]); // save current path command - - if (pfirst != "C") // C is not saved yet, because it may be result of conversion - { - pcoms1[i] = pfirst; // Save current path command - i && ( pcom = pcoms1[i-1]); // Get previous path command pcom - } - p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath - - if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the only command - // which may produce multiple C:s - // so we have to make sure that C is also C in original path - - fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1 - - if (p2) { // the same procedures is done to p2 - p2[i] && (pfirst = p2[i][0]); - if (pfirst != "C") - { - pcoms2[i] = pfirst; - i && (pcom = pcoms2[i-1]); - } - p2[i] = processPath(p2[i], attrs2, pcom); - - if (pcoms2[i]!="A" && pfirst=="C") pcoms2[i]="C"; - - fixArc(p2, i); - } - fixM(p, p2, attrs, attrs2, i); - fixM(p2, p, attrs2, attrs, i); - var seg = p[i], - seg2 = p2 && p2[i], - seglen = seg.length, - seg2len = p2 && seg2.length; - attrs.x = seg[seglen - 2]; - attrs.y = seg[seglen - 1]; - attrs.bx = toFloat(seg[seglen - 4]) || attrs.x; - attrs.by = toFloat(seg[seglen - 3]) || attrs.y; - attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x); - attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y); - attrs2.x = p2 && seg2[seg2len - 2]; - attrs2.y = p2 && seg2[seg2len - 1]; - } - if (!p2) { - pth.curve = pathClone(p); - } - return p2 ? [p, p2] : p; - }, null, pathClone), - parseDots = R._parseDots = cacher(function (gradient) { - var dots = []; - for (var i = 0, ii = gradient.length; i < ii; i++) { - var dot = {}, - par = gradient[i].match(/^([^:]*):?([\d\.]*)/); - dot.color = R.getRGB(par[1]); - if (dot.color.error) { - return null; - } - dot.opacity = dot.color.opacity; - dot.color = dot.color.hex; - par[2] && (dot.offset = par[2] + "%"); - dots.push(dot); - } - for (i = 1, ii = dots.length - 1; i < ii; i++) { - if (!dots[i].offset) { - var start = toFloat(dots[i - 1].offset || 0), - end = 0; - for (var j = i + 1; j < ii; j++) { - if (dots[j].offset) { - end = dots[j].offset; - break; - } - } - if (!end) { - end = 100; - j = ii; - } - end = toFloat(end); - var d = (end - start) / (j - i + 1); - for (; i < j; i++) { - start += d; - dots[i].offset = start + "%"; - } - } - } - return dots; - }), - tear = R._tear = function (el, paper) { - el == paper.top && (paper.top = el.prev); - el == paper.bottom && (paper.bottom = el.next); - el.next && (el.next.prev = el.prev); - el.prev && (el.prev.next = el.next); - }, - tofront = R._tofront = function (el, paper) { - if (paper.top === el) { - return; - } - tear(el, paper); - el.next = null; - el.prev = paper.top; - paper.top.next = el; - paper.top = el; - }, - toback = R._toback = function (el, paper) { - if (paper.bottom === el) { - return; - } - tear(el, paper); - el.next = paper.bottom; - el.prev = null; - paper.bottom.prev = el; - paper.bottom = el; - }, - insertafter = R._insertafter = function (el, el2, paper) { - tear(el, paper); - el2 == paper.top && (paper.top = el); - el2.next && (el2.next.prev = el); - el.next = el2.next; - el.prev = el2; - el2.next = el; - }, - insertbefore = R._insertbefore = function (el, el2, paper) { - tear(el, paper); - el2 == paper.bottom && (paper.bottom = el); - el2.prev && (el2.prev.next = el); - el.prev = el2.prev; - el2.prev = el; - el.next = el2; - }, - /*\ - * Raphael.toMatrix - [ method ] - ** - * Utility method - ** - * Returns matrix of transformations applied to a given path - > Parameters - - path (string) path string - - transform (string|array) transformation string - = (object) @Matrix - \*/ - toMatrix = R.toMatrix = function (path, transform) { - var bb = pathDimensions(path), - el = { - _: { - transform: E - }, - getBBox: function () { - return bb; - } - }; - extractTransform(el, transform); - return el.matrix; - }, - /*\ - * Raphael.transformPath - [ method ] - ** - * Utility method - ** - * Returns path transformed by a given transformation - > Parameters - - path (string) path string - - transform (string|array) transformation string - = (string) path - \*/ - transformPath = R.transformPath = function (path, transform) { - return mapPath(path, toMatrix(path, transform)); - }, - extractTransform = R._extractTransform = function (el, tstr) { - if (tstr == null) { - return el._.transform; - } - tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E); - var tdata = R.parseTransformString(tstr), - deg = 0, - dx = 0, - dy = 0, - sx = 1, - sy = 1, - _ = el._, - m = new Matrix; - _.transform = tdata || []; - if (tdata) { - for (var i = 0, ii = tdata.length; i < ii; i++) { - var t = tdata[i], - tlen = t.length, - command = Str(t[0]).toLowerCase(), - absolute = t[0] != command, - inver = absolute ? m.invert() : 0, - x1, - y1, - x2, - y2, - bb; - if (command == "t" && tlen == 3) { - if (absolute) { - x1 = inver.x(0, 0); - y1 = inver.y(0, 0); - x2 = inver.x(t[1], t[2]); - y2 = inver.y(t[1], t[2]); - m.translate(x2 - x1, y2 - y1); - } else { - m.translate(t[1], t[2]); - } - } else if (command == "r") { - if (tlen == 2) { - bb = bb || el.getBBox(1); - m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2); - deg += t[1]; - } else if (tlen == 4) { - if (absolute) { - x2 = inver.x(t[2], t[3]); - y2 = inver.y(t[2], t[3]); - m.rotate(t[1], x2, y2); - } else { - m.rotate(t[1], t[2], t[3]); - } - deg += t[1]; - } - } else if (command == "s") { - if (tlen == 2 || tlen == 3) { - bb = bb || el.getBBox(1); - m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2); - sx *= t[1]; - sy *= t[tlen - 1]; - } else if (tlen == 5) { - if (absolute) { - x2 = inver.x(t[3], t[4]); - y2 = inver.y(t[3], t[4]); - m.scale(t[1], t[2], x2, y2); - } else { - m.scale(t[1], t[2], t[3], t[4]); - } - sx *= t[1]; - sy *= t[2]; - } - } else if (command == "m" && tlen == 7) { - m.add(t[1], t[2], t[3], t[4], t[5], t[6]); - } - _.dirtyT = 1; - el.matrix = m; - } - } - - /*\ - * Element.matrix - [ property (object) ] - ** - * Keeps @Matrix object, which represents element transformation - \*/ - el.matrix = m; - - _.sx = sx; - _.sy = sy; - _.deg = deg; - _.dx = dx = m.e; - _.dy = dy = m.f; - - if (sx == 1 && sy == 1 && !deg && _.bbox) { - _.bbox.x += +dx; - _.bbox.y += +dy; - } else { - _.dirtyT = 1; - } - }, - getEmpty = function (item) { - var l = item[0]; - switch (l.toLowerCase()) { - case "t": return [l, 0, 0]; - case "m": return [l, 1, 0, 0, 1, 0, 0]; - case "r": if (item.length == 4) { - return [l, 0, item[2], item[3]]; - } else { - return [l, 0]; - } - case "s": if (item.length == 5) { - return [l, 1, 1, item[3], item[4]]; - } else if (item.length == 3) { - return [l, 1, 1]; - } else { - return [l, 1]; - } - } - }, - equaliseTransform = R._equaliseTransform = function (t1, t2) { - t2 = Str(t2).replace(/\.{3}|\u2026/g, t1); - t1 = R.parseTransformString(t1) || []; - t2 = R.parseTransformString(t2) || []; - var maxlength = mmax(t1.length, t2.length), - from = [], - to = [], - i = 0, j, jj, - tt1, tt2; - for (; i < maxlength; i++) { - tt1 = t1[i] || getEmpty(t2[i]); - tt2 = t2[i] || getEmpty(tt1); - if ((tt1[0] != tt2[0]) || - (tt1[0].toLowerCase() == "r" && (tt1[2] != tt2[2] || tt1[3] != tt2[3])) || - (tt1[0].toLowerCase() == "s" && (tt1[3] != tt2[3] || tt1[4] != tt2[4])) - ) { - return; - } - from[i] = []; - to[i] = []; - for (j = 0, jj = mmax(tt1.length, tt2.length); j < jj; j++) { - j in tt1 && (from[i][j] = tt1[j]); - j in tt2 && (to[i][j] = tt2[j]); - } - } - return { - from: from, - to: to - }; - }; - R._getContainer = function (x, y, w, h) { - var container; - container = h == null && !R.is(x, "object") ? g.doc.getElementById(x) : x; - if (container == null) { - return; - } - if (container.tagName) { - if (y == null) { - return { - container: container, - width: container.style.pixelWidth || container.offsetWidth, - height: container.style.pixelHeight || container.offsetHeight - }; - } else { - return { - container: container, - width: y, - height: w - }; - } - } - return { - container: 1, - x: x, - y: y, - width: w, - height: h - }; - }; - /*\ - * Raphael.pathToRelative - [ method ] - ** - * Utility method - ** - * Converts path to relative form - > Parameters - - pathString (string|array) path string or array of segments - = (array) array of segments. - \*/ - R.pathToRelative = pathToRelative; - R._engine = {}; - /*\ - * Raphael.path2curve - [ method ] - ** - * Utility method - ** - * Converts path to a new path where all segments are cubic bezier curves. - > Parameters - - pathString (string|array) path string or array of segments - = (array) array of segments. - \*/ - R.path2curve = path2curve; - /*\ - * Raphael.matrix - [ method ] - ** - * Utility method - ** - * Returns matrix based on given parameters. - > Parameters - - a (number) - - b (number) - - c (number) - - d (number) - - e (number) - - f (number) - = (object) @Matrix - \*/ - R.matrix = function (a, b, c, d, e, f) { - return new Matrix(a, b, c, d, e, f); - }; - function Matrix(a, b, c, d, e, f) { - if (a != null) { - this.a = +a; - this.b = +b; - this.c = +c; - this.d = +d; - this.e = +e; - this.f = +f; - } else { - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.e = 0; - this.f = 0; - } - } - (function (matrixproto) { - /*\ - * Matrix.add - [ method ] - ** - * Adds given matrix to existing one. - > Parameters - - a (number) - - b (number) - - c (number) - - d (number) - - e (number) - - f (number) - or - - matrix (object) @Matrix - \*/ - matrixproto.add = function (a, b, c, d, e, f) { - var out = [[], [], []], - m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]], - matrix = [[a, c, e], [b, d, f], [0, 0, 1]], - x, y, z, res; - - if (a && a instanceof Matrix) { - matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]]; - } - - for (x = 0; x < 3; x++) { - for (y = 0; y < 3; y++) { - res = 0; - for (z = 0; z < 3; z++) { - res += m[x][z] * matrix[z][y]; - } - out[x][y] = res; - } - } - this.a = out[0][0]; - this.b = out[1][0]; - this.c = out[0][1]; - this.d = out[1][1]; - this.e = out[0][2]; - this.f = out[1][2]; - }; - /*\ - * Matrix.invert - [ method ] - ** - * Returns inverted version of the matrix - = (object) @Matrix - \*/ - matrixproto.invert = function () { - var me = this, - x = me.a * me.d - me.b * me.c; - return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x); - }; - /*\ - * Matrix.clone - [ method ] - ** - * Returns copy of the matrix - = (object) @Matrix - \*/ - matrixproto.clone = function () { - return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f); - }; - /*\ - * Matrix.translate - [ method ] - ** - * Translate the matrix - > Parameters - - x (number) - - y (number) - \*/ - matrixproto.translate = function (x, y) { - this.add(1, 0, 0, 1, x, y); - }; - /*\ - * Matrix.scale - [ method ] - ** - * Scales the matrix - > Parameters - - x (number) - - y (number) #optional - - cx (number) #optional - - cy (number) #optional - \*/ - matrixproto.scale = function (x, y, cx, cy) { - y == null && (y = x); - (cx || cy) && this.add(1, 0, 0, 1, cx, cy); - this.add(x, 0, 0, y, 0, 0); - (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy); - }; - /*\ - * Matrix.rotate - [ method ] - ** - * Rotates the matrix - > Parameters - - a (number) - - x (number) - - y (number) - \*/ - matrixproto.rotate = function (a, x, y) { - a = R.rad(a); - x = x || 0; - y = y || 0; - var cos = +math.cos(a).toFixed(9), - sin = +math.sin(a).toFixed(9); - this.add(cos, sin, -sin, cos, x, y); - this.add(1, 0, 0, 1, -x, -y); - }; - /*\ - * Matrix.x - [ method ] - ** - * Return x coordinate for given point after transformation described by the matrix. See also @Matrix.y - > Parameters - - x (number) - - y (number) - = (number) x - \*/ - matrixproto.x = function (x, y) { - return x * this.a + y * this.c + this.e; - }; - /*\ - * Matrix.y - [ method ] - ** - * Return y coordinate for given point after transformation described by the matrix. See also @Matrix.x - > Parameters - - x (number) - - y (number) - = (number) y - \*/ - matrixproto.y = function (x, y) { - return x * this.b + y * this.d + this.f; - }; - matrixproto.get = function (i) { - return +this[Str.fromCharCode(97 + i)].toFixed(4); - }; - matrixproto.toString = function () { - return R.svg ? - "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")" : - [this.get(0), this.get(2), this.get(1), this.get(3), 0, 0].join(); - }; - matrixproto.toFilter = function () { - return "progid:DXImageTransform.Microsoft.Matrix(M11=" + this.get(0) + - ", M12=" + this.get(2) + ", M21=" + this.get(1) + ", M22=" + this.get(3) + - ", Dx=" + this.get(4) + ", Dy=" + this.get(5) + ", sizingmethod='auto expand')"; - }; - matrixproto.offset = function () { - return [this.e.toFixed(4), this.f.toFixed(4)]; - }; - function norm(a) { - return a[0] * a[0] + a[1] * a[1]; - } - function normalize(a) { - var mag = math.sqrt(norm(a)); - a[0] && (a[0] /= mag); - a[1] && (a[1] /= mag); - } - /*\ - * Matrix.split - [ method ] - ** - * Splits matrix into primitive transformations - = (object) in format: - o dx (number) translation by x - o dy (number) translation by y - o scalex (number) scale by x - o scaley (number) scale by y - o shear (number) shear - o rotate (number) rotation in deg - o isSimple (boolean) could it be represented via simple transformations - \*/ - matrixproto.split = function () { - var out = {}; - // translation - out.dx = this.e; - out.dy = this.f; - - // scale and shear - var row = [[this.a, this.c], [this.b, this.d]]; - out.scalex = math.sqrt(norm(row[0])); - normalize(row[0]); - - out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1]; - row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear]; - - out.scaley = math.sqrt(norm(row[1])); - normalize(row[1]); - out.shear /= out.scaley; - - // rotation - var sin = -row[0][1], - cos = row[1][1]; - if (cos < 0) { - out.rotate = R.deg(math.acos(cos)); - if (sin < 0) { - out.rotate = 360 - out.rotate; - } - } else { - out.rotate = R.deg(math.asin(sin)); - } - - out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate); - out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate; - out.noRotation = !+out.shear.toFixed(9) && !out.rotate; - return out; - }; - /*\ - * Matrix.toTransformString - [ method ] - ** - * Return transform string that represents given matrix - = (string) transform string - \*/ - matrixproto.toTransformString = function (shorter) { - var s = shorter || this[split](); - if (s.isSimple) { - s.scalex = +s.scalex.toFixed(4); - s.scaley = +s.scaley.toFixed(4); - s.rotate = +s.rotate.toFixed(4); - return (s.dx || s.dy ? "t" + [s.dx, s.dy] : E) + - (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) + - (s.rotate ? "r" + [s.rotate, 0, 0] : E); - } else { - return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)]; - } - }; - })(Matrix.prototype); - - var preventDefault = function () { - this.returnValue = false; - }, - preventTouch = function () { - return this.originalEvent.preventDefault(); - }, - stopPropagation = function () { - this.cancelBubble = true; - }, - stopTouch = function () { - return this.originalEvent.stopPropagation(); - }, - getEventPosition = function (e) { - var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft; - - return { - x: e.clientX + scrollX, - y: e.clientY + scrollY - }; - }, - addEvent = (function () { - if (g.doc.addEventListener) { - return function (obj, type, fn, element) { - var f = function (e) { - var pos = getEventPosition(e); - return fn.call(element, e, pos.x, pos.y); - }; - obj.addEventListener(type, f, false); - - if (supportsTouch && touchMap[type]) { - var _f = function (e) { - var pos = getEventPosition(e), - olde = e; - - for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) { - if (e.targetTouches[i].target == obj) { - e = e.targetTouches[i]; - e.originalEvent = olde; - e.preventDefault = preventTouch; - e.stopPropagation = stopTouch; - break; - } - } - - return fn.call(element, e, pos.x, pos.y); - }; - obj.addEventListener(touchMap[type], _f, false); - } - - return function () { - obj.removeEventListener(type, f, false); - - if (supportsTouch && touchMap[type]) - obj.removeEventListener(touchMap[type], _f, false); - - return true; - }; - }; - } else if (g.doc.attachEvent) { - return function (obj, type, fn, element) { - var f = function (e) { - e = e || g.win.event; - var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, - x = e.clientX + scrollX, - y = e.clientY + scrollY; - e.preventDefault = e.preventDefault || preventDefault; - e.stopPropagation = e.stopPropagation || stopPropagation; - return fn.call(element, e, x, y); - }; - obj.attachEvent("on" + type, f); - var detacher = function () { - obj.detachEvent("on" + type, f); - return true; - }; - return detacher; - }; - } - })(), - drag = [], - dragMove = function (e) { - var x = e.clientX, - y = e.clientY, - scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, - dragi, - j = drag.length; - while (j--) { - dragi = drag[j]; - if (supportsTouch && e.touches) { - var i = e.touches.length, - touch; - while (i--) { - touch = e.touches[i]; - if (touch.identifier == dragi.el._drag.id) { - x = touch.clientX; - y = touch.clientY; - (e.originalEvent ? e.originalEvent : e).preventDefault(); - break; - } - } - } else { - e.preventDefault(); - } - var node = dragi.el.node, - o, - next = node.nextSibling, - parent = node.parentNode, - display = node.style.display; - g.win.opera && parent.removeChild(node); - node.style.display = "none"; - o = dragi.el.paper.getElementByPoint(x, y); - node.style.display = display; - g.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node)); - o && eve("raphael.drag.over." + dragi.el.id, dragi.el, o); - x += scrollX; - y += scrollY; - eve("raphael.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e); - } - }, - dragUp = function (e) { - R.unmousemove(dragMove).unmouseup(dragUp); - var i = drag.length, - dragi; - while (i--) { - dragi = drag[i]; - dragi.el._drag = {}; - eve("raphael.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e); - } - drag = []; - }, - /*\ - * Raphael.el - [ property (object) ] - ** - * You can add your own method to elements. This is useful when you want to hack default functionality or - * want to wrap some common transformation or attributes in one method. In difference to canvas methods, - * you can redefine element method at any time. Expending element methods wouldn’t affect set. - > Usage - | Raphael.el.red = function () { - | this.attr({fill: "#f00"}); - | }; - | // then use it - | paper.circle(100, 100, 20).red(); - \*/ - elproto = R.el = {}; - /*\ - * Element.click - [ method ] - ** - * Adds event handler for click for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.unclick - [ method ] - ** - * Removes event handler for click for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.dblclick - [ method ] - ** - * Adds event handler for double click for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.undblclick - [ method ] - ** - * Removes event handler for double click for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.mousedown - [ method ] - ** - * Adds event handler for mousedown for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.unmousedown - [ method ] - ** - * Removes event handler for mousedown for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.mousemove - [ method ] - ** - * Adds event handler for mousemove for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.unmousemove - [ method ] - ** - * Removes event handler for mousemove for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.mouseout - [ method ] - ** - * Adds event handler for mouseout for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.unmouseout - [ method ] - ** - * Removes event handler for mouseout for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.mouseover - [ method ] - ** - * Adds event handler for mouseover for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.unmouseover - [ method ] - ** - * Removes event handler for mouseover for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.mouseup - [ method ] - ** - * Adds event handler for mouseup for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.unmouseup - [ method ] - ** - * Removes event handler for mouseup for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.touchstart - [ method ] - ** - * Adds event handler for touchstart for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.untouchstart - [ method ] - ** - * Removes event handler for touchstart for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.touchmove - [ method ] - ** - * Adds event handler for touchmove for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.untouchmove - [ method ] - ** - * Removes event handler for touchmove for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.touchend - [ method ] - ** - * Adds event handler for touchend for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.untouchend - [ method ] - ** - * Removes event handler for touchend for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - - /*\ - * Element.touchcancel - [ method ] - ** - * Adds event handler for touchcancel for the element. - > Parameters - - handler (function) handler for the event - = (object) @Element - \*/ - /*\ - * Element.untouchcancel - [ method ] - ** - * Removes event handler for touchcancel for the element. - > Parameters - - handler (function) #optional handler for the event - = (object) @Element - \*/ - for (var i = events.length; i--;) { - (function (eventName) { - R[eventName] = elproto[eventName] = function (fn, scope) { - if (R.is(fn, "function")) { - this.events = this.events || []; - this.events.push({name: eventName, f: fn, unbind: addEvent(this.shape || this.node || g.doc, eventName, fn, scope || this)}); - } - return this; - }; - R["un" + eventName] = elproto["un" + eventName] = function (fn) { - var events = this.events || [], - l = events.length; - while (l--){ - if (events[l].name == eventName && (R.is(fn, "undefined") || events[l].f == fn)) { - events[l].unbind(); - events.splice(l, 1); - !events.length && delete this.events; - } - } - return this; - }; - })(events[i]); - } - - /*\ - * Element.data - [ method ] - ** - * Adds or retrieves given value associated with given key. - ** - * See also @Element.removeData - > Parameters - - key (string) key to store data - - value (any) #optional value to store - = (object) @Element - * or, if value is not specified: - = (any) value - * or, if key and value are not specified: - = (object) Key/value pairs for all the data associated with the element. - > Usage - | for (var i = 0, i < 5, i++) { - | paper.circle(10 + 15 * i, 10, 10) - | .attr({fill: "#000"}) - | .data("i", i) - | .click(function () { - | alert(this.data("i")); - | }); - | } - \*/ - elproto.data = function (key, value) { - var data = eldata[this.id] = eldata[this.id] || {}; - if (arguments.length == 0) { - return data; - } - if (arguments.length == 1) { - if (R.is(key, "object")) { - for (var i in key) if (key[has](i)) { - this.data(i, key[i]); - } - return this; - } - eve("raphael.data.get." + this.id, this, data[key], key); - return data[key]; - } - data[key] = value; - eve("raphael.data.set." + this.id, this, value, key); - return this; - }; - /*\ - * Element.removeData - [ method ] - ** - * Removes value associated with an element by given key. - * If key is not provided, removes all the data of the element. - > Parameters - - key (string) #optional key - = (object) @Element - \*/ - elproto.removeData = function (key) { - if (key == null) { - delete eldata[this.id]; - } else { - eldata[this.id] && delete eldata[this.id][key]; - } - return this; - }; - /*\ - * Element.getData - [ method ] - ** - * Retrieves the element data - = (object) data - \*/ - elproto.getData = function () { - return clone(eldata[this.id] || {}); - }; - /*\ - * Element.hover - [ method ] - ** - * Adds event handlers for hover for the element. - > Parameters - - f_in (function) handler for hover in - - f_out (function) handler for hover out - - icontext (object) #optional context for hover in handler - - ocontext (object) #optional context for hover out handler - = (object) @Element - \*/ - elproto.hover = function (f_in, f_out, scope_in, scope_out) { - return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in); - }; - /*\ - * Element.unhover - [ method ] - ** - * Removes event handlers for hover for the element. - > Parameters - - f_in (function) handler for hover in - - f_out (function) handler for hover out - = (object) @Element - \*/ - elproto.unhover = function (f_in, f_out) { - return this.unmouseover(f_in).unmouseout(f_out); - }; - var draggable = []; - /*\ - * Element.drag - [ method ] - ** - * Adds event handlers for drag of the element. - > Parameters - - onmove (function) handler for moving - - onstart (function) handler for drag start - - onend (function) handler for drag end - - mcontext (object) #optional context for moving handler - - scontext (object) #optional context for drag start handler - - econtext (object) #optional context for drag end handler - * Additionally following `drag` events will be triggered: `drag.start.` on start, - * `drag.end.` on end and `drag.move.` on every move. When element will be dragged over another element - * `drag.over.` will be fired as well. - * - * Start event and start handler will be called in specified context or in context of the element with following parameters: - o x (number) x position of the mouse - o y (number) y position of the mouse - o event (object) DOM event object - * Move event and move handler will be called in specified context or in context of the element with following parameters: - o dx (number) shift by x from the start point - o dy (number) shift by y from the start point - o x (number) x position of the mouse - o y (number) y position of the mouse - o event (object) DOM event object - * End event and end handler will be called in specified context or in context of the element with following parameters: - o event (object) DOM event object - = (object) @Element - \*/ - elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) { - function start(e) { - (e.originalEvent || e).preventDefault(); - var x = e.clientX, - y = e.clientY, - scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft; - this._drag.id = e.identifier; - if (supportsTouch && e.touches) { - var i = e.touches.length, touch; - while (i--) { - touch = e.touches[i]; - this._drag.id = touch.identifier; - if (touch.identifier == this._drag.id) { - x = touch.clientX; - y = touch.clientY; - break; - } - } - } - this._drag.x = x + scrollX; - this._drag.y = y + scrollY; - !drag.length && R.mousemove(dragMove).mouseup(dragUp); - drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope}); - onstart && eve.on("raphael.drag.start." + this.id, onstart); - onmove && eve.on("raphael.drag.move." + this.id, onmove); - onend && eve.on("raphael.drag.end." + this.id, onend); - eve("raphael.drag.start." + this.id, start_scope || move_scope || this, this._drag.x, this._drag.y, e); - } - this._drag = {}; - draggable.push({el: this, start: start}); - this.mousedown(start); - return this; - }; - /*\ - * Element.onDragOver - [ method ] - ** - * Shortcut for assigning event handler for `drag.over.` event, where id is id of the element (see @Element.id). - > Parameters - - f (function) handler for event, first argument would be the element you are dragging over - \*/ - elproto.onDragOver = function (f) { - f ? eve.on("raphael.drag.over." + this.id, f) : eve.unbind("raphael.drag.over." + this.id); - }; - /*\ - * Element.undrag - [ method ] - ** - * Removes all drag event handlers from given element. - \*/ - elproto.undrag = function () { - var i = draggable.length; - while (i--) if (draggable[i].el == this) { - this.unmousedown(draggable[i].start); - draggable.splice(i, 1); - eve.unbind("raphael.drag.*." + this.id); - } - !draggable.length && R.unmousemove(dragMove).unmouseup(dragUp); - drag = []; - }; - /*\ - * Paper.circle - [ method ] - ** - * Draws a circle. - ** - > Parameters - ** - - x (number) x coordinate of the centre - - y (number) y coordinate of the centre - - r (number) radius - = (object) Raphaël element object with type “circle” - ** - > Usage - | var c = paper.circle(50, 50, 40); - \*/ - paperproto.circle = function (x, y, r) { - var out = R._engine.circle(this, x || 0, y || 0, r || 0); - this.__set__ && this.__set__.push(out); - return out; - }; - /*\ - * Paper.rect - [ method ] - * - * Draws a rectangle. - ** - > Parameters - ** - - x (number) x coordinate of the top left corner - - y (number) y coordinate of the top left corner - - width (number) width - - height (number) height - - r (number) #optional radius for rounded corners, default is 0 - = (object) Raphaël element object with type “rect” - ** - > Usage - | // regular rectangle - | var c = paper.rect(10, 10, 50, 50); - | // rectangle with rounded corners - | var c = paper.rect(40, 40, 50, 50, 10); - \*/ - paperproto.rect = function (x, y, w, h, r) { - var out = R._engine.rect(this, x || 0, y || 0, w || 0, h || 0, r || 0); - this.__set__ && this.__set__.push(out); - return out; - }; - /*\ - * Paper.ellipse - [ method ] - ** - * Draws an ellipse. - ** - > Parameters - ** - - x (number) x coordinate of the centre - - y (number) y coordinate of the centre - - rx (number) horizontal radius - - ry (number) vertical radius - = (object) Raphaël element object with type “ellipse” - ** - > Usage - | var c = paper.ellipse(50, 50, 40, 20); - \*/ - paperproto.ellipse = function (x, y, rx, ry) { - var out = R._engine.ellipse(this, x || 0, y || 0, rx || 0, ry || 0); - this.__set__ && this.__set__.push(out); - return out; - }; - /*\ - * Paper.path - [ method ] - ** - * Creates a path element by given path data string. - > Parameters - - pathString (string) #optional path string in SVG format. - * Path string consists of one-letter commands, followed by comma seprarated arguments in numercal form. Example: - | "M10,20L30,40" - * Here we can see two commands: “M”, with arguments `(10, 20)` and “L” with arguments `(30, 40)`. Upper case letter mean command is absolute, lower case—relative. - * - #

Here is short list of commands available, for more details see SVG path string format.

- # - # - # - # - # - # - # - # - # - # - # - #
CommandNameParameters
Mmoveto(x y)+
Zclosepath(none)
Llineto(x y)+
Hhorizontal linetox+
Vvertical linetoy+
Ccurveto(x1 y1 x2 y2 x y)+
Ssmooth curveto(x2 y2 x y)+
Qquadratic Bézier curveto(x1 y1 x y)+
Tsmooth quadratic Bézier curveto(x y)+
Aelliptical arc(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
RCatmull-Rom curveto*x1 y1 (x y)+
- * * “Catmull-Rom curveto” is a not standard SVG command and added in 2.0 to make life easier. - * Note: there is a special case when path consist of just three commands: “M10,10R…z”. In this case path will smoothly connects to its beginning. - > Usage - | var c = paper.path("M10 10L90 90"); - | // draw a diagonal line: - | // move to 10,10, line to 90,90 - * For example of path strings, check out these icons: http://raphaeljs.com/icons/ - \*/ - paperproto.path = function (pathString) { - pathString && !R.is(pathString, string) && !R.is(pathString[0], array) && (pathString += E); - var out = R._engine.path(R.format[apply](R, arguments), this); - this.__set__ && this.__set__.push(out); - return out; - }; - /*\ - * Paper.image - [ method ] - ** - * Embeds an image into the surface. - ** - > Parameters - ** - - src (string) URI of the source image - - x (number) x coordinate position - - y (number) y coordinate position - - width (number) width of the image - - height (number) height of the image - = (object) Raphaël element object with type “image” - ** - > Usage - | var c = paper.image("apple.png", 10, 10, 80, 80); - \*/ - paperproto.image = function (src, x, y, w, h) { - var out = R._engine.image(this, src || "about:blank", x || 0, y || 0, w || 0, h || 0); - this.__set__ && this.__set__.push(out); - return out; - }; - /*\ - * Paper.text - [ method ] - ** - * Draws a text string. If you need line breaks, put “\n” in the string. - ** - > Parameters - ** - - x (number) x coordinate position - - y (number) y coordinate position - - text (string) The text string to draw - = (object) Raphaël element object with type “text” - ** - > Usage - | var t = paper.text(50, 50, "Raphaël\nkicks\nbutt!"); - \*/ - paperproto.text = function (x, y, text) { - var out = R._engine.text(this, x || 0, y || 0, Str(text)); - this.__set__ && this.__set__.push(out); - return out; - }; - /*\ - * Paper.set - [ method ] - ** - * Creates array-like object to keep and operate several elements at once. - * Warning: it doesn’t create any elements for itself in the page, it just groups existing elements. - * Sets act as pseudo elements — all methods available to an element can be used on a set. - = (object) array-like object that represents set of elements - ** - > Usage - | var st = paper.set(); - | st.push( - | paper.circle(10, 10, 5), - | paper.circle(30, 10, 5) - | ); - | st.attr({fill: "red"}); // changes the fill of both circles - \*/ - paperproto.set = function (itemsArray) { - !R.is(itemsArray, "array") && (itemsArray = Array.prototype.splice.call(arguments, 0, arguments.length)); - var out = new Set(itemsArray); - this.__set__ && this.__set__.push(out); - out["paper"] = this; - out["type"] = "set"; - return out; - }; - /*\ - * Paper.setStart - [ method ] - ** - * Creates @Paper.set. All elements that will be created after calling this method and before calling - * @Paper.setFinish will be added to the set. - ** - > Usage - | paper.setStart(); - | paper.circle(10, 10, 5), - | paper.circle(30, 10, 5) - | var st = paper.setFinish(); - | st.attr({fill: "red"}); // changes the fill of both circles - \*/ - paperproto.setStart = function (set) { - this.__set__ = set || this.set(); - }; - /*\ - * Paper.setFinish - [ method ] - ** - * See @Paper.setStart. This method finishes catching and returns resulting set. - ** - = (object) set - \*/ - paperproto.setFinish = function (set) { - var out = this.__set__; - delete this.__set__; - return out; - }; - /*\ - * Paper.getSize - [ method ] - ** - * Obtains current paper actual size. - ** - = (object) - \*/ - paperproto.getSize = function () { - var container = this.canvas.parentNode; - return { - width: container.offsetWidth, - height: container.offsetHeight - }; - }; - /*\ - * Paper.setSize - [ method ] - ** - * If you need to change dimensions of the canvas call this method - ** - > Parameters - ** - - width (number) new width of the canvas - - height (number) new height of the canvas - \*/ - paperproto.setSize = function (width, height) { - return R._engine.setSize.call(this, width, height); - }; - /*\ - * Paper.setViewBox - [ method ] - ** - * Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by - * specifying new boundaries. - ** - > Parameters - ** - - x (number) new x position, default is `0` - - y (number) new y position, default is `0` - - w (number) new width of the canvas - - h (number) new height of the canvas - - fit (boolean) `true` if you want graphics to fit into new boundary box - \*/ - paperproto.setViewBox = function (x, y, w, h, fit) { - return R._engine.setViewBox.call(this, x, y, w, h, fit); - }; - /*\ - * Paper.top - [ property ] - ** - * Points to the topmost element on the paper - \*/ - /*\ - * Paper.bottom - [ property ] - ** - * Points to the bottom element on the paper - \*/ - paperproto.top = paperproto.bottom = null; - /*\ - * Paper.raphael - [ property ] - ** - * Points to the @Raphael object/function - \*/ - paperproto.raphael = R; - var getOffset = function (elem) { - var box = elem.getBoundingClientRect(), - doc = elem.ownerDocument, - body = doc.body, - docElem = doc.documentElement, - clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, - top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop, - left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft; - return { - y: top, - x: left - }; - }; - /*\ - * Paper.getElementByPoint - [ method ] - ** - * Returns you topmost element under given point. - ** - = (object) Raphaël element object - > Parameters - ** - - x (number) x coordinate from the top left corner of the window - - y (number) y coordinate from the top left corner of the window - > Usage - | paper.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"}); - \*/ - paperproto.getElementByPoint = function (x, y) { - var paper = this, - svg = paper.canvas, - target = g.doc.elementFromPoint(x, y); - if (g.win.opera && target.tagName == "svg") { - var so = getOffset(svg), - sr = svg.createSVGRect(); - sr.x = x - so.x; - sr.y = y - so.y; - sr.width = sr.height = 1; - var hits = svg.getIntersectionList(sr, null); - if (hits.length) { - target = hits[hits.length - 1]; - } - } - if (!target) { - return null; - } - while (target.parentNode && target != svg.parentNode && !target.raphael) { - target = target.parentNode; - } - target == paper.canvas.parentNode && (target = svg); - target = target && target.raphael ? paper.getById(target.raphaelid) : null; - return target; - }; - - /*\ - * Paper.getElementsByBBox - [ method ] - ** - * Returns set of elements that have an intersecting bounding box - ** - > Parameters - ** - - bbox (object) bbox to check with - = (object) @Set - \*/ - paperproto.getElementsByBBox = function (bbox) { - var set = this.set(); - this.forEach(function (el) { - if (R.isBBoxIntersect(el.getBBox(), bbox)) { - set.push(el); - } - }); - return set; - }; - - /*\ - * Paper.getById - [ method ] - ** - * Returns you element by its internal ID. - ** - > Parameters - ** - - id (number) id - = (object) Raphaël element object - \*/ - paperproto.getById = function (id) { - var bot = this.bottom; - while (bot) { - if (bot.id == id) { - return bot; - } - bot = bot.next; - } - return null; - }; - /*\ - * Paper.forEach - [ method ] - ** - * Executes given function for each element on the paper - * - * If callback function returns `false` it will stop loop running. - ** - > Parameters - ** - - callback (function) function to run - - thisArg (object) context object for the callback - = (object) Paper object - > Usage - | paper.forEach(function (el) { - | el.attr({ stroke: "blue" }); - | }); - \*/ - paperproto.forEach = function (callback, thisArg) { - var bot = this.bottom; - while (bot) { - if (callback.call(thisArg, bot) === false) { - return this; - } - bot = bot.next; - } - return this; - }; - /*\ - * Paper.getElementsByPoint - [ method ] - ** - * Returns set of elements that have common point inside - ** - > Parameters - ** - - x (number) x coordinate of the point - - y (number) y coordinate of the point - = (object) @Set - \*/ - paperproto.getElementsByPoint = function (x, y) { - var set = this.set(); - this.forEach(function (el) { - if (el.isPointInside(x, y)) { - set.push(el); - } - }); - return set; - }; - function x_y() { - return this.x + S + this.y; - } - function x_y_w_h() { - return this.x + S + this.y + S + this.width + " \xd7 " + this.height; - } - /*\ - * Element.isPointInside - [ method ] - ** - * Determine if given point is inside this element’s shape - ** - > Parameters - ** - - x (number) x coordinate of the point - - y (number) y coordinate of the point - = (boolean) `true` if point inside the shape - \*/ - elproto.isPointInside = function (x, y) { - var rp = this.realPath = getPath[this.type](this); - if (this.attr('transform') && this.attr('transform').length) { - rp = R.transformPath(rp, this.attr('transform')); - } - return R.isPointInsidePath(rp, x, y); - }; - /*\ - * Element.getBBox - [ method ] - ** - * Return bounding box for a given element - ** - > Parameters - ** - - isWithoutTransform (boolean) flag, `true` if you want to have bounding box before transformations. Default is `false`. - = (object) Bounding box object: - o { - o x: (number) top left corner x - o y: (number) top left corner y - o x2: (number) bottom right corner x - o y2: (number) bottom right corner y - o width: (number) width - o height: (number) height - o } - \*/ - elproto.getBBox = function (isWithoutTransform) { - if (this.removed) { - return {}; - } - var _ = this._; - if (isWithoutTransform) { - if (_.dirty || !_.bboxwt) { - this.realPath = getPath[this.type](this); - _.bboxwt = pathDimensions(this.realPath); - _.bboxwt.toString = x_y_w_h; - _.dirty = 0; - } - return _.bboxwt; - } - if (_.dirty || _.dirtyT || !_.bbox) { - if (_.dirty || !this.realPath) { - _.bboxwt = 0; - this.realPath = getPath[this.type](this); - } - _.bbox = pathDimensions(mapPath(this.realPath, this.matrix)); - _.bbox.toString = x_y_w_h; - _.dirty = _.dirtyT = 0; - } - return _.bbox; - }; - /*\ - * Element.clone - [ method ] - ** - = (object) clone of a given element - ** - \*/ - elproto.clone = function () { - if (this.removed) { - return null; - } - var out = this.paper[this.type]().attr(this.attr()); - this.__set__ && this.__set__.push(out); - return out; - }; - /*\ - * Element.glow - [ method ] - ** - * Return set of elements that create glow-like effect around given element. See @Paper.set. - * - * Note: Glow is not connected to the element. If you change element attributes it won’t adjust itself. - ** - > Parameters - ** - - glow (object) #optional parameters object with all properties optional: - o { - o width (number) size of the glow, default is `10` - o fill (boolean) will it be filled, default is `false` - o opacity (number) opacity, default is `0.5` - o offsetx (number) horizontal offset, default is `0` - o offsety (number) vertical offset, default is `0` - o color (string) glow colour, default is `black` - o } - = (object) @Paper.set of elements that represents glow - \*/ - elproto.glow = function (glow) { - if (this.type == "text") { - return null; - } - glow = glow || {}; - var s = { - width: (glow.width || 10) + (+this.attr("stroke-width") || 1), - fill: glow.fill || false, - opacity: glow.opacity == null ? .5 : glow.opacity, - offsetx: glow.offsetx || 0, - offsety: glow.offsety || 0, - color: glow.color || "#000" - }, - c = s.width / 2, - r = this.paper, - out = r.set(), - path = this.realPath || getPath[this.type](this); - path = this.matrix ? mapPath(path, this.matrix) : path; - for (var i = 1; i < c + 1; i++) { - out.push(r.path(path).attr({ - stroke: s.color, - fill: s.fill ? s.color : "none", - "stroke-linejoin": "round", - "stroke-linecap": "round", - "stroke-width": +(s.width / c * i).toFixed(3), - opacity: +(s.opacity / c).toFixed(3) - })); - } - return out.insertBefore(this).translate(s.offsetx, s.offsety); - }; - var curveslengths = {}, - getPointAtSegmentLength = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) { - if (length == null) { - return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y); - } else { - return R.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, getTatLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length)); - } - }, - getLengthFactory = function (istotal, subpath) { - return function (path, length, onlystart) { - path = path2curve(path); - var x, y, p, l, sp = "", subpaths = {}, point, - len = 0; - for (var i = 0, ii = path.length; i < ii; i++) { - p = path[i]; - if (p[0] == "M") { - x = +p[1]; - y = +p[2]; - } else { - l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]); - if (len + l > length) { - if (subpath && !subpaths.start) { - point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len); - sp += ["C" + point.start.x, point.start.y, point.m.x, point.m.y, point.x, point.y]; - if (onlystart) {return sp;} - subpaths.start = sp; - sp = ["M" + point.x, point.y + "C" + point.n.x, point.n.y, point.end.x, point.end.y, p[5], p[6]].join(); - len += l; - x = +p[5]; - y = +p[6]; - continue; - } - if (!istotal && !subpath) { - point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len); - return {x: point.x, y: point.y, alpha: point.alpha}; - } - } - len += l; - x = +p[5]; - y = +p[6]; - } - sp += p.shift() + p; - } - subpaths.end = sp; - point = istotal ? len : subpath ? subpaths : R.findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1); - point.alpha && (point = {x: point.x, y: point.y, alpha: point.alpha}); - return point; - }; - }; - var getTotalLength = getLengthFactory(1), - getPointAtLength = getLengthFactory(), - getSubpathsAtLength = getLengthFactory(0, 1); - /*\ - * Raphael.getTotalLength - [ method ] - ** - * Returns length of the given path in pixels. - ** - > Parameters - ** - - path (string) SVG path string. - ** - = (number) length. - \*/ - R.getTotalLength = getTotalLength; - /*\ - * Raphael.getPointAtLength - [ method ] - ** - * Return coordinates of the point located at the given length on the given path. - ** - > Parameters - ** - - path (string) SVG path string - - length (number) - ** - = (object) representation of the point: - o { - o x: (number) x coordinate - o y: (number) y coordinate - o alpha: (number) angle of derivative - o } - \*/ - R.getPointAtLength = getPointAtLength; - /*\ - * Raphael.getSubpath - [ method ] - ** - * Return subpath of a given path from given length to given length. - ** - > Parameters - ** - - path (string) SVG path string - - from (number) position of the start of the segment - - to (number) position of the end of the segment - ** - = (string) pathstring for the segment - \*/ - R.getSubpath = function (path, from, to) { - if (this.getTotalLength(path) - to < 1e-6) { - return getSubpathsAtLength(path, from).end; - } - var a = getSubpathsAtLength(path, to, 1); - return from ? getSubpathsAtLength(a, from).end : a; - }; - /*\ - * Element.getTotalLength - [ method ] - ** - * Returns length of the path in pixels. Only works for element of “path” type. - = (number) length. - \*/ - elproto.getTotalLength = function () { - var path = this.getPath(); - if (!path) { - return; - } - - if (this.node.getTotalLength) { - return this.node.getTotalLength(); - } - - return getTotalLength(path); - }; - /*\ - * Element.getPointAtLength - [ method ] - ** - * Return coordinates of the point located at the given length on the given path. Only works for element of “path” type. - ** - > Parameters - ** - - length (number) - ** - = (object) representation of the point: - o { - o x: (number) x coordinate - o y: (number) y coordinate - o alpha: (number) angle of derivative - o } - \*/ - elproto.getPointAtLength = function (length) { - var path = this.getPath(); - if (!path) { - return; - } - - return getPointAtLength(path, length); - }; - /*\ - * Element.getPath - [ method ] - ** - * Returns path of the element. Only works for elements of “path” type and simple elements like circle. - = (object) path - ** - \*/ - elproto.getPath = function () { - var path, - getPath = R._getPath[this.type]; - - if (this.type == "text" || this.type == "set") { - return; - } - - if (getPath) { - path = getPath(this); - } - - return path; - }; - /*\ - * Element.getSubpath - [ method ] - ** - * Return subpath of a given element from given length to given length. Only works for element of “path” type. - ** - > Parameters - ** - - from (number) position of the start of the segment - - to (number) position of the end of the segment - ** - = (string) pathstring for the segment - \*/ - elproto.getSubpath = function (from, to) { - var path = this.getPath(); - if (!path) { - return; - } - - return R.getSubpath(path, from, to); - }; - /*\ - * Raphael.easing_formulas - [ property ] - ** - * Object that contains easing formulas for animation. You could extend it with your own. By default it has following list of easing: - #
    - #
  • “linear”
  • - #
  • “<” or “easeIn” or “ease-in”
  • - #
  • “>” or “easeOut” or “ease-out”
  • - #
  • “<>” or “easeInOut” or “ease-in-out”
  • - #
  • “backIn” or “back-in”
  • - #
  • “backOut” or “back-out”
  • - #
  • “elastic”
  • - #
  • “bounce”
  • - #
- #

See also Easing demo.

- \*/ - var ef = R.easing_formulas = { - linear: function (n) { - return n; - }, - "<": function (n) { - return pow(n, 1.7); - }, - ">": function (n) { - return pow(n, .48); - }, - "<>": function (n) { - var q = .48 - n / 1.04, - Q = math.sqrt(.1734 + q * q), - x = Q - q, - X = pow(abs(x), 1 / 3) * (x < 0 ? -1 : 1), - y = -Q - q, - Y = pow(abs(y), 1 / 3) * (y < 0 ? -1 : 1), - t = X + Y + .5; - return (1 - t) * 3 * t * t + t * t * t; - }, - backIn: function (n) { - var s = 1.70158; - return n * n * ((s + 1) * n - s); - }, - backOut: function (n) { - n = n - 1; - var s = 1.70158; - return n * n * ((s + 1) * n + s) + 1; - }, - elastic: function (n) { - if (n == !!n) { - return n; - } - return pow(2, -10 * n) * math.sin((n - .075) * (2 * PI) / .3) + 1; - }, - bounce: function (n) { - var s = 7.5625, - p = 2.75, - l; - if (n < (1 / p)) { - l = s * n * n; - } else { - if (n < (2 / p)) { - n -= (1.5 / p); - l = s * n * n + .75; - } else { - if (n < (2.5 / p)) { - n -= (2.25 / p); - l = s * n * n + .9375; - } else { - n -= (2.625 / p); - l = s * n * n + .984375; - } - } - } - return l; - } - }; - ef.easeIn = ef["ease-in"] = ef["<"]; - ef.easeOut = ef["ease-out"] = ef[">"]; - ef.easeInOut = ef["ease-in-out"] = ef["<>"]; - ef["back-in"] = ef.backIn; - ef["back-out"] = ef.backOut; - - var animationElements = [], - requestAnimFrame = window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function (callback) { - setTimeout(callback, 16); - }, - animation = function () { - var Now = +new Date, - l = 0; - for (; l < animationElements.length; l++) { - var e = animationElements[l]; - if (e.el.removed || e.paused) { - continue; - } - var time = Now - e.start, - ms = e.ms, - easing = e.easing, - from = e.from, - diff = e.diff, - to = e.to, - t = e.t, - that = e.el, - set = {}, - now, - init = {}, - key; - if (e.initstatus) { - time = (e.initstatus * e.anim.top - e.prev) / (e.percent - e.prev) * ms; - e.status = e.initstatus; - delete e.initstatus; - e.stop && animationElements.splice(l--, 1); - } else { - e.status = (e.prev + (e.percent - e.prev) * (time / ms)) / e.anim.top; - } - if (time < 0) { - continue; - } - if (time < ms) { - var pos = easing(time / ms); - for (var attr in from) if (from[has](attr)) { - switch (availableAnimAttrs[attr]) { - case nu: - now = +from[attr] + pos * ms * diff[attr]; - break; - case "colour": - now = "rgb(" + [ - upto255(round(from[attr].r + pos * ms * diff[attr].r)), - upto255(round(from[attr].g + pos * ms * diff[attr].g)), - upto255(round(from[attr].b + pos * ms * diff[attr].b)) - ].join(",") + ")"; - break; - case "path": - now = []; - for (var i = 0, ii = from[attr].length; i < ii; i++) { - now[i] = [from[attr][i][0]]; - for (var j = 1, jj = from[attr][i].length; j < jj; j++) { - now[i][j] = +from[attr][i][j] + pos * ms * diff[attr][i][j]; - } - now[i] = now[i].join(S); - } - now = now.join(S); - break; - case "transform": - if (diff[attr].real) { - now = []; - for (i = 0, ii = from[attr].length; i < ii; i++) { - now[i] = [from[attr][i][0]]; - for (j = 1, jj = from[attr][i].length; j < jj; j++) { - now[i][j] = from[attr][i][j] + pos * ms * diff[attr][i][j]; - } - } - } else { - var get = function (i) { - return +from[attr][i] + pos * ms * diff[attr][i]; - }; - // now = [["r", get(2), 0, 0], ["t", get(3), get(4)], ["s", get(0), get(1), 0, 0]]; - now = [["m", get(0), get(1), get(2), get(3), get(4), get(5)]]; - } - break; - case "csv": - if (attr == "clip-rect") { - now = []; - i = 4; - while (i--) { - now[i] = +from[attr][i] + pos * ms * diff[attr][i]; - } - } - break; - default: - var from2 = [][concat](from[attr]); - now = []; - i = that.paper.customAttributes[attr].length; - while (i--) { - now[i] = +from2[i] + pos * ms * diff[attr][i]; - } - break; - } - set[attr] = now; - } - that.attr(set); - (function (id, that, anim) { - setTimeout(function () { - eve("raphael.anim.frame." + id, that, anim); - }); - })(that.id, that, e.anim); - } else { - (function(f, el, a) { - setTimeout(function() { - eve("raphael.anim.frame." + el.id, el, a); - eve("raphael.anim.finish." + el.id, el, a); - R.is(f, "function") && f.call(el); - }); - })(e.callback, that, e.anim); - that.attr(to); - animationElements.splice(l--, 1); - if (e.repeat > 1 && !e.next) { - for (key in to) if (to[has](key)) { - init[key] = e.totalOrigin[key]; - } - e.el.attr(init); - runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1); - } - if (e.next && !e.stop) { - runAnimation(e.anim, e.el, e.next, null, e.totalOrigin, e.repeat); - } - } - } - animationElements.length && requestAnimFrame(animation); - }, - upto255 = function (color) { - return color > 255 ? 255 : color < 0 ? 0 : color; - }; - /*\ - * Element.animateWith - [ method ] - ** - * Acts similar to @Element.animate, but ensure that given animation runs in sync with another given element. - ** - > Parameters - ** - - el (object) element to sync with - - anim (object) animation to sync with - - params (object) #optional final attributes for the element, see also @Element.attr - - ms (number) #optional number of milliseconds for animation to run - - easing (string) #optional easing type. Accept on of @Raphael.easing_formulas or CSS format: `cubic‐bezier(XX, XX, XX, XX)` - - callback (function) #optional callback function. Will be called at the end of animation. - * or - - element (object) element to sync with - - anim (object) animation to sync with - - animation (object) #optional animation object, see @Raphael.animation - ** - = (object) original element - \*/ - elproto.animateWith = function (el, anim, params, ms, easing, callback) { - var element = this; - if (element.removed) { - callback && callback.call(element); - return element; - } - var a = params instanceof Animation ? params : R.animation(params, ms, easing, callback), - x, y; - runAnimation(a, element, a.percents[0], null, element.attr()); - for (var i = 0, ii = animationElements.length; i < ii; i++) { - if (animationElements[i].anim == anim && animationElements[i].el == el) { - animationElements[ii - 1].start = animationElements[i].start; - break; - } - } - return element; - // - // - // var a = params ? R.animation(params, ms, easing, callback) : anim, - // status = element.status(anim); - // return this.animate(a).status(a, status * anim.ms / a.ms); - }; - function CubicBezierAtTime(t, p1x, p1y, p2x, p2y, duration) { - var cx = 3 * p1x, - bx = 3 * (p2x - p1x) - cx, - ax = 1 - cx - bx, - cy = 3 * p1y, - by = 3 * (p2y - p1y) - cy, - ay = 1 - cy - by; - function sampleCurveX(t) { - return ((ax * t + bx) * t + cx) * t; - } - function solve(x, epsilon) { - var t = solveCurveX(x, epsilon); - return ((ay * t + by) * t + cy) * t; - } - function solveCurveX(x, epsilon) { - var t0, t1, t2, x2, d2, i; - for(t2 = x, i = 0; i < 8; i++) { - x2 = sampleCurveX(t2) - x; - if (abs(x2) < epsilon) { - return t2; - } - d2 = (3 * ax * t2 + 2 * bx) * t2 + cx; - if (abs(d2) < 1e-6) { - break; - } - t2 = t2 - x2 / d2; - } - t0 = 0; - t1 = 1; - t2 = x; - if (t2 < t0) { - return t0; - } - if (t2 > t1) { - return t1; - } - while (t0 < t1) { - x2 = sampleCurveX(t2); - if (abs(x2 - x) < epsilon) { - return t2; - } - if (x > x2) { - t0 = t2; - } else { - t1 = t2; - } - t2 = (t1 - t0) / 2 + t0; - } - return t2; - } - return solve(t, 1 / (200 * duration)); - } - elproto.onAnimation = function (f) { - f ? eve.on("raphael.anim.frame." + this.id, f) : eve.unbind("raphael.anim.frame." + this.id); - return this; - }; - function Animation(anim, ms) { - var percents = [], - newAnim = {}; - this.ms = ms; - this.times = 1; - if (anim) { - for (var attr in anim) if (anim[has](attr)) { - newAnim[toFloat(attr)] = anim[attr]; - percents.push(toFloat(attr)); - } - percents.sort(sortByNumber); - } - this.anim = newAnim; - this.top = percents[percents.length - 1]; - this.percents = percents; - } - /*\ - * Animation.delay - [ method ] - ** - * Creates a copy of existing animation object with given delay. - ** - > Parameters - ** - - delay (number) number of ms to pass between animation start and actual animation - ** - = (object) new altered Animation object - | var anim = Raphael.animation({cx: 10, cy: 20}, 2e3); - | circle1.animate(anim); // run the given animation immediately - | circle2.animate(anim.delay(500)); // run the given animation after 500 ms - \*/ - Animation.prototype.delay = function (delay) { - var a = new Animation(this.anim, this.ms); - a.times = this.times; - a.del = +delay || 0; - return a; - }; - /*\ - * Animation.repeat - [ method ] - ** - * Creates a copy of existing animation object with given repetition. - ** - > Parameters - ** - - repeat (number) number iterations of animation. For infinite animation pass `Infinity` - ** - = (object) new altered Animation object - \*/ - Animation.prototype.repeat = function (times) { - var a = new Animation(this.anim, this.ms); - a.del = this.del; - a.times = math.floor(mmax(times, 0)) || 1; - return a; - }; - function runAnimation(anim, element, percent, status, totalOrigin, times) { - percent = toFloat(percent); - var params, - isInAnim, - isInAnimSet, - percents = [], - next, - prev, - timestamp, - ms = anim.ms, - from = {}, - to = {}, - diff = {}; - if (status) { - for (i = 0, ii = animationElements.length; i < ii; i++) { - var e = animationElements[i]; - if (e.el.id == element.id && e.anim == anim) { - if (e.percent != percent) { - animationElements.splice(i, 1); - isInAnimSet = 1; - } else { - isInAnim = e; - } - element.attr(e.totalOrigin); - break; - } - } - } else { - status = +to; // NaN - } - for (var i = 0, ii = anim.percents.length; i < ii; i++) { - if (anim.percents[i] == percent || anim.percents[i] > status * anim.top) { - percent = anim.percents[i]; - prev = anim.percents[i - 1] || 0; - ms = ms / anim.top * (percent - prev); - next = anim.percents[i + 1]; - params = anim.anim[percent]; - break; - } else if (status) { - element.attr(anim.anim[anim.percents[i]]); - } - } - if (!params) { - return; - } - if (!isInAnim) { - for (var attr in params) if (params[has](attr)) { - if (availableAnimAttrs[has](attr) || element.paper.customAttributes[has](attr)) { - from[attr] = element.attr(attr); - (from[attr] == null) && (from[attr] = availableAttrs[attr]); - to[attr] = params[attr]; - switch (availableAnimAttrs[attr]) { - case nu: - diff[attr] = (to[attr] - from[attr]) / ms; - break; - case "colour": - from[attr] = R.getRGB(from[attr]); - var toColour = R.getRGB(to[attr]); - diff[attr] = { - r: (toColour.r - from[attr].r) / ms, - g: (toColour.g - from[attr].g) / ms, - b: (toColour.b - from[attr].b) / ms - }; - break; - case "path": - var pathes = path2curve(from[attr], to[attr]), - toPath = pathes[1]; - from[attr] = pathes[0]; - diff[attr] = []; - for (i = 0, ii = from[attr].length; i < ii; i++) { - diff[attr][i] = [0]; - for (var j = 1, jj = from[attr][i].length; j < jj; j++) { - diff[attr][i][j] = (toPath[i][j] - from[attr][i][j]) / ms; - } - } - break; - case "transform": - var _ = element._, - eq = equaliseTransform(_[attr], to[attr]); - if (eq) { - from[attr] = eq.from; - to[attr] = eq.to; - diff[attr] = []; - diff[attr].real = true; - for (i = 0, ii = from[attr].length; i < ii; i++) { - diff[attr][i] = [from[attr][i][0]]; - for (j = 1, jj = from[attr][i].length; j < jj; j++) { - diff[attr][i][j] = (to[attr][i][j] - from[attr][i][j]) / ms; - } - } - } else { - var m = (element.matrix || new Matrix), - to2 = { - _: {transform: _.transform}, - getBBox: function () { - return element.getBBox(1); - } - }; - from[attr] = [ - m.a, - m.b, - m.c, - m.d, - m.e, - m.f - ]; - extractTransform(to2, to[attr]); - to[attr] = to2._.transform; - diff[attr] = [ - (to2.matrix.a - m.a) / ms, - (to2.matrix.b - m.b) / ms, - (to2.matrix.c - m.c) / ms, - (to2.matrix.d - m.d) / ms, - (to2.matrix.e - m.e) / ms, - (to2.matrix.f - m.f) / ms - ]; - // from[attr] = [_.sx, _.sy, _.deg, _.dx, _.dy]; - // var to2 = {_:{}, getBBox: function () { return element.getBBox(); }}; - // extractTransform(to2, to[attr]); - // diff[attr] = [ - // (to2._.sx - _.sx) / ms, - // (to2._.sy - _.sy) / ms, - // (to2._.deg - _.deg) / ms, - // (to2._.dx - _.dx) / ms, - // (to2._.dy - _.dy) / ms - // ]; - } - break; - case "csv": - var values = Str(params[attr])[split](separator), - from2 = Str(from[attr])[split](separator); - if (attr == "clip-rect") { - from[attr] = from2; - diff[attr] = []; - i = from2.length; - while (i--) { - diff[attr][i] = (values[i] - from[attr][i]) / ms; - } - } - to[attr] = values; - break; - default: - values = [][concat](params[attr]); - from2 = [][concat](from[attr]); - diff[attr] = []; - i = element.paper.customAttributes[attr].length; - while (i--) { - diff[attr][i] = ((values[i] || 0) - (from2[i] || 0)) / ms; - } - break; - } - } - } - var easing = params.easing, - easyeasy = R.easing_formulas[easing]; - if (!easyeasy) { - easyeasy = Str(easing).match(bezierrg); - if (easyeasy && easyeasy.length == 5) { - var curve = easyeasy; - easyeasy = function (t) { - return CubicBezierAtTime(t, +curve[1], +curve[2], +curve[3], +curve[4], ms); - }; - } else { - easyeasy = pipe; - } - } - timestamp = params.start || anim.start || +new Date; - e = { - anim: anim, - percent: percent, - timestamp: timestamp, - start: timestamp + (anim.del || 0), - status: 0, - initstatus: status || 0, - stop: false, - ms: ms, - easing: easyeasy, - from: from, - diff: diff, - to: to, - el: element, - callback: params.callback, - prev: prev, - next: next, - repeat: times || anim.times, - origin: element.attr(), - totalOrigin: totalOrigin - }; - animationElements.push(e); - if (status && !isInAnim && !isInAnimSet) { - e.stop = true; - e.start = new Date - ms * status; - if (animationElements.length == 1) { - return animation(); - } - } - if (isInAnimSet) { - e.start = new Date - e.ms * status; - } - animationElements.length == 1 && requestAnimFrame(animation); - } else { - isInAnim.initstatus = status; - isInAnim.start = new Date - isInAnim.ms * status; - } - eve("raphael.anim.start." + element.id, element, anim); - } - /*\ - * Raphael.animation - [ method ] - ** - * Creates an animation object that can be passed to the @Element.animate or @Element.animateWith methods. - * See also @Animation.delay and @Animation.repeat methods. - ** - > Parameters - ** - - params (object) final attributes for the element, see also @Element.attr - - ms (number) number of milliseconds for animation to run - - easing (string) #optional easing type. Accept one of @Raphael.easing_formulas or CSS format: `cubic‐bezier(XX, XX, XX, XX)` - - callback (function) #optional callback function. Will be called at the end of animation. - ** - = (object) @Animation - \*/ - R.animation = function (params, ms, easing, callback) { - if (params instanceof Animation) { - return params; - } - if (R.is(easing, "function") || !easing) { - callback = callback || easing || null; - easing = null; - } - params = Object(params); - ms = +ms || 0; - var p = {}, - json, - attr; - for (attr in params) if (params[has](attr) && toFloat(attr) != attr && toFloat(attr) + "%" != attr) { - json = true; - p[attr] = params[attr]; - } - if (!json) { - // if percent-like syntax is used and end-of-all animation callback used - if(callback){ - // find the last one - var lastKey = 0; - for(var i in params){ - var percent = toInt(i); - if(params[has](i) && percent > lastKey){ - lastKey = percent; - } - } - lastKey += '%'; - // if already defined callback in the last keyframe, skip - !params[lastKey].callback && (params[lastKey].callback = callback); - } - return new Animation(params, ms); - } else { - easing && (p.easing = easing); - callback && (p.callback = callback); - return new Animation({100: p}, ms); - } - }; - /*\ - * Element.animate - [ method ] - ** - * Creates and starts animation for given element. - ** - > Parameters - ** - - params (object) final attributes for the element, see also @Element.attr - - ms (number) number of milliseconds for animation to run - - easing (string) #optional easing type. Accept one of @Raphael.easing_formulas or CSS format: `cubic‐bezier(XX, XX, XX, XX)` - - callback (function) #optional callback function. Will be called at the end of animation. - * or - - animation (object) animation object, see @Raphael.animation - ** - = (object) original element - \*/ - elproto.animate = function (params, ms, easing, callback) { - var element = this; - if (element.removed) { - callback && callback.call(element); - return element; - } - var anim = params instanceof Animation ? params : R.animation(params, ms, easing, callback); - runAnimation(anim, element, anim.percents[0], null, element.attr()); - return element; - }; - /*\ - * Element.setTime - [ method ] - ** - * Sets the status of animation of the element in milliseconds. Similar to @Element.status method. - ** - > Parameters - ** - - anim (object) animation object - - value (number) number of milliseconds from the beginning of the animation - ** - = (object) original element if `value` is specified - * Note, that during animation following events are triggered: - * - * On each animation frame event `anim.frame.`, on start `anim.start.` and on end `anim.finish.`. - \*/ - elproto.setTime = function (anim, value) { - if (anim && value != null) { - this.status(anim, mmin(value, anim.ms) / anim.ms); - } - return this; - }; - /*\ - * Element.status - [ method ] - ** - * Gets or sets the status of animation of the element. - ** - > Parameters - ** - - anim (object) #optional animation object - - value (number) #optional 0 – 1. If specified, method works like a setter and sets the status of a given animation to the value. This will cause animation to jump to the given position. - ** - = (number) status - * or - = (array) status if `anim` is not specified. Array of objects in format: - o { - o anim: (object) animation object - o status: (number) status - o } - * or - = (object) original element if `value` is specified - \*/ - elproto.status = function (anim, value) { - var out = [], - i = 0, - len, - e; - if (value != null) { - runAnimation(anim, this, -1, mmin(value, 1)); - return this; - } else { - len = animationElements.length; - for (; i < len; i++) { - e = animationElements[i]; - if (e.el.id == this.id && (!anim || e.anim == anim)) { - if (anim) { - return e.status; - } - out.push({ - anim: e.anim, - status: e.status - }); - } - } - if (anim) { - return 0; - } - return out; - } - }; - /*\ - * Element.pause - [ method ] - ** - * Stops animation of the element with ability to resume it later on. - ** - > Parameters - ** - - anim (object) #optional animation object - ** - = (object) original element - \*/ - elproto.pause = function (anim) { - for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) { - if (eve("raphael.anim.pause." + this.id, this, animationElements[i].anim) !== false) { - animationElements[i].paused = true; - } - } - return this; - }; - /*\ - * Element.resume - [ method ] - ** - * Resumes animation if it was paused with @Element.pause method. - ** - > Parameters - ** - - anim (object) #optional animation object - ** - = (object) original element - \*/ - elproto.resume = function (anim) { - for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) { - var e = animationElements[i]; - if (eve("raphael.anim.resume." + this.id, this, e.anim) !== false) { - delete e.paused; - this.status(e.anim, e.status); - } - } - return this; - }; - /*\ - * Element.stop - [ method ] - ** - * Stops animation of the element. - ** - > Parameters - ** - - anim (object) #optional animation object - ** - = (object) original element - \*/ - elproto.stop = function (anim) { - for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) { - if (eve("raphael.anim.stop." + this.id, this, animationElements[i].anim) !== false) { - animationElements.splice(i--, 1); - } - } - return this; - }; - function stopAnimation(paper) { - for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.paper == paper) { - animationElements.splice(i--, 1); - } - } - eve.on("raphael.remove", stopAnimation); - eve.on("raphael.clear", stopAnimation); - elproto.toString = function () { - return "Rapha\xebl\u2019s object"; - }; - - // Set - var Set = function (items) { - this.items = []; - this.length = 0; - this.type = "set"; - if (items) { - for (var i = 0, ii = items.length; i < ii; i++) { - if (items[i] && (items[i].constructor == elproto.constructor || items[i].constructor == Set)) { - this[this.items.length] = this.items[this.items.length] = items[i]; - this.length++; - } - } - } - }, - setproto = Set.prototype; - /*\ - * Set.push - [ method ] - ** - * Adds each argument to the current set. - = (object) original element - \*/ - setproto.push = function () { - var item, - len; - for (var i = 0, ii = arguments.length; i < ii; i++) { - item = arguments[i]; - if (item && (item.constructor == elproto.constructor || item.constructor == Set)) { - len = this.items.length; - this[len] = this.items[len] = item; - this.length++; - } - } - return this; - }; - /*\ - * Set.pop - [ method ] - ** - * Removes last element and returns it. - = (object) element - \*/ - setproto.pop = function () { - this.length && delete this[this.length--]; - return this.items.pop(); - }; - /*\ - * Set.forEach - [ method ] - ** - * Executes given function for each element in the set. - * - * If function returns `false` it will stop loop running. - ** - > Parameters - ** - - callback (function) function to run - - thisArg (object) context object for the callback - = (object) Set object - \*/ - setproto.forEach = function (callback, thisArg) { - for (var i = 0, ii = this.items.length; i < ii; i++) { - if (callback.call(thisArg, this.items[i], i) === false) { - return this; - } - } - return this; - }; - for (var method in elproto) if (elproto[has](method)) { - setproto[method] = (function (methodname) { - return function () { - var arg = arguments; - return this.forEach(function (el) { - el[methodname][apply](el, arg); - }); - }; - })(method); - } - setproto.attr = function (name, value) { - if (name && R.is(name, array) && R.is(name[0], "object")) { - for (var j = 0, jj = name.length; j < jj; j++) { - this.items[j].attr(name[j]); - } - } else { - for (var i = 0, ii = this.items.length; i < ii; i++) { - this.items[i].attr(name, value); - } - } - return this; - }; - /*\ - * Set.clear - [ method ] - ** - * Removes all elements from the set - \*/ - setproto.clear = function () { - while (this.length) { - this.pop(); - } - }; - /*\ - * Set.splice - [ method ] - ** - * Removes given element from the set - ** - > Parameters - ** - - index (number) position of the deletion - - count (number) number of element to remove - - insertion… (object) #optional elements to insert - = (object) set elements that were deleted - \*/ - setproto.splice = function (index, count, insertion) { - index = index < 0 ? mmax(this.length + index, 0) : index; - count = mmax(0, mmin(this.length - index, count)); - var tail = [], - todel = [], - args = [], - i; - for (i = 2; i < arguments.length; i++) { - args.push(arguments[i]); - } - for (i = 0; i < count; i++) { - todel.push(this[index + i]); - } - for (; i < this.length - index; i++) { - tail.push(this[index + i]); - } - var arglen = args.length; - for (i = 0; i < arglen + tail.length; i++) { - this.items[index + i] = this[index + i] = i < arglen ? args[i] : tail[i - arglen]; - } - i = this.items.length = this.length -= count - arglen; - while (this[i]) { - delete this[i++]; - } - return new Set(todel); - }; - /*\ - * Set.exclude - [ method ] - ** - * Removes given element from the set - ** - > Parameters - ** - - element (object) element to remove - = (boolean) `true` if object was found & removed from the set - \*/ - setproto.exclude = function (el) { - for (var i = 0, ii = this.length; i < ii; i++) if (this[i] == el) { - this.splice(i, 1); - return true; - } - }; - setproto.animate = function (params, ms, easing, callback) { - (R.is(easing, "function") || !easing) && (callback = easing || null); - var len = this.items.length, - i = len, - item, - set = this, - collector; - if (!len) { - return this; - } - callback && (collector = function () { - !--len && callback.call(set); - }); - easing = R.is(easing, string) ? easing : collector; - var anim = R.animation(params, ms, easing, collector); - item = this.items[--i].animate(anim); - while (i--) { - this.items[i] && !this.items[i].removed && this.items[i].animateWith(item, anim, anim); - (this.items[i] && !this.items[i].removed) || len--; - } - return this; - }; - setproto.insertAfter = function (el) { - var i = this.items.length; - while (i--) { - this.items[i].insertAfter(el); - } - return this; - }; - setproto.getBBox = function () { - var x = [], - y = [], - x2 = [], - y2 = []; - for (var i = this.items.length; i--;) if (!this.items[i].removed) { - var box = this.items[i].getBBox(); - x.push(box.x); - y.push(box.y); - x2.push(box.x + box.width); - y2.push(box.y + box.height); - } - x = mmin[apply](0, x); - y = mmin[apply](0, y); - x2 = mmax[apply](0, x2); - y2 = mmax[apply](0, y2); - return { - x: x, - y: y, - x2: x2, - y2: y2, - width: x2 - x, - height: y2 - y - }; - }; - setproto.clone = function (s) { - s = this.paper.set(); - for (var i = 0, ii = this.items.length; i < ii; i++) { - s.push(this.items[i].clone()); - } - return s; - }; - setproto.toString = function () { - return "Rapha\xebl\u2018s set"; - }; - - setproto.glow = function(glowConfig) { - var ret = this.paper.set(); - this.forEach(function(shape, index){ - var g = shape.glow(glowConfig); - if(g != null){ - g.forEach(function(shape2, index2){ - ret.push(shape2); - }); - } - }); - return ret; - }; - - - /*\ - * Set.isPointInside - [ method ] - ** - * Determine if given point is inside this set’s elements - ** - > Parameters - ** - - x (number) x coordinate of the point - - y (number) y coordinate of the point - = (boolean) `true` if point is inside any of the set's elements - \*/ - setproto.isPointInside = function (x, y) { - var isPointInside = false; - this.forEach(function (el) { - if (el.isPointInside(x, y)) { - isPointInside = true; - return false; // stop loop - } - }); - return isPointInside; - }; - - /*\ - * Raphael.registerFont - [ method ] - ** - * Adds given font to the registered set of fonts for Raphaël. Should be used as an internal call from within Cufón’s font file. - * Returns original parameter, so it could be used with chaining. - # More about Cufón and how to convert your font form TTF, OTF, etc to JavaScript file. - ** - > Parameters - ** - - font (object) the font to register - = (object) the font you passed in - > Usage - | Cufon.registerFont(Raphael.registerFont({…})); - \*/ - R.registerFont = function (font) { - if (!font.face) { - return font; - } - this.fonts = this.fonts || {}; - var fontcopy = { - w: font.w, - face: {}, - glyphs: {} - }, - family = font.face["font-family"]; - for (var prop in font.face) if (font.face[has](prop)) { - fontcopy.face[prop] = font.face[prop]; - } - if (this.fonts[family]) { - this.fonts[family].push(fontcopy); - } else { - this.fonts[family] = [fontcopy]; - } - if (!font.svg) { - fontcopy.face["units-per-em"] = toInt(font.face["units-per-em"], 10); - for (var glyph in font.glyphs) if (font.glyphs[has](glyph)) { - var path = font.glyphs[glyph]; - fontcopy.glyphs[glyph] = { - w: path.w, - k: {}, - d: path.d && "M" + path.d.replace(/[mlcxtrv]/g, function (command) { - return {l: "L", c: "C", x: "z", t: "m", r: "l", v: "c"}[command] || "M"; - }) + "z" - }; - if (path.k) { - for (var k in path.k) if (path[has](k)) { - fontcopy.glyphs[glyph].k[k] = path.k[k]; - } - } - } - } - return font; - }; - /*\ - * Paper.getFont - [ method ] - ** - * Finds font object in the registered fonts by given parameters. You could specify only one word from the font name, like “Myriad” for “Myriad Pro”. - ** - > Parameters - ** - - family (string) font family name or any word from it - - weight (string) #optional font weight - - style (string) #optional font style - - stretch (string) #optional font stretch - = (object) the font object - > Usage - | paper.print(100, 100, "Test string", paper.getFont("Times", 800), 30); - \*/ - paperproto.getFont = function (family, weight, style, stretch) { - stretch = stretch || "normal"; - style = style || "normal"; - weight = +weight || {normal: 400, bold: 700, lighter: 300, bolder: 800}[weight] || 400; - if (!R.fonts) { - return; - } - var font = R.fonts[family]; - if (!font) { - var name = new RegExp("(^|\\s)" + family.replace(/[^\w\d\s+!~.:_-]/g, E) + "(\\s|$)", "i"); - for (var fontName in R.fonts) if (R.fonts[has](fontName)) { - if (name.test(fontName)) { - font = R.fonts[fontName]; - break; - } - } - } - var thefont; - if (font) { - for (var i = 0, ii = font.length; i < ii; i++) { - thefont = font[i]; - if (thefont.face["font-weight"] == weight && (thefont.face["font-style"] == style || !thefont.face["font-style"]) && thefont.face["font-stretch"] == stretch) { - break; - } - } - } - return thefont; - }; - /*\ - * Paper.print - [ method ] - ** - * Creates path that represent given text written using given font at given position with given size. - * Result of the method is path element that contains whole text as a separate path. - ** - > Parameters - ** - - x (number) x position of the text - - y (number) y position of the text - - string (string) text to print - - font (object) font object, see @Paper.getFont - - size (number) #optional size of the font, default is `16` - - origin (string) #optional could be `"baseline"` or `"middle"`, default is `"middle"` - - letter_spacing (number) #optional number in range `-1..1`, default is `0` - - line_spacing (number) #optional number in range `1..3`, default is `1` - = (object) resulting path element, which consist of all letters - > Usage - | var txt = r.print(10, 50, "print", r.getFont("Museo"), 30).attr({fill: "#fff"}); - \*/ - paperproto.print = function (x, y, string, font, size, origin, letter_spacing, line_spacing) { - origin = origin || "middle"; // baseline|middle - letter_spacing = mmax(mmin(letter_spacing || 0, 1), -1); - line_spacing = mmax(mmin(line_spacing || 1, 3), 1); - var letters = Str(string)[split](E), - shift = 0, - notfirst = 0, - path = E, - scale; - R.is(font, "string") && (font = this.getFont(font)); - if (font) { - scale = (size || 16) / font.face["units-per-em"]; - var bb = font.face.bbox[split](separator), - top = +bb[0], - lineHeight = bb[3] - bb[1], - shifty = 0, - height = +bb[1] + (origin == "baseline" ? lineHeight + (+font.face.descent) : lineHeight / 2); - for (var i = 0, ii = letters.length; i < ii; i++) { - if (letters[i] == "\n") { - shift = 0; - curr = 0; - notfirst = 0; - shifty += lineHeight * line_spacing; - } else { - var prev = notfirst && font.glyphs[letters[i - 1]] || {}, - curr = font.glyphs[letters[i]]; - shift += notfirst ? (prev.w || font.w) + (prev.k && prev.k[letters[i]] || 0) + (font.w * letter_spacing) : 0; - notfirst = 1; - } - if (curr && curr.d) { - path += R.transformPath(curr.d, ["t", shift * scale, shifty * scale, "s", scale, scale, top, height, "t", (x - top) / scale, (y - height) / scale]); - } - } - } - return this.path(path).attr({ - fill: "#000", - stroke: "none" - }); - }; - - /*\ - * Paper.add - [ method ] - ** - * Imports elements in JSON array in format `{type: type, }` - ** - > Parameters - ** - - json (array) - = (object) resulting set of imported elements - > Usage - | paper.add([ - | { - | type: "circle", - | cx: 10, - | cy: 10, - | r: 5 - | }, - | { - | type: "rect", - | x: 10, - | y: 10, - | width: 10, - | height: 10, - | fill: "#fc0" - | } - | ]); - \*/ - paperproto.add = function (json) { - if (R.is(json, "array")) { - var res = this.set(), - i = 0, - ii = json.length, - j; - for (; i < ii; i++) { - j = json[i] || {}; - elements[has](j.type) && res.push(this[j.type]().attr(j)); - } - } - return res; - }; - - /*\ - * Raphael.format - [ method ] - ** - * Simple format function. Replaces construction of type “`{}`” to the corresponding argument. - ** - > Parameters - ** - - token (string) string to format - - … (string) rest of arguments will be treated as parameters for replacement - = (string) formated string - > Usage - | var x = 10, - | y = 20, - | width = 40, - | height = 50; - | // this will draw a rectangular shape equivalent to "M10,20h40v50h-40z" - | paper.path(Raphael.format("M{0},{1}h{2}v{3}h{4}z", x, y, width, height, -width)); - \*/ - R.format = function (token, params) { - var args = R.is(params, array) ? [0][concat](params) : arguments; - token && R.is(token, string) && args.length - 1 && (token = token.replace(formatrg, function (str, i) { - return args[++i] == null ? E : args[i]; - })); - return token || E; - }; - /*\ - * Raphael.fullfill - [ method ] - ** - * A little bit more advanced format function than @Raphael.format. Replaces construction of type “`{}`” to the corresponding argument. - ** - > Parameters - ** - - token (string) string to format - - json (object) object which properties will be used as a replacement - = (string) formated string - > Usage - | // this will draw a rectangular shape equivalent to "M10,20h40v50h-40z" - | paper.path(Raphael.fullfill("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", { - | x: 10, - | y: 20, - | dim: { - | width: 40, - | height: 50, - | "negative width": -40 - | } - | })); - \*/ - R.fullfill = (function () { - var tokenRegex = /\{([^\}]+)\}/g, - objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches .xxxxx or ["xxxxx"] to run over object properties - replacer = function (all, key, obj) { - var res = obj; - key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) { - name = name || quotedName; - if (res) { - if (name in res) { - res = res[name]; - } - typeof res == "function" && isFunc && (res = res()); - } - }); - res = (res == null || res == obj ? all : res) + ""; - return res; - }; - return function (str, obj) { - return String(str).replace(tokenRegex, function (all, key) { - return replacer(all, key, obj); - }); - }; - })(); - /*\ - * Raphael.ninja - [ method ] - ** - * If you want to leave no trace of Raphaël (Well, Raphaël creates only one global variable `Raphael`, but anyway.) You can use `ninja` method. - * Beware, that in this case plugins could stop working, because they are depending on global variable existence. - ** - = (object) Raphael object - > Usage - | (function (local_raphael) { - | var paper = local_raphael(10, 10, 320, 200); - | … - | })(Raphael.ninja()); - \*/ - R.ninja = function () { - if (oldRaphael.was) { - g.win.Raphael = oldRaphael.is; - } else { - // IE8 raises an error when deleting window property - window.Raphael = undefined; - try { - delete window.Raphael; - } catch(e) {} - } - return R; - }; - /*\ - * Raphael.st - [ property (object) ] - ** - * You can add your own method to elements and sets. It is wise to add a set method for each element method - * you added, so you will be able to call the same method on sets too. - ** - * See also @Raphael.el. - > Usage - | Raphael.el.red = function () { - | this.attr({fill: "#f00"}); - | }; - | Raphael.st.red = function () { - | this.forEach(function (el) { - | el.red(); - | }); - | }; - | // then use it - | paper.set(paper.circle(100, 100, 20), paper.circle(110, 100, 20)).red(); - \*/ - R.st = setproto; - - eve.on("raphael.DOMload", function () { - loaded = true; - }); - - // Firefox <3.6 fix: http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html - (function (doc, loaded, f) { - if (doc.readyState == null && doc.addEventListener){ - doc.addEventListener(loaded, f = function () { - doc.removeEventListener(loaded, f, false); - doc.readyState = "complete"; - }, false); - doc.readyState = "loading"; - } - function isLoaded() { - (/in/).test(doc.readyState) ? setTimeout(isLoaded, 9) : R.eve("raphael.DOMload"); - } - isLoaded(); - })(document, "DOMContentLoaded"); - - return R; -}); diff --git a/plugins/raphael/dev/raphael.svg.js b/plugins/raphael/dev/raphael.svg.js deleted file mode 100644 index d2d781e6a..000000000 --- a/plugins/raphael/dev/raphael.svg.js +++ /dev/null @@ -1,1424 +0,0 @@ -define(["./raphael.core"], function(R) { - if (R && !R.svg) { - return; - } - - var has = "hasOwnProperty", - Str = String, - toFloat = parseFloat, - toInt = parseInt, - math = Math, - mmax = math.max, - abs = math.abs, - pow = math.pow, - separator = /[, ]+/, - eve = R.eve, - E = "", - S = " "; - var xlink = "http://www.w3.org/1999/xlink", - markers = { - block: "M5,0 0,2.5 5,5z", - classic: "M5,0 0,2.5 5,5 3.5,3 3.5,2z", - diamond: "M2.5,0 5,2.5 2.5,5 0,2.5z", - open: "M6,1 1,3.5 6,6", - oval: "M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z" - }, - markerCounter = {}; - R.toString = function () { - return "Your browser supports SVG.\nYou are running Rapha\xebl " + this.version; - }; - var $ = function (el, attr) { - if (attr) { - if (typeof el == "string") { - el = $(el); - } - for (var key in attr) if (attr[has](key)) { - if (key.substring(0, 6) == "xlink:") { - el.setAttributeNS(xlink, key.substring(6), Str(attr[key])); - } else { - el.setAttribute(key, Str(attr[key])); - } - } - } else { - el = R._g.doc.createElementNS("http://www.w3.org/2000/svg", el); - el.style && (el.style.webkitTapHighlightColor = "rgba(0,0,0,0)"); - } - return el; - }, - addGradientFill = function (element, gradient) { - var type = "linear", - id = element.id + gradient, - fx = .5, fy = .5, - o = element.node, - SVG = element.paper, - s = o.style, - el = R._g.doc.getElementById(id); - if (!el) { - gradient = Str(gradient).replace(R._radial_gradient, function (all, _fx, _fy) { - type = "radial"; - if (_fx && _fy) { - fx = toFloat(_fx); - fy = toFloat(_fy); - var dir = ((fy > .5) * 2 - 1); - pow(fx - .5, 2) + pow(fy - .5, 2) > .25 && - (fy = math.sqrt(.25 - pow(fx - .5, 2)) * dir + .5) && - fy != .5 && - (fy = fy.toFixed(5) - 1e-5 * dir); - } - return E; - }); - gradient = gradient.split(/\s*\-\s*/); - if (type == "linear") { - var angle = gradient.shift(); - angle = -toFloat(angle); - if (isNaN(angle)) { - return null; - } - var vector = [0, 0, math.cos(R.rad(angle)), math.sin(R.rad(angle))], - max = 1 / (mmax(abs(vector[2]), abs(vector[3])) || 1); - vector[2] *= max; - vector[3] *= max; - if (vector[2] < 0) { - vector[0] = -vector[2]; - vector[2] = 0; - } - if (vector[3] < 0) { - vector[1] = -vector[3]; - vector[3] = 0; - } - } - var dots = R._parseDots(gradient); - if (!dots) { - return null; - } - id = id.replace(/[\(\)\s,\xb0#]/g, "_"); - - if (element.gradient && id != element.gradient.id) { - SVG.defs.removeChild(element.gradient); - delete element.gradient; - } - - if (!element.gradient) { - el = $(type + "Gradient", {id: id}); - element.gradient = el; - $(el, type == "radial" ? { - fx: fx, - fy: fy - } : { - x1: vector[0], - y1: vector[1], - x2: vector[2], - y2: vector[3], - gradientTransform: element.matrix.invert() - }); - SVG.defs.appendChild(el); - for (var i = 0, ii = dots.length; i < ii; i++) { - el.appendChild($("stop", { - offset: dots[i].offset ? dots[i].offset : i ? "100%" : "0%", - "stop-color": dots[i].color || "#fff", - "stop-opacity": isFinite(dots[i].opacity) ? dots[i].opacity : 1 - })); - } - } - } - $(o, { - fill: fillurl(id), - opacity: 1, - "fill-opacity": 1 - }); - s.fill = E; - s.opacity = 1; - s.fillOpacity = 1; - return 1; - }, - isIE9or10 = function () { - var mode = document.documentMode; - return mode && (mode === 9 || mode === 10); - }, - fillurl = function (id) { - if (isIE9or10()) { - return "url('#" + id + "')"; - } - var location = document.location; - var locationString = ( - location.protocol + '//' + - location.host + - location.pathname + - location.search - ); - return "url('" + locationString + "#" + id + "')"; - }, - updatePosition = function (o) { - var bbox = o.getBBox(1); - $(o.pattern, {patternTransform: o.matrix.invert() + " translate(" + bbox.x + "," + bbox.y + ")"}); - }, - addArrow = function (o, value, isEnd) { - if (o.type == "path") { - var values = Str(value).toLowerCase().split("-"), - p = o.paper, - se = isEnd ? "end" : "start", - node = o.node, - attrs = o.attrs, - stroke = attrs["stroke-width"], - i = values.length, - type = "classic", - from, - to, - dx, - refX, - attr, - w = 3, - h = 3, - t = 5; - while (i--) { - switch (values[i]) { - case "block": - case "classic": - case "oval": - case "diamond": - case "open": - case "none": - type = values[i]; - break; - case "wide": h = 5; break; - case "narrow": h = 2; break; - case "long": w = 5; break; - case "short": w = 2; break; - } - } - if (type == "open") { - w += 2; - h += 2; - t += 2; - dx = 1; - refX = isEnd ? 4 : 1; - attr = { - fill: "none", - stroke: attrs.stroke - }; - } else { - refX = dx = w / 2; - attr = { - fill: attrs.stroke, - stroke: "none" - }; - } - if (o._.arrows) { - if (isEnd) { - o._.arrows.endPath && markerCounter[o._.arrows.endPath]--; - o._.arrows.endMarker && markerCounter[o._.arrows.endMarker]--; - } else { - o._.arrows.startPath && markerCounter[o._.arrows.startPath]--; - o._.arrows.startMarker && markerCounter[o._.arrows.startMarker]--; - } - } else { - o._.arrows = {}; - } - if (type != "none") { - var pathId = "raphael-marker-" + type, - markerId = "raphael-marker-" + se + type + w + h + "-obj" + o.id; - if (!R._g.doc.getElementById(pathId)) { - p.defs.appendChild($($("path"), { - "stroke-linecap": "round", - d: markers[type], - id: pathId - })); - markerCounter[pathId] = 1; - } else { - markerCounter[pathId]++; - } - var marker = R._g.doc.getElementById(markerId), - use; - if (!marker) { - marker = $($("marker"), { - id: markerId, - markerHeight: h, - markerWidth: w, - orient: "auto", - refX: refX, - refY: h / 2 - }); - use = $($("use"), { - "xlink:href": "#" + pathId, - transform: (isEnd ? "rotate(180 " + w / 2 + " " + h / 2 + ") " : E) + "scale(" + w / t + "," + h / t + ")", - "stroke-width": (1 / ((w / t + h / t) / 2)).toFixed(4) - }); - marker.appendChild(use); - p.defs.appendChild(marker); - markerCounter[markerId] = 1; - } else { - markerCounter[markerId]++; - use = marker.getElementsByTagName("use")[0]; - } - $(use, attr); - var delta = dx * (type != "diamond" && type != "oval"); - if (isEnd) { - from = o._.arrows.startdx * stroke || 0; - to = R.getTotalLength(attrs.path) - delta * stroke; - } else { - from = delta * stroke; - to = R.getTotalLength(attrs.path) - (o._.arrows.enddx * stroke || 0); - } - attr = {}; - attr["marker-" + se] = "url(#" + markerId + ")"; - if (to || from) { - attr.d = R.getSubpath(attrs.path, from, to); - } - $(node, attr); - o._.arrows[se + "Path"] = pathId; - o._.arrows[se + "Marker"] = markerId; - o._.arrows[se + "dx"] = delta; - o._.arrows[se + "Type"] = type; - o._.arrows[se + "String"] = value; - } else { - if (isEnd) { - from = o._.arrows.startdx * stroke || 0; - to = R.getTotalLength(attrs.path) - from; - } else { - from = 0; - to = R.getTotalLength(attrs.path) - (o._.arrows.enddx * stroke || 0); - } - o._.arrows[se + "Path"] && $(node, {d: R.getSubpath(attrs.path, from, to)}); - delete o._.arrows[se + "Path"]; - delete o._.arrows[se + "Marker"]; - delete o._.arrows[se + "dx"]; - delete o._.arrows[se + "Type"]; - delete o._.arrows[se + "String"]; - } - for (attr in markerCounter) if (markerCounter[has](attr) && !markerCounter[attr]) { - var item = R._g.doc.getElementById(attr); - item && item.parentNode.removeChild(item); - } - } - }, - dasharray = { - "-": [3, 1], - ".": [1, 1], - "-.": [3, 1, 1, 1], - "-..": [3, 1, 1, 1, 1, 1], - ". ": [1, 3], - "- ": [4, 3], - "--": [8, 3], - "- .": [4, 3, 1, 3], - "--.": [8, 3, 1, 3], - "--..": [8, 3, 1, 3, 1, 3] - }, - addDashes = function (o, value, params) { - value = dasharray[Str(value).toLowerCase()]; - if (value) { - var width = o.attrs["stroke-width"] || "1", - butt = {round: width, square: width, butt: 0}[o.attrs["stroke-linecap"] || params["stroke-linecap"]] || 0, - dashes = [], - i = value.length; - while (i--) { - dashes[i] = value[i] * width + ((i % 2) ? 1 : -1) * butt; - } - $(o.node, {"stroke-dasharray": dashes.join(",")}); - } - else { - $(o.node, {"stroke-dasharray": "none"}); - } - }, - setFillAndStroke = function (o, params) { - var node = o.node, - attrs = o.attrs, - vis = node.style.visibility; - node.style.visibility = "hidden"; - for (var att in params) { - if (params[has](att)) { - if (!R._availableAttrs[has](att)) { - continue; - } - var value = params[att]; - attrs[att] = value; - switch (att) { - case "blur": - o.blur(value); - break; - case "title": - var title = node.getElementsByTagName("title"); - - // Use the existing . - if (title.length && (title = title[0])) { - title.firstChild.nodeValue = value; - } else { - title = $("title"); - var val = R._g.doc.createTextNode(value); - title.appendChild(val); - node.appendChild(title); - } - break; - case "href": - case "target": - var pn = node.parentNode; - if (pn.tagName.toLowerCase() != "a") { - var hl = $("a"); - pn.insertBefore(hl, node); - hl.appendChild(node); - pn = hl; - } - if (att == "target") { - pn.setAttributeNS(xlink, "show", value == "blank" ? "new" : value); - } else { - pn.setAttributeNS(xlink, att, value); - } - break; - case "cursor": - node.style.cursor = value; - break; - case "transform": - o.transform(value); - break; - case "arrow-start": - addArrow(o, value); - break; - case "arrow-end": - addArrow(o, value, 1); - break; - case "clip-rect": - var rect = Str(value).split(separator); - if (rect.length == 4) { - o.clip && o.clip.parentNode.parentNode.removeChild(o.clip.parentNode); - var el = $("clipPath"), - rc = $("rect"); - el.id = R.createUUID(); - $(rc, { - x: rect[0], - y: rect[1], - width: rect[2], - height: rect[3] - }); - el.appendChild(rc); - o.paper.defs.appendChild(el); - $(node, {"clip-path": "url(#" + el.id + ")"}); - o.clip = rc; - } - if (!value) { - var path = node.getAttribute("clip-path"); - if (path) { - var clip = R._g.doc.getElementById(path.replace(/(^url\(#|\)$)/g, E)); - clip && clip.parentNode.removeChild(clip); - $(node, {"clip-path": E}); - delete o.clip; - } - } - break; - case "path": - if (o.type == "path") { - $(node, {d: value ? attrs.path = R._pathToAbsolute(value) : "M0,0"}); - o._.dirty = 1; - if (o._.arrows) { - "startString" in o._.arrows && addArrow(o, o._.arrows.startString); - "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1); - } - } - break; - case "width": - node.setAttribute(att, value); - o._.dirty = 1; - if (attrs.fx) { - att = "x"; - value = attrs.x; - } else { - break; - } - case "x": - if (attrs.fx) { - value = -attrs.x - (attrs.width || 0); - } - case "rx": - if (att == "rx" && o.type == "rect") { - break; - } - case "cx": - node.setAttribute(att, value); - o.pattern && updatePosition(o); - o._.dirty = 1; - break; - case "height": - node.setAttribute(att, value); - o._.dirty = 1; - if (attrs.fy) { - att = "y"; - value = attrs.y; - } else { - break; - } - case "y": - if (attrs.fy) { - value = -attrs.y - (attrs.height || 0); - } - case "ry": - if (att == "ry" && o.type == "rect") { - break; - } - case "cy": - node.setAttribute(att, value); - o.pattern && updatePosition(o); - o._.dirty = 1; - break; - case "r": - if (o.type == "rect") { - $(node, {rx: value, ry: value}); - } else { - node.setAttribute(att, value); - } - o._.dirty = 1; - break; - case "src": - if (o.type == "image") { - node.setAttributeNS(xlink, "href", value); - } - break; - case "stroke-width": - if (o._.sx != 1 || o._.sy != 1) { - value /= mmax(abs(o._.sx), abs(o._.sy)) || 1; - } - node.setAttribute(att, value); - if (attrs["stroke-dasharray"]) { - addDashes(o, attrs["stroke-dasharray"], params); - } - if (o._.arrows) { - "startString" in o._.arrows && addArrow(o, o._.arrows.startString); - "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1); - } - break; - case "stroke-dasharray": - addDashes(o, value, params); - break; - case "fill": - var isURL = Str(value).match(R._ISURL); - if (isURL) { - el = $("pattern"); - var ig = $("image"); - el.id = R.createUUID(); - $(el, {x: 0, y: 0, patternUnits: "userSpaceOnUse", height: 1, width: 1}); - $(ig, {x: 0, y: 0, "xlink:href": isURL[1]}); - el.appendChild(ig); - - (function (el) { - R._preload(isURL[1], function () { - var w = this.offsetWidth, - h = this.offsetHeight; - $(el, {width: w, height: h}); - $(ig, {width: w, height: h}); - }); - })(el); - o.paper.defs.appendChild(el); - $(node, {fill: "url(#" + el.id + ")"}); - o.pattern = el; - o.pattern && updatePosition(o); - break; - } - var clr = R.getRGB(value); - if (!clr.error) { - delete params.gradient; - delete attrs.gradient; - !R.is(attrs.opacity, "undefined") && - R.is(params.opacity, "undefined") && - $(node, {opacity: attrs.opacity}); - !R.is(attrs["fill-opacity"], "undefined") && - R.is(params["fill-opacity"], "undefined") && - $(node, {"fill-opacity": attrs["fill-opacity"]}); - } else if ((o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value)) { - if ("opacity" in attrs || "fill-opacity" in attrs) { - var gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); - if (gradient) { - var stops = gradient.getElementsByTagName("stop"); - $(stops[stops.length - 1], {"stop-opacity": ("opacity" in attrs ? attrs.opacity : 1) * ("fill-opacity" in attrs ? attrs["fill-opacity"] : 1)}); - } - } - attrs.gradient = value; - attrs.fill = "none"; - break; - } - clr[has]("opacity") && $(node, {"fill-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity}); - case "stroke": - clr = R.getRGB(value); - node.setAttribute(att, clr.hex); - att == "stroke" && clr[has]("opacity") && $(node, {"stroke-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity}); - if (att == "stroke" && o._.arrows) { - "startString" in o._.arrows && addArrow(o, o._.arrows.startString); - "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1); - } - break; - case "gradient": - (o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value); - break; - case "opacity": - if (attrs.gradient && !attrs[has]("stroke-opacity")) { - $(node, {"stroke-opacity": value > 1 ? value / 100 : value}); - } - // fall - case "fill-opacity": - if (attrs.gradient) { - gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); - if (gradient) { - stops = gradient.getElementsByTagName("stop"); - $(stops[stops.length - 1], {"stop-opacity": value}); - } - break; - } - default: - att == "font-size" && (value = toInt(value, 10) + "px"); - var cssrule = att.replace(/(\-.)/g, function (w) { - return w.substring(1).toUpperCase(); - }); - node.style[cssrule] = value; - o._.dirty = 1; - node.setAttribute(att, value); - break; - } - } - } - - tuneText(o, params); - node.style.visibility = vis; - }, - leading = 1.2, - tuneText = function (el, params) { - if (el.type != "text" || !(params[has]("text") || params[has]("font") || params[has]("font-size") || params[has]("x") || params[has]("y"))) { - return; - } - var a = el.attrs, - node = el.node, - fontSize = node.firstChild ? toInt(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size"), 10) : 10; - - if (params[has]("text")) { - a.text = params.text; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - var texts = Str(params.text).split("\n"), - tspans = [], - tspan; - for (var i = 0, ii = texts.length; i < ii; i++) { - tspan = $("tspan"); - i && $(tspan, {dy: fontSize * leading, x: a.x}); - tspan.appendChild(R._g.doc.createTextNode(texts[i])); - node.appendChild(tspan); - tspans[i] = tspan; - } - } else { - tspans = node.getElementsByTagName("tspan"); - for (i = 0, ii = tspans.length; i < ii; i++) if (i) { - $(tspans[i], {dy: fontSize * leading, x: a.x}); - } else { - $(tspans[0], {dy: 0}); - } - } - $(node, {x: a.x, y: a.y}); - el._.dirty = 1; - var bb = el._getBBox(), - dif = a.y - (bb.y + bb.height / 2); - dif && R.is(dif, "finite") && $(tspans[0], {dy: dif}); - }, - getRealNode = function (node) { - if (node.parentNode && node.parentNode.tagName.toLowerCase() === "a") { - return node.parentNode; - } else { - return node; - } - }, - Element = function (node, svg) { - var X = 0, - Y = 0; - /*\ - * Element.node - [ property (object) ] - ** - * Gives you a reference to the DOM object, so you can assign event handlers or just mess around. - ** - * Note: Don’t mess with it. - > Usage - | // draw a circle at coordinate 10,10 with radius of 10 - | var c = paper.circle(10, 10, 10); - | c.node.onclick = function () { - | c.attr("fill", "red"); - | }; - \*/ - this[0] = this.node = node; - /*\ - * Element.raphael - [ property (object) ] - ** - * Internal reference to @Raphael object. In case it is not available. - > Usage - | Raphael.el.red = function () { - | var hsb = this.paper.raphael.rgb2hsb(this.attr("fill")); - | hsb.h = 1; - | this.attr({fill: this.paper.raphael.hsb2rgb(hsb).hex}); - | } - \*/ - node.raphael = true; - /*\ - * Element.id - [ property (number) ] - ** - * Unique id of the element. Especially useful when you want to listen to events of the element, - * because all events are fired in format `<module>.<action>.<id>`. Also useful for @Paper.getById method. - \*/ - this.id = guid(); - node.raphaelid = this.id; - - /** - * Method that returns a 5 letter/digit id, enough for 36^5 = 60466176 elements - * @returns {string} id - */ - function guid() { - return ("0000" + (Math.random()*Math.pow(36,5) << 0).toString(36)).slice(-5); - } - - this.matrix = R.matrix(); - this.realPath = null; - /*\ - * Element.paper - [ property (object) ] - ** - * Internal reference to “paper” where object drawn. Mainly for use in plugins and element extensions. - > Usage - | Raphael.el.cross = function () { - | this.attr({fill: "red"}); - | this.paper.path("M10,10L50,50M50,10L10,50") - | .attr({stroke: "red"}); - | } - \*/ - this.paper = svg; - this.attrs = this.attrs || {}; - this._ = { - transform: [], - sx: 1, - sy: 1, - deg: 0, - dx: 0, - dy: 0, - dirty: 1 - }; - !svg.bottom && (svg.bottom = this); - /*\ - * Element.prev - [ property (object) ] - ** - * Reference to the previous element in the hierarchy. - \*/ - this.prev = svg.top; - svg.top && (svg.top.next = this); - svg.top = this; - /*\ - * Element.next - [ property (object) ] - ** - * Reference to the next element in the hierarchy. - \*/ - this.next = null; - }, - elproto = R.el; - - Element.prototype = elproto; - elproto.constructor = Element; - - R._engine.path = function (pathString, SVG) { - var el = $("path"); - SVG.canvas && SVG.canvas.appendChild(el); - var p = new Element(el, SVG); - p.type = "path"; - setFillAndStroke(p, { - fill: "none", - stroke: "#000", - path: pathString - }); - return p; - }; - /*\ - * Element.rotate - [ method ] - ** - * Deprecated! Use @Element.transform instead. - * Adds rotation by given angle around given point to the list of - * transformations of the element. - > Parameters - - deg (number) angle in degrees - - cx (number) #optional x coordinate of the centre of rotation - - cy (number) #optional y coordinate of the centre of rotation - * If cx & cy aren’t specified centre of the shape is used as a point of rotation. - = (object) @Element - \*/ - elproto.rotate = function (deg, cx, cy) { - if (this.removed) { - return this; - } - deg = Str(deg).split(separator); - if (deg.length - 1) { - cx = toFloat(deg[1]); - cy = toFloat(deg[2]); - } - deg = toFloat(deg[0]); - (cy == null) && (cx = cy); - if (cx == null || cy == null) { - var bbox = this.getBBox(1); - cx = bbox.x + bbox.width / 2; - cy = bbox.y + bbox.height / 2; - } - this.transform(this._.transform.concat([["r", deg, cx, cy]])); - return this; - }; - /*\ - * Element.scale - [ method ] - ** - * Deprecated! Use @Element.transform instead. - * Adds scale by given amount relative to given point to the list of - * transformations of the element. - > Parameters - - sx (number) horisontal scale amount - - sy (number) vertical scale amount - - cx (number) #optional x coordinate of the centre of scale - - cy (number) #optional y coordinate of the centre of scale - * If cx & cy aren’t specified centre of the shape is used instead. - = (object) @Element - \*/ - elproto.scale = function (sx, sy, cx, cy) { - if (this.removed) { - return this; - } - sx = Str(sx).split(separator); - if (sx.length - 1) { - sy = toFloat(sx[1]); - cx = toFloat(sx[2]); - cy = toFloat(sx[3]); - } - sx = toFloat(sx[0]); - (sy == null) && (sy = sx); - (cy == null) && (cx = cy); - if (cx == null || cy == null) { - var bbox = this.getBBox(1); - } - cx = cx == null ? bbox.x + bbox.width / 2 : cx; - cy = cy == null ? bbox.y + bbox.height / 2 : cy; - this.transform(this._.transform.concat([["s", sx, sy, cx, cy]])); - return this; - }; - /*\ - * Element.translate - [ method ] - ** - * Deprecated! Use @Element.transform instead. - * Adds translation by given amount to the list of transformations of the element. - > Parameters - - dx (number) horisontal shift - - dy (number) vertical shift - = (object) @Element - \*/ - elproto.translate = function (dx, dy) { - if (this.removed) { - return this; - } - dx = Str(dx).split(separator); - if (dx.length - 1) { - dy = toFloat(dx[1]); - } - dx = toFloat(dx[0]) || 0; - dy = +dy || 0; - this.transform(this._.transform.concat([["t", dx, dy]])); - return this; - }; - /*\ - * Element.transform - [ method ] - ** - * Adds transformation to the element which is separate to other attributes, - * i.e. translation doesn’t change `x` or `y` of the rectange. The format - * of transformation string is similar to the path string syntax: - | "t100,100r30,100,100s2,2,100,100r45s1.5" - * Each letter is a command. There are four commands: `t` is for translate, `r` is for rotate, `s` is for - * scale and `m` is for matrix. - * - * There are also alternative “absolute” translation, rotation and scale: `T`, `R` and `S`. They will not take previous transformation into account. For example, `...T100,0` will always move element 100 px horisontally, while `...t100,0` could move it vertically if there is `r90` before. Just compare results of `r90t100,0` and `r90T100,0`. - * - * So, the example line above could be read like “translate by 100, 100; rotate 30° around 100, 100; scale twice around 100, 100; - * rotate 45° around centre; scale 1.5 times relative to centre”. As you can see rotate and scale commands have origin - * coordinates as optional parameters, the default is the centre point of the element. - * Matrix accepts six parameters. - > Usage - | var el = paper.rect(10, 20, 300, 200); - | // translate 100, 100, rotate 45°, translate -100, 0 - | el.transform("t100,100r45t-100,0"); - | // if you want you can append or prepend transformations - | el.transform("...t50,50"); - | el.transform("s2..."); - | // or even wrap - | el.transform("t50,50...t-50-50"); - | // to reset transformation call method with empty string - | el.transform(""); - | // to get current value call it without parameters - | console.log(el.transform()); - > Parameters - - tstr (string) #optional transformation string - * If tstr isn’t specified - = (string) current transformation string - * else - = (object) @Element - \*/ - elproto.transform = function (tstr) { - var _ = this._; - if (tstr == null) { - return _.transform; - } - R._extractTransform(this, tstr); - - this.clip && $(this.clip, {transform: this.matrix.invert()}); - this.pattern && updatePosition(this); - this.node && $(this.node, {transform: this.matrix}); - - if (_.sx != 1 || _.sy != 1) { - var sw = this.attrs[has]("stroke-width") ? this.attrs["stroke-width"] : 1; - this.attr({"stroke-width": sw}); - } - - return this; - }; - /*\ - * Element.hide - [ method ] - ** - * Makes element invisible. See @Element.show. - = (object) @Element - \*/ - elproto.hide = function () { - if(!this.removed) this.node.style.display = "none"; - return this; - }; - /*\ - * Element.show - [ method ] - ** - * Makes element visible. See @Element.hide. - = (object) @Element - \*/ - elproto.show = function () { - if(!this.removed) this.node.style.display = ""; - return this; - }; - /*\ - * Element.remove - [ method ] - ** - * Removes element from the paper. - \*/ - elproto.remove = function () { - var node = getRealNode(this.node); - if (this.removed || !node.parentNode) { - return; - } - var paper = this.paper; - paper.__set__ && paper.__set__.exclude(this); - eve.unbind("raphael.*.*." + this.id); - if (this.gradient) { - paper.defs.removeChild(this.gradient); - } - R._tear(this, paper); - - node.parentNode.removeChild(node); - - // Remove custom data for element - this.removeData(); - - for (var i in this) { - this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; - } - this.removed = true; - }; - elproto._getBBox = function () { - if (this.node.style.display == "none") { - this.show(); - var hide = true; - } - var canvasHidden = false, - containerStyle; - if (this.paper.canvas.parentElement) { - containerStyle = this.paper.canvas.parentElement.style; - } //IE10+ can't find parentElement - else if (this.paper.canvas.parentNode) { - containerStyle = this.paper.canvas.parentNode.style; - } - - if(containerStyle && containerStyle.display == "none") { - canvasHidden = true; - containerStyle.display = ""; - } - var bbox = {}; - try { - bbox = this.node.getBBox(); - } catch(e) { - // Firefox 3.0.x, 25.0.1 (probably more versions affected) play badly here - possible fix - bbox = { - x: this.node.clientLeft, - y: this.node.clientTop, - width: this.node.clientWidth, - height: this.node.clientHeight - } - } finally { - bbox = bbox || {}; - if(canvasHidden){ - containerStyle.display = "none"; - } - } - hide && this.hide(); - return bbox; - }; - /*\ - * Element.attr - [ method ] - ** - * Sets the attributes of the element. - > Parameters - - attrName (string) attribute’s name - - value (string) value - * or - - params (object) object of name/value pairs - * or - - attrName (string) attribute’s name - * or - - attrNames (array) in this case method returns array of current values for given attribute names - = (object) @Element if attrsName & value or params are passed in. - = (...) value of the attribute if only attrsName is passed in. - = (array) array of values of the attribute if attrsNames is passed in. - = (object) object of attributes if nothing is passed in. - > Possible parameters - # <p>Please refer to the <a href="http://www.w3.org/TR/SVG/" title="The W3C Recommendation for the SVG language describes these properties in detail.">SVG specification</a> for an explanation of these parameters.</p> - o arrow-end (string) arrowhead on the end of the path. The format for string is `<type>[-<width>[-<length>]]`. Possible types: `classic`, `block`, `open`, `oval`, `diamond`, `none`, width: `wide`, `narrow`, `medium`, length: `long`, `short`, `midium`. - o clip-rect (string) comma or space separated values: x, y, width and height - o cursor (string) CSS type of the cursor - o cx (number) the x-axis coordinate of the center of the circle, or ellipse - o cy (number) the y-axis coordinate of the center of the circle, or ellipse - o fill (string) colour, gradient or image - o fill-opacity (number) - o font (string) - o font-family (string) - o font-size (number) font size in pixels - o font-weight (string) - o height (number) - o href (string) URL, if specified element behaves as hyperlink - o opacity (number) - o path (string) SVG path string format - o r (number) radius of the circle, ellipse or rounded corner on the rect - o rx (number) horisontal radius of the ellipse - o ry (number) vertical radius of the ellipse - o src (string) image URL, only works for @Element.image element - o stroke (string) stroke colour - o stroke-dasharray (string) [“”, “none”, “`-`”, “`.`”, “`-.`”, “`-..`”, “`. `”, “`- `”, “`--`”, “`- .`”, “`--.`”, “`--..`”] - o stroke-linecap (string) [“`butt`”, “`square`”, “`round`”] - o stroke-linejoin (string) [“`bevel`”, “`round`”, “`miter`”] - o stroke-miterlimit (number) - o stroke-opacity (number) - o stroke-width (number) stroke width in pixels, default is '1' - o target (string) used with href - o text (string) contents of the text element. Use `\n` for multiline text - o text-anchor (string) [“`start`”, “`middle`”, “`end`”], default is “`middle`” - o title (string) will create tooltip with a given text - o transform (string) see @Element.transform - o width (number) - o x (number) - o y (number) - > Gradients - * Linear gradient format: “`‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›`”, example: “`90-#fff-#000`” – 90° - * gradient from white to black or “`0-#fff-#f00:20-#000`” – 0° gradient from white via red (at 20%) to black. - * - * radial gradient: “`r[(‹fx›, ‹fy›)]‹colour›[-‹colour›[:‹offset›]]*-‹colour›`”, example: “`r#fff-#000`” – - * gradient from white to black or “`r(0.25, 0.75)#fff-#000`” – gradient from white to black with focus point - * at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can only be applied to circles and ellipses. - > Path String - # <p>Please refer to <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path’s data attribute’s format are described in the SVG specification.">SVG documentation regarding path string</a>. Raphaël fully supports it.</p> - > Colour Parsing - # <ul> - # <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li> - # <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li> - # <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li> - # <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200, 100, 0)</code>”)</li> - # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%, 175%, 0%)</code>”)</li> - # <li>rgba(•••, •••, •••, •••) — red, green and blue channels’ values: (“<code>rgba(200, 100, 0, .5)</code>”)</li> - # <li>rgba(•••%, •••%, •••%, •••%) — same as above, but in %: (“<code>rgba(100%, 175%, 0%, 50%)</code>”)</li> - # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5, 0.25, 1)</code>”)</li> - # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li> - # <li>hsba(•••, •••, •••, •••) — same as above, but with opacity</li> - # <li>hsl(•••, •••, •••) — almost the same as hsb, see <a href="http://en.wikipedia.org/wiki/HSL_and_HSV" title="HSL and HSV - Wikipedia, the free encyclopedia">Wikipedia page</a></li> - # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li> - # <li>hsla(•••, •••, •••, •••) — same as above, but with opacity</li> - # <li>Optionally for hsb and hsl you could specify hue as a degree: “<code>hsl(240deg, 1, .5)</code>” or, if you want to go fancy, “<code>hsl(240°, 1, .5)</code>”</li> - # </ul> - \*/ - elproto.attr = function (name, value) { - if (this.removed) { - return this; - } - if (name == null) { - var res = {}; - for (var a in this.attrs) if (this.attrs[has](a)) { - res[a] = this.attrs[a]; - } - res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient; - res.transform = this._.transform; - return res; - } - if (value == null && R.is(name, "string")) { - if (name == "fill" && this.attrs.fill == "none" && this.attrs.gradient) { - return this.attrs.gradient; - } - if (name == "transform") { - return this._.transform; - } - var names = name.split(separator), - out = {}; - for (var i = 0, ii = names.length; i < ii; i++) { - name = names[i]; - if (name in this.attrs) { - out[name] = this.attrs[name]; - } else if (R.is(this.paper.customAttributes[name], "function")) { - out[name] = this.paper.customAttributes[name].def; - } else { - out[name] = R._availableAttrs[name]; - } - } - return ii - 1 ? out : out[names[0]]; - } - if (value == null && R.is(name, "array")) { - out = {}; - for (i = 0, ii = name.length; i < ii; i++) { - out[name[i]] = this.attr(name[i]); - } - return out; - } - if (value != null) { - var params = {}; - params[name] = value; - } else if (name != null && R.is(name, "object")) { - params = name; - } - for (var key in params) { - eve("raphael.attr." + key + "." + this.id, this, params[key]); - } - for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) { - var par = this.paper.customAttributes[key].apply(this, [].concat(params[key])); - this.attrs[key] = params[key]; - for (var subkey in par) if (par[has](subkey)) { - params[subkey] = par[subkey]; - } - } - setFillAndStroke(this, params); - return this; - }; - /*\ - * Element.toFront - [ method ] - ** - * Moves the element so it is the closest to the viewer’s eyes, on top of other elements. - = (object) @Element - \*/ - elproto.toFront = function () { - if (this.removed) { - return this; - } - var node = getRealNode(this.node); - node.parentNode.appendChild(node); - var svg = this.paper; - svg.top != this && R._tofront(this, svg); - return this; - }; - /*\ - * Element.toBack - [ method ] - ** - * Moves the element so it is the furthest from the viewer’s eyes, behind other elements. - = (object) @Element - \*/ - elproto.toBack = function () { - if (this.removed) { - return this; - } - var node = getRealNode(this.node); - var parentNode = node.parentNode; - parentNode.insertBefore(node, parentNode.firstChild); - R._toback(this, this.paper); - var svg = this.paper; - return this; - }; - /*\ - * Element.insertAfter - [ method ] - ** - * Inserts current object after the given one. - = (object) @Element - \*/ - elproto.insertAfter = function (element) { - if (this.removed || !element) { - return this; - } - - var node = getRealNode(this.node); - var afterNode = getRealNode(element.node || element[element.length - 1].node); - if (afterNode.nextSibling) { - afterNode.parentNode.insertBefore(node, afterNode.nextSibling); - } else { - afterNode.parentNode.appendChild(node); - } - R._insertafter(this, element, this.paper); - return this; - }; - /*\ - * Element.insertBefore - [ method ] - ** - * Inserts current object before the given one. - = (object) @Element - \*/ - elproto.insertBefore = function (element) { - if (this.removed || !element) { - return this; - } - - var node = getRealNode(this.node); - var beforeNode = getRealNode(element.node || element[0].node); - beforeNode.parentNode.insertBefore(node, beforeNode); - R._insertbefore(this, element, this.paper); - return this; - }; - elproto.blur = function (size) { - // Experimental. No Safari support. Use it on your own risk. - var t = this; - if (+size !== 0) { - var fltr = $("filter"), - blur = $("feGaussianBlur"); - t.attrs.blur = size; - fltr.id = R.createUUID(); - $(blur, {stdDeviation: +size || 1.5}); - fltr.appendChild(blur); - t.paper.defs.appendChild(fltr); - t._blur = fltr; - $(t.node, {filter: "url(#" + fltr.id + ")"}); - } else { - if (t._blur) { - t._blur.parentNode.removeChild(t._blur); - delete t._blur; - delete t.attrs.blur; - } - t.node.removeAttribute("filter"); - } - return t; - }; - R._engine.circle = function (svg, x, y, r) { - var el = $("circle"); - svg.canvas && svg.canvas.appendChild(el); - var res = new Element(el, svg); - res.attrs = {cx: x, cy: y, r: r, fill: "none", stroke: "#000"}; - res.type = "circle"; - $(el, res.attrs); - return res; - }; - R._engine.rect = function (svg, x, y, w, h, r) { - var el = $("rect"); - svg.canvas && svg.canvas.appendChild(el); - var res = new Element(el, svg); - res.attrs = {x: x, y: y, width: w, height: h, rx: r || 0, ry: r || 0, fill: "none", stroke: "#000"}; - res.type = "rect"; - $(el, res.attrs); - return res; - }; - R._engine.ellipse = function (svg, x, y, rx, ry) { - var el = $("ellipse"); - svg.canvas && svg.canvas.appendChild(el); - var res = new Element(el, svg); - res.attrs = {cx: x, cy: y, rx: rx, ry: ry, fill: "none", stroke: "#000"}; - res.type = "ellipse"; - $(el, res.attrs); - return res; - }; - R._engine.image = function (svg, src, x, y, w, h) { - var el = $("image"); - $(el, {x: x, y: y, width: w, height: h, preserveAspectRatio: "none"}); - el.setAttributeNS(xlink, "href", src); - svg.canvas && svg.canvas.appendChild(el); - var res = new Element(el, svg); - res.attrs = {x: x, y: y, width: w, height: h, src: src}; - res.type = "image"; - return res; - }; - R._engine.text = function (svg, x, y, text) { - var el = $("text"); - svg.canvas && svg.canvas.appendChild(el); - var res = new Element(el, svg); - res.attrs = { - x: x, - y: y, - "text-anchor": "middle", - text: text, - "font-family": R._availableAttrs["font-family"], - "font-size": R._availableAttrs["font-size"], - stroke: "none", - fill: "#000" - }; - res.type = "text"; - setFillAndStroke(res, res.attrs); - return res; - }; - R._engine.setSize = function (width, height) { - this.width = width || this.width; - this.height = height || this.height; - this.canvas.setAttribute("width", this.width); - this.canvas.setAttribute("height", this.height); - if (this._viewBox) { - this.setViewBox.apply(this, this._viewBox); - } - return this; - }; - R._engine.create = function () { - var con = R._getContainer.apply(0, arguments), - container = con && con.container; - if (!container) { - throw new Error("SVG container not found."); - } - var x = con.x, - y = con.y, - width = con.width, - height = con.height, - cnvs = $("svg"), - css = "overflow:hidden;", - isFloating; - x = x || 0; - y = y || 0; - width = width || 512; - height = height || 342; - $(cnvs, { - height: height, - version: 1.1, - width: width, - xmlns: "http://www.w3.org/2000/svg", - "xmlns:xlink": "http://www.w3.org/1999/xlink" - }); - if (container == 1) { - cnvs.style.cssText = css + "position:absolute;left:" + x + "px;top:" + y + "px"; - R._g.doc.body.appendChild(cnvs); - isFloating = 1; - } else { - cnvs.style.cssText = css + "position:relative"; - if (container.firstChild) { - container.insertBefore(cnvs, container.firstChild); - } else { - container.appendChild(cnvs); - } - } - container = new R._Paper; - container.width = width; - container.height = height; - container.canvas = cnvs; - container.clear(); - container._left = container._top = 0; - isFloating && (container.renderfix = function () {}); - container.renderfix(); - return container; - }; - R._engine.setViewBox = function (x, y, w, h, fit) { - eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]); - var paperSize = this.getSize(), - size = mmax(w / paperSize.width, h / paperSize.height), - top = this.top, - aspectRatio = fit ? "xMidYMid meet" : "xMinYMin", - vb, - sw; - if (x == null) { - if (this._vbSize) { - size = 1; - } - delete this._vbSize; - vb = "0 0 " + this.width + S + this.height; - } else { - this._vbSize = size; - vb = x + S + y + S + w + S + h; - } - $(this.canvas, { - viewBox: vb, - preserveAspectRatio: aspectRatio - }); - while (size && top) { - sw = "stroke-width" in top.attrs ? top.attrs["stroke-width"] : 1; - top.attr({"stroke-width": sw}); - top._.dirty = 1; - top._.dirtyT = 1; - top = top.prev; - } - this._viewBox = [x, y, w, h, !!fit]; - return this; - }; - /*\ - * Paper.renderfix - [ method ] - ** - * Fixes the issue of Firefox and IE9 regarding subpixel rendering. If paper is dependent - * on other elements after reflow it could shift half pixel which cause for lines to lost their crispness. - * This method fixes the issue. - ** - Special thanks to Mariusz Nowak (http://www.medikoo.com/) for this method. - \*/ - R.prototype.renderfix = function () { - var cnvs = this.canvas, - s = cnvs.style, - pos; - try { - pos = cnvs.getScreenCTM() || cnvs.createSVGMatrix(); - } catch (e) { - pos = cnvs.createSVGMatrix(); - } - var left = -pos.e % 1, - top = -pos.f % 1; - if (left || top) { - if (left) { - this._left = (this._left + left) % 1; - s.left = this._left + "px"; - } - if (top) { - this._top = (this._top + top) % 1; - s.top = this._top + "px"; - } - } - }; - /*\ - * Paper.clear - [ method ] - ** - * Clears the paper, i.e. removes all the elements. - \*/ - R.prototype.clear = function () { - R.eve("raphael.clear", this); - var c = this.canvas; - while (c.firstChild) { - c.removeChild(c.firstChild); - } - this.bottom = this.top = null; - (this.desc = $("desc")).appendChild(R._g.doc.createTextNode("Created with Rapha\xebl " + R.version)); - c.appendChild(this.desc); - c.appendChild(this.defs = $("defs")); - }; - /*\ - * Paper.remove - [ method ] - ** - * Removes the paper from the DOM. - \*/ - R.prototype.remove = function () { - eve("raphael.remove", this); - this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas); - for (var i in this) { - this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; - } - }; - var setproto = R.st; - for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) { - setproto[method] = (function (methodname) { - return function () { - var arg = arguments; - return this.forEach(function (el) { - el[methodname].apply(el, arg); - }); - }; - })(method); - } -}); diff --git a/plugins/raphael/dev/raphael.vml.js b/plugins/raphael/dev/raphael.vml.js deleted file mode 100644 index f287632d4..000000000 --- a/plugins/raphael/dev/raphael.vml.js +++ /dev/null @@ -1,999 +0,0 @@ -define(["./raphael.core"], function(R) { - if (R && !R.vml) { - return; - } - - var has = "hasOwnProperty", - Str = String, - toFloat = parseFloat, - math = Math, - round = math.round, - mmax = math.max, - mmin = math.min, - abs = math.abs, - fillString = "fill", - separator = /[, ]+/, - eve = R.eve, - ms = " progid:DXImageTransform.Microsoft", - S = " ", - E = "", - map = {M: "m", L: "l", C: "c", Z: "x", m: "t", l: "r", c: "v", z: "x"}, - bites = /([clmz]),?([^clmz]*)/gi, - blurregexp = / progid:\S+Blur\([^\)]+\)/g, - val = /-?[^,\s-]+/g, - cssDot = "position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)", - zoom = 21600, - pathTypes = {path: 1, rect: 1, image: 1}, - ovalTypes = {circle: 1, ellipse: 1}, - path2vml = function (path) { - var total = /[ahqstv]/ig, - command = R._pathToAbsolute; - Str(path).match(total) && (command = R._path2curve); - total = /[clmz]/g; - if (command == R._pathToAbsolute && !Str(path).match(total)) { - var res = Str(path).replace(bites, function (all, command, args) { - var vals = [], - isMove = command.toLowerCase() == "m", - res = map[command]; - args.replace(val, function (value) { - if (isMove && vals.length == 2) { - res += vals + map[command == "m" ? "l" : "L"]; - vals = []; - } - vals.push(round(value * zoom)); - }); - return res + vals; - }); - return res; - } - var pa = command(path), p, r; - res = []; - for (var i = 0, ii = pa.length; i < ii; i++) { - p = pa[i]; - r = pa[i][0].toLowerCase(); - r == "z" && (r = "x"); - for (var j = 1, jj = p.length; j < jj; j++) { - r += round(p[j] * zoom) + (j != jj - 1 ? "," : E); - } - res.push(r); - } - return res.join(S); - }, - compensation = function (deg, dx, dy) { - var m = R.matrix(); - m.rotate(-deg, .5, .5); - return { - dx: m.x(dx, dy), - dy: m.y(dx, dy) - }; - }, - setCoords = function (p, sx, sy, dx, dy, deg) { - var _ = p._, - m = p.matrix, - fillpos = _.fillpos, - o = p.node, - s = o.style, - y = 1, - flip = "", - dxdy, - kx = zoom / sx, - ky = zoom / sy; - s.visibility = "hidden"; - if (!sx || !sy) { - return; - } - o.coordsize = abs(kx) + S + abs(ky); - s.rotation = deg * (sx * sy < 0 ? -1 : 1); - if (deg) { - var c = compensation(deg, dx, dy); - dx = c.dx; - dy = c.dy; - } - sx < 0 && (flip += "x"); - sy < 0 && (flip += " y") && (y = -1); - s.flip = flip; - o.coordorigin = (dx * -kx) + S + (dy * -ky); - if (fillpos || _.fillsize) { - var fill = o.getElementsByTagName(fillString); - fill = fill && fill[0]; - o.removeChild(fill); - if (fillpos) { - c = compensation(deg, m.x(fillpos[0], fillpos[1]), m.y(fillpos[0], fillpos[1])); - fill.position = c.dx * y + S + c.dy * y; - } - if (_.fillsize) { - fill.size = _.fillsize[0] * abs(sx) + S + _.fillsize[1] * abs(sy); - } - o.appendChild(fill); - } - s.visibility = "visible"; - }; - R.toString = function () { - return "Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl " + this.version; - }; - var addArrow = function (o, value, isEnd) { - var values = Str(value).toLowerCase().split("-"), - se = isEnd ? "end" : "start", - i = values.length, - type = "classic", - w = "medium", - h = "medium"; - while (i--) { - switch (values[i]) { - case "block": - case "classic": - case "oval": - case "diamond": - case "open": - case "none": - type = values[i]; - break; - case "wide": - case "narrow": h = values[i]; break; - case "long": - case "short": w = values[i]; break; - } - } - var stroke = o.node.getElementsByTagName("stroke")[0]; - stroke[se + "arrow"] = type; - stroke[se + "arrowlength"] = w; - stroke[se + "arrowwidth"] = h; - }, - setFillAndStroke = function (o, params) { - // o.paper.canvas.style.display = "none"; - o.attrs = o.attrs || {}; - var node = o.node, - a = o.attrs, - s = node.style, - xy, - newpath = pathTypes[o.type] && (params.x != a.x || params.y != a.y || params.width != a.width || params.height != a.height || params.cx != a.cx || params.cy != a.cy || params.rx != a.rx || params.ry != a.ry || params.r != a.r), - isOval = ovalTypes[o.type] && (a.cx != params.cx || a.cy != params.cy || a.r != params.r || a.rx != params.rx || a.ry != params.ry), - res = o; - - - for (var par in params) if (params[has](par)) { - a[par] = params[par]; - } - if (newpath) { - a.path = R._getPath[o.type](o); - o._.dirty = 1; - } - params.href && (node.href = params.href); - params.title && (node.title = params.title); - params.target && (node.target = params.target); - params.cursor && (s.cursor = params.cursor); - "blur" in params && o.blur(params.blur); - if (params.path && o.type == "path" || newpath) { - node.path = path2vml(~Str(a.path).toLowerCase().indexOf("r") ? R._pathToAbsolute(a.path) : a.path); - o._.dirty = 1; - if (o.type == "image") { - o._.fillpos = [a.x, a.y]; - o._.fillsize = [a.width, a.height]; - setCoords(o, 1, 1, 0, 0, 0); - } - } - "transform" in params && o.transform(params.transform); - if (isOval) { - var cx = +a.cx, - cy = +a.cy, - rx = +a.rx || +a.r || 0, - ry = +a.ry || +a.r || 0; - node.path = R.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x", round((cx - rx) * zoom), round((cy - ry) * zoom), round((cx + rx) * zoom), round((cy + ry) * zoom), round(cx * zoom)); - o._.dirty = 1; - } - if ("clip-rect" in params) { - var rect = Str(params["clip-rect"]).split(separator); - if (rect.length == 4) { - rect[2] = +rect[2] + (+rect[0]); - rect[3] = +rect[3] + (+rect[1]); - var div = node.clipRect || R._g.doc.createElement("div"), - dstyle = div.style; - dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect); - if (!node.clipRect) { - dstyle.position = "absolute"; - dstyle.top = 0; - dstyle.left = 0; - dstyle.width = o.paper.width + "px"; - dstyle.height = o.paper.height + "px"; - node.parentNode.insertBefore(div, node); - div.appendChild(node); - node.clipRect = div; - } - } - if (!params["clip-rect"]) { - node.clipRect && (node.clipRect.style.clip = "auto"); - } - } - if (o.textpath) { - var textpathStyle = o.textpath.style; - params.font && (textpathStyle.font = params.font); - params["font-family"] && (textpathStyle.fontFamily = '"' + params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, E) + '"'); - params["font-size"] && (textpathStyle.fontSize = params["font-size"]); - params["font-weight"] && (textpathStyle.fontWeight = params["font-weight"]); - params["font-style"] && (textpathStyle.fontStyle = params["font-style"]); - } - if ("arrow-start" in params) { - addArrow(res, params["arrow-start"]); - } - if ("arrow-end" in params) { - addArrow(res, params["arrow-end"], 1); - } - if (params.opacity != null || - params.fill != null || - params.src != null || - params.stroke != null || - params["stroke-width"] != null || - params["stroke-opacity"] != null || - params["fill-opacity"] != null || - params["stroke-dasharray"] != null || - params["stroke-miterlimit"] != null || - params["stroke-linejoin"] != null || - params["stroke-linecap"] != null) { - var fill = node.getElementsByTagName(fillString), - newfill = false; - fill = fill && fill[0]; - !fill && (newfill = fill = createNode(fillString)); - if (o.type == "image" && params.src) { - fill.src = params.src; - } - params.fill && (fill.on = true); - if (fill.on == null || params.fill == "none" || params.fill === null) { - fill.on = false; - } - if (fill.on && params.fill) { - var isURL = Str(params.fill).match(R._ISURL); - if (isURL) { - fill.parentNode == node && node.removeChild(fill); - fill.rotate = true; - fill.src = isURL[1]; - fill.type = "tile"; - var bbox = o.getBBox(1); - fill.position = bbox.x + S + bbox.y; - o._.fillpos = [bbox.x, bbox.y]; - - R._preload(isURL[1], function () { - o._.fillsize = [this.offsetWidth, this.offsetHeight]; - }); - } else { - fill.color = R.getRGB(params.fill).hex; - fill.src = E; - fill.type = "solid"; - if (R.getRGB(params.fill).error && (res.type in {circle: 1, ellipse: 1} || Str(params.fill).charAt() != "r") && addGradientFill(res, params.fill, fill)) { - a.fill = "none"; - a.gradient = params.fill; - fill.rotate = false; - } - } - } - if ("fill-opacity" in params || "opacity" in params) { - var opacity = ((+a["fill-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+R.getRGB(params.fill).o + 1 || 2) - 1); - opacity = mmin(mmax(opacity, 0), 1); - fill.opacity = opacity; - if (fill.src) { - fill.color = "none"; - } - } - node.appendChild(fill); - var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]), - newstroke = false; - !stroke && (newstroke = stroke = createNode("stroke")); - if ((params.stroke && params.stroke != "none") || - params["stroke-width"] || - params["stroke-opacity"] != null || - params["stroke-dasharray"] || - params["stroke-miterlimit"] || - params["stroke-linejoin"] || - params["stroke-linecap"]) { - stroke.on = true; - } - (params.stroke == "none" || params.stroke === null || stroke.on == null || params.stroke == 0 || params["stroke-width"] == 0) && (stroke.on = false); - var strokeColor = R.getRGB(params.stroke); - stroke.on && params.stroke && (stroke.color = strokeColor.hex); - opacity = ((+a["stroke-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+strokeColor.o + 1 || 2) - 1); - var width = (toFloat(params["stroke-width"]) || 1) * .75; - opacity = mmin(mmax(opacity, 0), 1); - params["stroke-width"] == null && (width = a["stroke-width"]); - params["stroke-width"] && (stroke.weight = width); - width && width < 1 && (opacity *= width) && (stroke.weight = 1); - stroke.opacity = opacity; - - params["stroke-linejoin"] && (stroke.joinstyle = params["stroke-linejoin"] || "miter"); - stroke.miterlimit = params["stroke-miterlimit"] || 8; - params["stroke-linecap"] && (stroke.endcap = params["stroke-linecap"] == "butt" ? "flat" : params["stroke-linecap"] == "square" ? "square" : "round"); - if ("stroke-dasharray" in params) { - var dasharray = { - "-": "shortdash", - ".": "shortdot", - "-.": "shortdashdot", - "-..": "shortdashdotdot", - ". ": "dot", - "- ": "dash", - "--": "longdash", - "- .": "dashdot", - "--.": "longdashdot", - "--..": "longdashdotdot" - }; - stroke.dashstyle = dasharray[has](params["stroke-dasharray"]) ? dasharray[params["stroke-dasharray"]] : E; - } - newstroke && node.appendChild(stroke); - } - if (res.type == "text") { - res.paper.canvas.style.display = E; - var span = res.paper.span, - m = 100, - fontSize = a.font && a.font.match(/\d+(?:\.\d*)?(?=px)/); - s = span.style; - a.font && (s.font = a.font); - a["font-family"] && (s.fontFamily = a["font-family"]); - a["font-weight"] && (s.fontWeight = a["font-weight"]); - a["font-style"] && (s.fontStyle = a["font-style"]); - fontSize = toFloat(a["font-size"] || fontSize && fontSize[0]) || 10; - s.fontSize = fontSize * m + "px"; - res.textpath.string && (span.innerHTML = Str(res.textpath.string).replace(/</g, "<").replace(/&/g, "&").replace(/\n/g, "<br>")); - var brect = span.getBoundingClientRect(); - res.W = a.w = (brect.right - brect.left) / m; - res.H = a.h = (brect.bottom - brect.top) / m; - // res.paper.canvas.style.display = "none"; - res.X = a.x; - res.Y = a.y + res.H / 2; - - ("x" in params || "y" in params) && (res.path.v = R.format("m{0},{1}l{2},{1}", round(a.x * zoom), round(a.y * zoom), round(a.x * zoom) + 1)); - var dirtyattrs = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"]; - for (var d = 0, dd = dirtyattrs.length; d < dd; d++) if (dirtyattrs[d] in params) { - res._.dirty = 1; - break; - } - - // text-anchor emulation - switch (a["text-anchor"]) { - case "start": - res.textpath.style["v-text-align"] = "left"; - res.bbx = res.W / 2; - break; - case "end": - res.textpath.style["v-text-align"] = "right"; - res.bbx = -res.W / 2; - break; - default: - res.textpath.style["v-text-align"] = "center"; - res.bbx = 0; - break; - } - res.textpath.style["v-text-kern"] = true; - } - // res.paper.canvas.style.display = E; - }, - addGradientFill = function (o, gradient, fill) { - o.attrs = o.attrs || {}; - var attrs = o.attrs, - pow = Math.pow, - opacity, - oindex, - type = "linear", - fxfy = ".5 .5"; - o.attrs.gradient = gradient; - gradient = Str(gradient).replace(R._radial_gradient, function (all, fx, fy) { - type = "radial"; - if (fx && fy) { - fx = toFloat(fx); - fy = toFloat(fy); - pow(fx - .5, 2) + pow(fy - .5, 2) > .25 && (fy = math.sqrt(.25 - pow(fx - .5, 2)) * ((fy > .5) * 2 - 1) + .5); - fxfy = fx + S + fy; - } - return E; - }); - gradient = gradient.split(/\s*\-\s*/); - if (type == "linear") { - var angle = gradient.shift(); - angle = -toFloat(angle); - if (isNaN(angle)) { - return null; - } - } - var dots = R._parseDots(gradient); - if (!dots) { - return null; - } - o = o.shape || o.node; - if (dots.length) { - o.removeChild(fill); - fill.on = true; - fill.method = "none"; - fill.color = dots[0].color; - fill.color2 = dots[dots.length - 1].color; - var clrs = []; - for (var i = 0, ii = dots.length; i < ii; i++) { - dots[i].offset && clrs.push(dots[i].offset + S + dots[i].color); - } - fill.colors = clrs.length ? clrs.join() : "0% " + fill.color; - if (type == "radial") { - fill.type = "gradientTitle"; - fill.focus = "100%"; - fill.focussize = "0 0"; - fill.focusposition = fxfy; - fill.angle = 0; - } else { - // fill.rotate= true; - fill.type = "gradient"; - fill.angle = (270 - angle) % 360; - } - o.appendChild(fill); - } - return 1; - }, - Element = function (node, vml) { - this[0] = this.node = node; - node.raphael = true; - this.id = R._oid++; - node.raphaelid = this.id; - this.X = 0; - this.Y = 0; - this.attrs = {}; - this.paper = vml; - this.matrix = R.matrix(); - this._ = { - transform: [], - sx: 1, - sy: 1, - dx: 0, - dy: 0, - deg: 0, - dirty: 1, - dirtyT: 1 - }; - !vml.bottom && (vml.bottom = this); - this.prev = vml.top; - vml.top && (vml.top.next = this); - vml.top = this; - this.next = null; - }; - var elproto = R.el; - - Element.prototype = elproto; - elproto.constructor = Element; - elproto.transform = function (tstr) { - if (tstr == null) { - return this._.transform; - } - var vbs = this.paper._viewBoxShift, - vbt = vbs ? "s" + [vbs.scale, vbs.scale] + "-1-1t" + [vbs.dx, vbs.dy] : E, - oldt; - if (vbs) { - oldt = tstr = Str(tstr).replace(/\.{3}|\u2026/g, this._.transform || E); - } - R._extractTransform(this, vbt + tstr); - var matrix = this.matrix.clone(), - skew = this.skew, - o = this.node, - split, - isGrad = ~Str(this.attrs.fill).indexOf("-"), - isPatt = !Str(this.attrs.fill).indexOf("url("); - matrix.translate(1, 1); - if (isPatt || isGrad || this.type == "image") { - skew.matrix = "1 0 0 1"; - skew.offset = "0 0"; - split = matrix.split(); - if ((isGrad && split.noRotation) || !split.isSimple) { - o.style.filter = matrix.toFilter(); - var bb = this.getBBox(), - bbt = this.getBBox(1), - dx = bb.x - bbt.x, - dy = bb.y - bbt.y; - o.coordorigin = (dx * -zoom) + S + (dy * -zoom); - setCoords(this, 1, 1, dx, dy, 0); - } else { - o.style.filter = E; - setCoords(this, split.scalex, split.scaley, split.dx, split.dy, split.rotate); - } - } else { - o.style.filter = E; - skew.matrix = Str(matrix); - skew.offset = matrix.offset(); - } - if (oldt !== null) { // empty string value is true as well - this._.transform = oldt; - R._extractTransform(this, oldt); - } - return this; - }; - elproto.rotate = function (deg, cx, cy) { - if (this.removed) { - return this; - } - if (deg == null) { - return; - } - deg = Str(deg).split(separator); - if (deg.length - 1) { - cx = toFloat(deg[1]); - cy = toFloat(deg[2]); - } - deg = toFloat(deg[0]); - (cy == null) && (cx = cy); - if (cx == null || cy == null) { - var bbox = this.getBBox(1); - cx = bbox.x + bbox.width / 2; - cy = bbox.y + bbox.height / 2; - } - this._.dirtyT = 1; - this.transform(this._.transform.concat([["r", deg, cx, cy]])); - return this; - }; - elproto.translate = function (dx, dy) { - if (this.removed) { - return this; - } - dx = Str(dx).split(separator); - if (dx.length - 1) { - dy = toFloat(dx[1]); - } - dx = toFloat(dx[0]) || 0; - dy = +dy || 0; - if (this._.bbox) { - this._.bbox.x += dx; - this._.bbox.y += dy; - } - this.transform(this._.transform.concat([["t", dx, dy]])); - return this; - }; - elproto.scale = function (sx, sy, cx, cy) { - if (this.removed) { - return this; - } - sx = Str(sx).split(separator); - if (sx.length - 1) { - sy = toFloat(sx[1]); - cx = toFloat(sx[2]); - cy = toFloat(sx[3]); - isNaN(cx) && (cx = null); - isNaN(cy) && (cy = null); - } - sx = toFloat(sx[0]); - (sy == null) && (sy = sx); - (cy == null) && (cx = cy); - if (cx == null || cy == null) { - var bbox = this.getBBox(1); - } - cx = cx == null ? bbox.x + bbox.width / 2 : cx; - cy = cy == null ? bbox.y + bbox.height / 2 : cy; - - this.transform(this._.transform.concat([["s", sx, sy, cx, cy]])); - this._.dirtyT = 1; - return this; - }; - elproto.hide = function () { - !this.removed && (this.node.style.display = "none"); - return this; - }; - elproto.show = function () { - !this.removed && (this.node.style.display = E); - return this; - }; - // Needed to fix the vml setViewBox issues - elproto.auxGetBBox = R.el.getBBox; - elproto.getBBox = function(){ - var b = this.auxGetBBox(); - if (this.paper && this.paper._viewBoxShift) - { - var c = {}; - var z = 1/this.paper._viewBoxShift.scale; - c.x = b.x - this.paper._viewBoxShift.dx; - c.x *= z; - c.y = b.y - this.paper._viewBoxShift.dy; - c.y *= z; - c.width = b.width * z; - c.height = b.height * z; - c.x2 = c.x + c.width; - c.y2 = c.y + c.height; - return c; - } - return b; - }; - elproto._getBBox = function () { - if (this.removed) { - return {}; - } - return { - x: this.X + (this.bbx || 0) - this.W / 2, - y: this.Y - this.H, - width: this.W, - height: this.H - }; - }; - elproto.remove = function () { - if (this.removed || !this.node.parentNode) { - return; - } - this.paper.__set__ && this.paper.__set__.exclude(this); - R.eve.unbind("raphael.*.*." + this.id); - R._tear(this, this.paper); - this.node.parentNode.removeChild(this.node); - this.shape && this.shape.parentNode.removeChild(this.shape); - for (var i in this) { - this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; - } - this.removed = true; - }; - elproto.attr = function (name, value) { - if (this.removed) { - return this; - } - if (name == null) { - var res = {}; - for (var a in this.attrs) if (this.attrs[has](a)) { - res[a] = this.attrs[a]; - } - res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient; - res.transform = this._.transform; - return res; - } - if (value == null && R.is(name, "string")) { - if (name == fillString && this.attrs.fill == "none" && this.attrs.gradient) { - return this.attrs.gradient; - } - var names = name.split(separator), - out = {}; - for (var i = 0, ii = names.length; i < ii; i++) { - name = names[i]; - if (name in this.attrs) { - out[name] = this.attrs[name]; - } else if (R.is(this.paper.customAttributes[name], "function")) { - out[name] = this.paper.customAttributes[name].def; - } else { - out[name] = R._availableAttrs[name]; - } - } - return ii - 1 ? out : out[names[0]]; - } - if (this.attrs && value == null && R.is(name, "array")) { - out = {}; - for (i = 0, ii = name.length; i < ii; i++) { - out[name[i]] = this.attr(name[i]); - } - return out; - } - var params; - if (value != null) { - params = {}; - params[name] = value; - } - value == null && R.is(name, "object") && (params = name); - for (var key in params) { - eve("raphael.attr." + key + "." + this.id, this, params[key]); - } - if (params) { - for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) { - var par = this.paper.customAttributes[key].apply(this, [].concat(params[key])); - this.attrs[key] = params[key]; - for (var subkey in par) if (par[has](subkey)) { - params[subkey] = par[subkey]; - } - } - // this.paper.canvas.style.display = "none"; - if (params.text && this.type == "text") { - this.textpath.string = params.text; - } - setFillAndStroke(this, params); - // this.paper.canvas.style.display = E; - } - return this; - }; - elproto.toFront = function () { - !this.removed && this.node.parentNode.appendChild(this.node); - this.paper && this.paper.top != this && R._tofront(this, this.paper); - return this; - }; - elproto.toBack = function () { - if (this.removed) { - return this; - } - if (this.node.parentNode.firstChild != this.node) { - this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild); - R._toback(this, this.paper); - } - return this; - }; - elproto.insertAfter = function (element) { - if (this.removed) { - return this; - } - if (element.constructor == R.st.constructor) { - element = element[element.length - 1]; - } - if (element.node.nextSibling) { - element.node.parentNode.insertBefore(this.node, element.node.nextSibling); - } else { - element.node.parentNode.appendChild(this.node); - } - R._insertafter(this, element, this.paper); - return this; - }; - elproto.insertBefore = function (element) { - if (this.removed) { - return this; - } - if (element.constructor == R.st.constructor) { - element = element[0]; - } - element.node.parentNode.insertBefore(this.node, element.node); - R._insertbefore(this, element, this.paper); - return this; - }; - elproto.blur = function (size) { - var s = this.node.runtimeStyle, - f = s.filter; - f = f.replace(blurregexp, E); - if (+size !== 0) { - this.attrs.blur = size; - s.filter = f + S + ms + ".Blur(pixelradius=" + (+size || 1.5) + ")"; - s.margin = R.format("-{0}px 0 0 -{0}px", round(+size || 1.5)); - } else { - s.filter = f; - s.margin = 0; - delete this.attrs.blur; - } - return this; - }; - - R._engine.path = function (pathString, vml) { - var el = createNode("shape"); - el.style.cssText = cssDot; - el.coordsize = zoom + S + zoom; - el.coordorigin = vml.coordorigin; - var p = new Element(el, vml), - attr = {fill: "none", stroke: "#000"}; - pathString && (attr.path = pathString); - p.type = "path"; - p.path = []; - p.Path = E; - setFillAndStroke(p, attr); - vml.canvas && vml.canvas.appendChild(el); - var skew = createNode("skew"); - skew.on = true; - el.appendChild(skew); - p.skew = skew; - p.transform(E); - return p; - }; - R._engine.rect = function (vml, x, y, w, h, r) { - var path = R._rectPath(x, y, w, h, r), - res = vml.path(path), - a = res.attrs; - res.X = a.x = x; - res.Y = a.y = y; - res.W = a.width = w; - res.H = a.height = h; - a.r = r; - a.path = path; - res.type = "rect"; - return res; - }; - R._engine.ellipse = function (vml, x, y, rx, ry) { - var res = vml.path(), - a = res.attrs; - res.X = x - rx; - res.Y = y - ry; - res.W = rx * 2; - res.H = ry * 2; - res.type = "ellipse"; - setFillAndStroke(res, { - cx: x, - cy: y, - rx: rx, - ry: ry - }); - return res; - }; - R._engine.circle = function (vml, x, y, r) { - var res = vml.path(), - a = res.attrs; - res.X = x - r; - res.Y = y - r; - res.W = res.H = r * 2; - res.type = "circle"; - setFillAndStroke(res, { - cx: x, - cy: y, - r: r - }); - return res; - }; - R._engine.image = function (vml, src, x, y, w, h) { - var path = R._rectPath(x, y, w, h), - res = vml.path(path).attr({stroke: "none"}), - a = res.attrs, - node = res.node, - fill = node.getElementsByTagName(fillString)[0]; - a.src = src; - res.X = a.x = x; - res.Y = a.y = y; - res.W = a.width = w; - res.H = a.height = h; - a.path = path; - res.type = "image"; - fill.parentNode == node && node.removeChild(fill); - fill.rotate = true; - fill.src = src; - fill.type = "tile"; - res._.fillpos = [x, y]; - res._.fillsize = [w, h]; - node.appendChild(fill); - setCoords(res, 1, 1, 0, 0, 0); - return res; - }; - R._engine.text = function (vml, x, y, text) { - var el = createNode("shape"), - path = createNode("path"), - o = createNode("textpath"); - x = x || 0; - y = y || 0; - text = text || ""; - path.v = R.format("m{0},{1}l{2},{1}", round(x * zoom), round(y * zoom), round(x * zoom) + 1); - path.textpathok = true; - o.string = Str(text); - o.on = true; - el.style.cssText = cssDot; - el.coordsize = zoom + S + zoom; - el.coordorigin = "0 0"; - var p = new Element(el, vml), - attr = { - fill: "#000", - stroke: "none", - font: R._availableAttrs.font, - text: text - }; - p.shape = el; - p.path = path; - p.textpath = o; - p.type = "text"; - p.attrs.text = Str(text); - p.attrs.x = x; - p.attrs.y = y; - p.attrs.w = 1; - p.attrs.h = 1; - setFillAndStroke(p, attr); - el.appendChild(o); - el.appendChild(path); - vml.canvas.appendChild(el); - var skew = createNode("skew"); - skew.on = true; - el.appendChild(skew); - p.skew = skew; - p.transform(E); - return p; - }; - R._engine.setSize = function (width, height) { - var cs = this.canvas.style; - this.width = width; - this.height = height; - width == +width && (width += "px"); - height == +height && (height += "px"); - cs.width = width; - cs.height = height; - cs.clip = "rect(0 " + width + " " + height + " 0)"; - if (this._viewBox) { - R._engine.setViewBox.apply(this, this._viewBox); - } - return this; - }; - R._engine.setViewBox = function (x, y, w, h, fit) { - R.eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]); - var paperSize = this.getSize(), - width = paperSize.width, - height = paperSize.height, - H, W; - if (fit) { - H = height / h; - W = width / w; - if (w * H < width) { - x -= (width - w * H) / 2 / H; - } - if (h * W < height) { - y -= (height - h * W) / 2 / W; - } - } - this._viewBox = [x, y, w, h, !!fit]; - this._viewBoxShift = { - dx: -x, - dy: -y, - scale: paperSize - }; - this.forEach(function (el) { - el.transform("..."); - }); - return this; - }; - var createNode; - R._engine.initWin = function (win) { - var doc = win.document; - if (doc.styleSheets.length < 31) { - doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)"); - } else { - // no more room, add to the existing one - // http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx - doc.styleSheets[0].addRule(".rvml", "behavior:url(#default#VML)"); - } - try { - !doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml"); - createNode = function (tagName) { - return doc.createElement('<rvml:' + tagName + ' class="rvml">'); - }; - } catch (e) { - createNode = function (tagName) { - return doc.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">'); - }; - } - }; - R._engine.initWin(R._g.win); - R._engine.create = function () { - var con = R._getContainer.apply(0, arguments), - container = con.container, - height = con.height, - s, - width = con.width, - x = con.x, - y = con.y; - if (!container) { - throw new Error("VML container not found."); - } - var res = new R._Paper, - c = res.canvas = R._g.doc.createElement("div"), - cs = c.style; - x = x || 0; - y = y || 0; - width = width || 512; - height = height || 342; - res.width = width; - res.height = height; - width == +width && (width += "px"); - height == +height && (height += "px"); - res.coordsize = zoom * 1e3 + S + zoom * 1e3; - res.coordorigin = "0 0"; - res.span = R._g.doc.createElement("span"); - res.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;"; - c.appendChild(res.span); - cs.cssText = R.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", width, height); - if (container == 1) { - R._g.doc.body.appendChild(c); - cs.left = x + "px"; - cs.top = y + "px"; - cs.position = "absolute"; - } else { - if (container.firstChild) { - container.insertBefore(c, container.firstChild); - } else { - container.appendChild(c); - } - } - res.renderfix = function () {}; - return res; - }; - R.prototype.clear = function () { - R.eve("raphael.clear", this); - this.canvas.innerHTML = E; - this.span = R._g.doc.createElement("span"); - this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;"; - this.canvas.appendChild(this.span); - this.bottom = this.top = null; - }; - R.prototype.remove = function () { - R.eve("raphael.remove", this); - this.canvas.parentNode.removeChild(this.canvas); - for (var i in this) { - this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; - } - return true; - }; - - var setproto = R.st; - for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) { - setproto[method] = (function (methodname) { - return function () { - var arg = arguments; - return this.forEach(function (el) { - el[methodname].apply(el, arg); - }); - }; - })(method); - } -}); diff --git a/plugins/raphael/dev/raphaelTest.html b/plugins/raphael/dev/raphaelTest.html deleted file mode 100644 index b57b487c1..000000000 --- a/plugins/raphael/dev/raphaelTest.html +++ /dev/null @@ -1,39 +0,0 @@ -<!DOCTYPE html> -<head> - <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> - <meta content="utf-8" http-equiv="encoding"> - <title>Raphael Dev testing html - - - - - - - - - - - - - - - - - - - - - - -
- - diff --git a/plugins/raphael/dev/test/index.html b/plugins/raphael/dev/test/index.html deleted file mode 100644 index 97fb9e05e..000000000 --- a/plugins/raphael/dev/test/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Raphael Test Suite - - - -
-
- - - - - - - \ No newline at end of file diff --git a/plugins/raphael/dev/test/svg/dom.js b/plugins/raphael/dev/test/svg/dom.js deleted file mode 100644 index f438818fb..000000000 --- a/plugins/raphael/dev/test/svg/dom.js +++ /dev/null @@ -1,316 +0,0 @@ -(function (assert) { - - let paper, - url = 'http://raphaeljs.com'; - - QUnit.module('DOM', { - beforeEach: function () { - paper = new Raphael(document.getElementById('qunit-fixture'), 1000, 1000); - }, - afterEach: function () { - paper.remove(); - } - }); - - const equalNodePosition = function (assert, node, expectedParent, expectedPreviousSibling, expectedNextSibling) { - assert.equal(node.parentNode, expectedParent); - assert.equal(node.previousSibling, expectedPreviousSibling); - assert.equal(node.nextSibling, expectedNextSibling); - }; - - const equalNodePositionWrapped = function (assert, node, anchor, expectedParent, expectedPreviousSibling, expectedNextSibling) { - assert.equal(node.parentNode, anchor); - equalNodePosition(assert, anchor, expectedParent, expectedPreviousSibling, expectedNextSibling); - }; - -// Element#insertBefore -// -------------------- - - QUnit.test('insertBefore: no element', function (assert) { - const el = paper.rect(); - - el.insertBefore(null); - - equalNodePosition(assert, el.node, paper.canvas, paper.defs, null); - }); - - QUnit.test('insertBefore: first element', function (assert) { - const x = paper.rect(); - const el = paper.rect(); - - el.insertBefore(x); - - equalNodePosition(assert, el.node, paper.canvas, paper.defs, x.node); - }); - - QUnit.test('insertBefore: middle element', function (assert) { - const x = paper.rect(); - const y = paper.rect(); - const el = paper.rect(); - - el.insertBefore(y); - - equalNodePosition(assert, el.node, paper.canvas, x.node, y.node); - }); - - QUnit.test('insertBefore: no element when wrapped in ', function (assert) { - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertBefore(null); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, paper.defs, null); - }); - - QUnit.test('insertBefore: first element when wrapped in ', function (assert) { - const x = paper.rect(); - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertBefore(x); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, paper.defs, x.node); - }); - - QUnit.test('insertBefore: first element wrapped in and wrapped in ', function (assert) { - const x = paper.rect().attr('href', url), - xAnchor = x.node.parentNode; - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertBefore(x); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, paper.defs, xAnchor); - }); - - QUnit.test('insertBefore: middle element when wrapped in ', function (assert) { - const x = paper.rect(); - const y = paper.rect(); - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertBefore(y); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, x.node, y.node); - }); - - QUnit.test('insertBefore: middle element wrapped in and wrapped in ', function (assert) { - const x = paper.rect().attr('href', url), - xAnchor = x.node.parentNode; - const y = paper.rect().attr('href', url), - yAnchor = y.node.parentNode; - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertBefore(y); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, xAnchor, yAnchor); - }); - -// TODO... -// insertBefore: with set -// insertBefore: with nested set. - -// Element#insertAfter -// ------------------- - - QUnit.test('insertAfter: no element', function (assert) { - const el = paper.rect(); - - el.insertAfter(null); - - equalNodePosition(assert, el.node, paper.canvas, paper.defs, null); - }); - - QUnit.test('insertAfter: last element', function (assert) { - const x = paper.rect(); - const el = paper.rect(); - - el.insertAfter(x); - - equalNodePosition(assert, el.node, paper.canvas, x.node, null); - }); - - QUnit.test('insertAfter: middle element', function (assert) { - const x = paper.rect(); - const y = paper.rect(); - const el = paper.rect(); - - el.insertAfter(x); - - equalNodePosition(assert, el.node, paper.canvas, x.node, y.node); - }); - - QUnit.test('insertAfter: no element when wrapped in ', function (assert) { - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertAfter(null); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, paper.defs, null); - }); - - QUnit.test('insertAfter: last element when wrapped in ', function (assert) { - const x = paper.rect(); - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertAfter(x); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, x.node, null); - }); - - QUnit.test('insertAfter: last element wrapped in and wrapped in ', function (assert) { - const x = paper.rect().attr('href', url), - xAnchor = x.node.parentNode; - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertAfter(x); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, xAnchor, null); - }); - - QUnit.test('insertAfter: middle element when wrapped in ', function (assert) { - const x = paper.rect(); - const y = paper.rect(); - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertAfter(x); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, x.node, y.node); - }); - - QUnit.test('insertAfter: middle element wrapped in and wrapped in ', function (assert) { - const x = paper.rect().attr('href', url), - xAnchor = x.node.parentNode; - const y = paper.rect().attr('href', url), - yAnchor = y.node.parentNode; - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.insertAfter(x); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, xAnchor, yAnchor); - }); - -// TODO... -// insertAfter: with set -// insertAfter: with nested set. - -// Element#remove -// -------------- - - QUnit.test('remove: after added', function (assert) { - const el = paper.rect(), - node = el.node; - - el.remove(); - - assert.equal(el.node, null); - assert.equal(node.parentNode, null); - }); - - QUnit.test('remove: when wrapped in ', function (assert) { - const el = paper.rect().attr('href', url), - node = el.node, - anchor = node.parentNode; - - el.remove(); - - assert.equal(el.node, null); - assert.equal(node.parentNode, anchor); - assert.equal(anchor.parentNode, null); - }); - - QUnit.test('remove: when already removed', function (assert) { - const el = paper.rect(), - node = el.node; - - el.remove(); - el.remove(); - - assert.equal(el.node, null); - assert.equal(node.parentNode, null); - }); - - QUnit.test('remove: when the canvas is removed', function (assert) { - const el = paper.rect(), - node = el.node; - - paper.remove(); - el.remove(); - - assert.equal(el.node, null); - assert.equal(node.parentNode, null); - }); - -// Element#toFront -// -------------- - - QUnit.test('toFront: normal', function (assert) { - const el = paper.rect(); - const x = paper.rect(); - - el.toFront(); - - equalNodePosition(assert, el.node, paper.canvas, x.node, null); - }); - - QUnit.test('toFront: when wrapped in ', function (assert) { - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - const x = paper.rect(); - - el.toFront(); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, x.node, null); - }); - -// Element#toBack -// -------------- - - QUnit.test('toBack: normal', function (assert) { - const x = paper.rect(); - const el = paper.rect(); - - el.toBack(); - - equalNodePosition(assert, el.node, paper.canvas, null, paper.desc); - equalNodePosition(assert, x.node, paper.canvas, paper.defs, null); - }); - - QUnit.test('toBack: when wrapped in ', function (assert) { - const x = paper.rect(); - const el = paper.rect().attr('href', url), - anchor = el.node.parentNode; - - el.toBack(); - - equalNodePositionWrapped(assert, el.node, anchor, paper.canvas, null, paper.desc); - equalNodePosition(assert, x.node, paper.canvas, paper.defs, null); - }); - - -// Element#attrs -// ------------- - -// #x - -// #y - -// #rx - -// #ry - -// #transform - -// #title - -// #href - -//keep adding and testing! - - -})(); \ No newline at end of file diff --git a/plugins/raphael/dev/test/vml/dom.js b/plugins/raphael/dev/test/vml/dom.js deleted file mode 100644 index 4edde991a..000000000 --- a/plugins/raphael/dev/test/vml/dom.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() { - -QUnit.module('DOM'); - -})(); \ No newline at end of file diff --git a/plugins/raphael/webpack.config.js b/plugins/raphael/webpack.config.js deleted file mode 100644 index 3fc4d4b00..000000000 --- a/plugins/raphael/webpack.config.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; - -const webpack = require("webpack"); -const fs = require("fs"); - -module.exports = function (env) { - - let externals = []; - - if (env && env.noDeps) { - console.log('Building version without deps'); - externals.push("eve"); - } - - return { - entry: './dev/raphael.amd.js', - output: { - path: __dirname, - filename: "raphael.js", - libraryTarget: "umd", - library: "Raphael" - }, - - externals: externals, - - plugins: [ - new webpack.BannerPlugin({ - banner: fs.readFileSync('./dev/banner.txt', 'utf8'), - raw: true, - entryOnly: true - }) - ], - resolve: { - alias: { - "eve": "eve-raphael/eve" - } - } - }; - -}; \ No newline at end of file diff --git a/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.scss b/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.scss deleted file mode 100644 index 1dd1d0e24..000000000 --- a/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.scss +++ /dev/null @@ -1,712 +0,0 @@ -@import '~sweetalert2/src/variables'; - -// Function -@function str-replace($string, $search, $replace: '') { - $index: str-index($string, $search); - - @if $index { - @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); - } - - @return $string; -} - -// Theme Variables -// Color -$bootstrap-primary: #007bff !default; -$bootstrap-success: #28a745 !default; -$bootstrap-danger: #dc3545 !default; -$bootstrap-warning: #ffc107 !default; -$bootstrap-info: #17a2b8 !default; -$bootstrap-secondary: #6c757d !default; - -$bootstrap-gray-100: #f8f9fa !default; -$bootstrap-gray-200: #e9ecef !default; -$bootstrap-gray-300: #dee2e6 !default; -$bootstrap-gray-400: #ced4da !default; -$bootstrap-gray-500: #adb5bd !default; -$bootstrap-gray-600: #6c757d !default; -$bootstrap-gray-700: #495057 !default; -$bootstrap-gray-800: #343a40 !default; -$bootstrap-gray-900: #212529 !default; - -$bootstrap-theme-color-interval: 8% !default; - -// Alert -$bootstrap-alert-border-level: -9 !default; -$bootstrap-alert-bg-level: -10 !default; -$bootstrap-alert-color-level: 6 !default; -$bootstrap-alert-border-color: mix($swal2-white, $bootstrap-secondary, abs($bootstrap-alert-border-level) * $bootstrap-theme-color-interval) !default; -$bootstrap-alert-background: mix($swal2-white, $bootstrap-secondary, abs($bootstrap-alert-bg-level) * $bootstrap-theme-color-interval) !default; -$bootstrap-alert-color: mix($swal2-black, $bootstrap-secondary, abs($bootstrap-alert-color-level) * $bootstrap-theme-color-interval) !default; -$bootstrap-alert-padding-y: .75rem !default; -$bootstrap-alert-padding-x: 1.25rem !default; -$bootstrap-alert-margin-bottom: 1rem !default; -$bootstrap-alert-border-radius: .25rem !default; -$bootstrap-alert-border-width: 1px !default; -$bootstrap-alert-font-size: 1rem !default; - -// Input -$bootstrap-input-color: $bootstrap-gray-700 !default; -$bootstrap-input-bg: $swal2-white !default; -$bootstrap-input-border-color: $bootstrap-gray-300 !default; -$bootstrap-input-border-radius: .25rem !default; -$bootstrap-input-border-width: 1px !default; -$bootstrap-input-padding-y: .375rem !default; -$bootstrap-input-padding-x: .75rem !default; -$bootstrap-input-line-height: 1.5 !default; -$bootstrap-input-height-border: $bootstrap-input-border-width * 2 !default; -$bootstrap-input-height: calc(#{$bootstrap-input-line-height * 1em} + #{$bootstrap-input-padding-y * 2} + #{$bootstrap-input-height-border}) !default; - -$bootstrap-input-disabled-color: $swal2-white !default; -$bootstrap-input-disabled-bg: $bootstrap-gray-200 !default; - -$bootstrap-input-focus-width: .2rem !default; -$bootstrap-input-focus-border: 1px solid lighten($bootstrap-primary, 25%) !default; -$bootstrap-input-focus-box-shadow: 0 0 0 $bootstrap-input-focus-width rgba($bootstrap-primary, .25) !default; - -// Button -$bootstrap-btn-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; -$bootstrap-btn-secondary-focus-box-shadow: 0 0 0 $bootstrap-input-focus-width rgba($bootstrap-secondary, .25) !default; - -// Custom Shared Variables -$bootstrap-custom-forms-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; - -$bootstrap-custom-control-gutter: .5rem !default; -$bootstrap-custom-control-indicator-size: 1rem !default; -$bootstrap-custom-control-indicator-bg: $swal2-white !default; -$bootstrap-custom-control-indicator-bg-size: 50% 50% !default; -$bootstrap-custom-control-indicator-border-color: $bootstrap-gray-500 !default; -$bootstrap-custom-control-indicator-border-width: $bootstrap-input-border-width !default; -$bootstrap-custom-control-indicator-checked-color: $swal2-white !default; -$bootstrap-custom-control-indicator-checked-bg: $bootstrap-primary !default; -$bootstrap-custom-control-indicator-checked-disabled-bg: rgba($bootstrap-primary, .5) !default; -$bootstrap-custom-control-indicator-checked-border-color: $bootstrap-custom-control-indicator-checked-bg !default; - -$bootstrap-custom-control-indicator-active-color: $swal2-white !default; -$bootstrap-custom-control-indicator-active-bg: lighten($bootstrap-primary, 35%) !default; -$bootstrap-custom-control-indicator-active-box-shadow: none !default; -$bootstrap-custom-control-indicator-active-border-color: $bootstrap-custom-control-indicator-active-bg !default; - -$bootstrap-custom-control-indicator-focus-box-shadow: $bootstrap-input-focus-box-shadow !default; -$bootstrap-custom-control-indicator-focus-border-color: lighten($bootstrap-primary, 25%) !default; - -// Custom Select -$bootstrap-custom-select-bg-size: 8px 10px !default; -$bootstrap-custom-select-indicator-color: $bootstrap-gray-800 !default; -$bootstrap-custom-select-indicator: str-replace(url('data:image/svg+xml,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"%3e%3cpath fill="#{$bootstrap-custom-select-indicator-color}" d="M2 0L0 2h4zm0 5L0 3h4z"/%3e%3c/svg%3e'), '#', '%23') !default; -$bootstrap-custom-select-background: $bootstrap-custom-select-indicator no-repeat right $bootstrap-input-padding-x center / $bootstrap-custom-select-bg-size !default; // Used so we can have multiple background elements (e.g., arrow and feedback icon) - -// Custom Radio -$bootstrap-custom-radio-indicator-border-radius: 50% !default; -$bootstrap-custom-radio-indicator-icon-checked: str-replace(url('data:image/svg+xml,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="-4 -4 8 8"%3e%3ccircle r="3" fill="#{$bootstrap-custom-control-indicator-checked-color}"/%3e%3c/svg%3e'), '#', '%23') !default; - -// Custom Checkbox -$bootstrap-custom-checkbox-indicator-icon-checked: str-replace(url('data:image/svg+xml,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8"%3e%3cpath fill="#{$bootstrap-custom-control-indicator-checked-color}" d="M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z"/%3e%3c/svg%3e'), '#', '%23') !default; - -// Custom Range -$bootstrap-custom-range-track-width: 100% !default; -$bootstrap-custom-range-track-height: .5rem !default; -$bootstrap-custom-range-track-cursor: pointer !default; -$bootstrap-custom-range-track-bg: $bootstrap-gray-300 !default; -$bootstrap-custom-range-track-border-radius: 1rem !default; -$bootstrap-custom-range-track-box-shadow: inset 0 .25rem .25rem rgba($swal2-black, .1) !default; - -$bootstrap-custom-range-thumb-width: 1rem !default; -$bootstrap-custom-range-thumb-height: $bootstrap-custom-range-thumb-width !default; -$bootstrap-custom-range-thumb-bg: $bootstrap-primary !default; -$bootstrap-custom-range-thumb-border: 0 !default; -$bootstrap-custom-range-thumb-border-radius: 1rem !default; -$bootstrap-custom-range-thumb-box-shadow: 0 .1rem .25rem rgba($swal2-black, .1) !default; -$bootstrap-custom-range-thumb-focus-box-shadow: 0 0 0 1px $swal2-white, $bootstrap-input-focus-box-shadow !default; -$bootstrap-custom-range-thumb-focus-box-shadow-width: $bootstrap-input-focus-width !default; // For focus box shadow issue in IE/Edge -$bootstrap-custom-range-thumb-active-bg: lighten($bootstrap-primary, 35%) !default; -$bootstrap-custom-range-thumb-disabled-bg: $bootstrap-gray-500 !default; - -// Toast -$bootstrap-toast-max-width: 350px !default; -$bootstrap-toast-padding-x: .75rem !default; -$bootstrap-toast-padding-y: .25rem !default; -$bootstrap-toast-font-size: .875rem !default; -$bootstrap-toast-background-color: rgba($swal2-white, .85) !default; -$bootstrap-toast-border-width: 1px !default; -$bootstrap-toast-border-color: rgba(0, 0, 0, .1) !default; -$bootstrap-toast-border-radius: .25rem !default; -$bootstrap-toast-box-shadow: 0 .25rem .75rem rgba($swal2-black, .1) !default; - -// override SASS variables here - -// BOX MODEL -$swal2-padding: 1rem; -$swal2-border-radius: .3rem; - -// ANIMATIONS -// animate.css/fading_entrances/fadeInDown.css -@keyframes fadeInDown { - from { - transform: translate3d(0, -100%, 0); - opacity: 0; - } - - to { - transform: translate3d(0, 0, 0); - opacity: 1; - } -} - -// animate.css/fading_exits/fadeOutUp.css -@keyframes fadeOutUp { - from { - opacity: 1; - } - - to { - transform: translate3d(0, -100%, 0); - opacity: 0; - } -} - -$swal2-show-animation: fadeInDown .5s; -$swal2-hide-animation: fadeOutUp .5s; - -// BACKDROP -$swal2-backdrop: rgba($swal2-black, .5); -$swal2-backdrop-transition: background-color .5s; - -// ICONS -$swal2-success: $bootstrap-success; -$swal2-error: $bootstrap-danger; -$swal2-warning: $bootstrap-warning; -$swal2-info: $bootstrap-info; -$swal2-question: $bootstrap-secondary; - -// INPUT -$swal2-input-border: $bootstrap-input-border-width solid $bootstrap-input-border-color; -$swal2-input-border-radius: $bootstrap-input-border-radius; -$swal2-input-border-focus: none; -$swal2-input-box-shadow-focus: none; -$swal2-input-font-size: 1rem; -$swal2-input-padding: $bootstrap-input-padding-y $bootstrap-input-padding-x; - -// CLOSE BUTTON -$swal2-close-button-width: 2em; -$swal2-close-button-height: 2em; -$swal2-close-button-line-height: 1; -$swal2-close-button-color: rgba($swal2-black, .5); -$swal2-close-button-font-size: 1.5rem; - -// CLOSE BUTTON:HOVER -$swal2-close-button-hover-color: $swal2-black; - -// CONFIRM BUTTON -$swal2-confirm-button-background-color: $bootstrap-primary; - -// CANCEL BUTTON -$swal2-cancel-button-background-color: $bootstrap-secondary; - -// COMMON VARIABLES FOR CONFIRM AND CANCEL BUTTONS -$swal2-button-focus-outline: none; - -// TOASTS -$swal2-toast-border: $bootstrap-toast-border-color solid $bootstrap-toast-border-width; -$swal2-toast-box-shadow: $bootstrap-toast-box-shadow; -$swal2-toast-padding: $bootstrap-toast-padding-x $bootstrap-toast-padding-y; -$swal2-toast-title-font-size: $bootstrap-toast-font-size; -$swal2-toast-content-font-size: $bootstrap-toast-font-size; -$swal2-toast-input-font-size: $bootstrap-toast-font-size; -$swal2-toast-validation-font-size: $bootstrap-toast-font-size; -$swal2-toast-buttons-font-size: $bootstrap-toast-font-size; - -@import '~sweetalert2/src/sweetalert2'; - -.swal2-confirm, -.swal2-cancel { - transition: $bootstrap-btn-transition; -} - -.swal2-popup { - border: $bootstrap-input-border-width solid rgba(0, 0, 0, .2); - - &.swal2-toast { - padding: .25rem .75rem; - font-size: .875rem; - - .swal2-header { - padding: 0; - border-bottom: 0; - } - - .swal2-title { - margin: 0; - color: $bootstrap-gray-600; - } - - .swal2-content { - padding: 0 .5rem; - } - - .swal2-actions { - flex-basis: 0 !important; - margin: 0; - padding: 0; - } - - .swal2-styled { - margin: 0; - } - } -} - -.swal2-title { - margin: 0; - font-size: 1.25rem; -} - -.swal2-content { - padding: 1rem 1rem 0; -} - -.swal2-actions { - border-radius: $bootstrap-input-border-radius; -} - -.swal2-footer { - padding: 1rem; - border-top: $bootstrap-input-border-width solid $bootstrap-input-border-color; -} - -.swal2-close { - height: auto; - padding: 1rem 1.2rem 1rem 1rem; - font-weight: 700; -} - -.swal2-input, -.swal2-textarea { - height: inherit; - padding: $swal2-input-padding; - transition: $bootstrap-custom-forms-transition; - line-height: $bootstrap-input-line-height; - - &:focus { - border: $bootstrap-input-focus-border; - outline: 0; - box-shadow: $bootstrap-input-focus-box-shadow; - color: $bootstrap-input-color; - } - - &.swal2-inputerror { - box-shadow: none !important; - - &:focus { - border-color: $bootstrap-danger; - box-shadow: 0 0 0 $bootstrap-input-focus-width rgba($bootstrap-danger, .25) !important; - } - } -} - -.swal2-styled { - &.swal2-confirm { - padding: $swal2-input-padding; - font-size: 1rem; - - &:hover { - border-color: darken($bootstrap-primary, 10%); - background-color: darken($bootstrap-primary, 7.5%); - } - - &:focus { - outline: 0; - box-shadow: $bootstrap-input-focus-box-shadow; - } - - &:active { - border-color: darken($bootstrap-primary, 12.5%); - background-color: darken($bootstrap-primary, 10%); - - &:focus { - box-shadow: $bootstrap-input-focus-box-shadow; - } - } - } - - &.swal2-cancel { - padding: $swal2-input-padding; - font-size: 1rem; - - &:hover { - border-color: darken($bootstrap-secondary, 10%); - background-color: darken($bootstrap-secondary, 7.5%); - } - - &:focus { - outline: 0; - box-shadow: $bootstrap-btn-secondary-focus-box-shadow; - } - - &:active { - border-color: darken($bootstrap-secondary, 12.5%); - background-color: darken($bootstrap-secondary, 10%); - - &:focus { - box-shadow: $bootstrap-btn-secondary-focus-box-shadow; - } - } - } -} - -.swal2-select { - display: inline-block; - width: 100%; - height: $bootstrap-input-height; - padding: .375rem 1.75rem .375rem .75rem; - transition: $bootstrap-custom-forms-transition; - border: $bootstrap-input-border-width solid $bootstrap-input-border-color; - border-radius: $bootstrap-input-border-radius; - background: $bootstrap-custom-select-background; - background-color: $bootstrap-input-bg; - color: $bootstrap-input-color; - vertical-align: middle; - // @include box-shadow($custom-select-box-shadow); - appearance: none; - - &:focus { - border: $bootstrap-input-focus-border; - outline: 0; - box-shadow: $bootstrap-input-focus-box-shadow; - - &::-ms-value { - background-color: $bootstrap-input-bg; - color: $bootstrap-input-color; - } - } - - &[multiple], - &[size]:not([size='1']) { - height: auto; - padding-right: $bootstrap-input-padding-x; - background-image: none; - } - - &:disabled { - background-color: $bootstrap-input-disabled-bg; - color: $bootstrap-input-disabled-color; - } - - &::-ms-expand { - display: none; - } -} - -.swal2-radio { - label { - position: relative; - margin-right: 1rem; - margin-left: 1.5rem; - - input { - position: absolute; - z-index: -1; - opacity: 0; - - &:checked ~ .swal2-label::before { - border-color: $bootstrap-custom-control-indicator-checked-border-color; - background: $bootstrap-custom-control-indicator-checked-bg; - color: $bootstrap-custom-control-indicator-checked-color; - } - - &:focus ~ .swal2-label::before { - box-shadow: $bootstrap-custom-control-indicator-focus-box-shadow; - } - - &:focus:not(:checked) ~ .swal2-label::before { - border-color: $bootstrap-custom-control-indicator-focus-border-color; - } - - &:not(:disabled):active ~ .swal2-label::before { - border-color: $bootstrap-custom-control-indicator-active-border-color; - background-color: $bootstrap-custom-control-indicator-active-bg; - color: $bootstrap-custom-control-indicator-active-color; - } - } - - input:checked ~ .swal2-label::after { - background-image: $bootstrap-custom-radio-indicator-icon-checked; - } - - input:disabled:checked ~ .swal2-label::before { - background-color: $bootstrap-custom-control-indicator-checked-disabled-bg; - } - } - - .swal2-label { - &::before { - content: ''; - display: block; - position: absolute; - top: ($swal2-input-font-size * $bootstrap-input-line-height - $bootstrap-custom-control-indicator-size) / 6; - left: -($bootstrap-custom-control-gutter + $bootstrap-custom-control-indicator-size); - width: $bootstrap-custom-control-indicator-size; - height: $bootstrap-custom-control-indicator-size; - transition: $bootstrap-custom-forms-transition; - border: $bootstrap-custom-control-indicator-border-color solid $bootstrap-custom-control-indicator-border-width; - border-radius: $bootstrap-custom-radio-indicator-border-radius; - background-color: $bootstrap-custom-control-indicator-bg; - pointer-events: none; - } - - &::after { - content: ''; - display: block; - position: absolute; - top: ($swal2-input-font-size * $bootstrap-input-line-height - $bootstrap-custom-control-indicator-size) / 6; - left: -($bootstrap-custom-control-gutter + $bootstrap-custom-control-indicator-size); - width: $bootstrap-custom-control-indicator-size; - height: $bootstrap-custom-control-indicator-size; - transition: $bootstrap-custom-forms-transition; - border: transparent solid $bootstrap-custom-control-indicator-border-width; - background: no-repeat 50% / #{$bootstrap-custom-control-indicator-bg-size}; - } - } -} - -.swal2-checkbox { - margin-right: 1rem; - padding-left: 1.5rem; - - input { - z-index: -1; - opacity: 0; - - &:checked ~ .swal2-label::before { - border-color: $bootstrap-custom-control-indicator-checked-border-color; - background: $bootstrap-custom-control-indicator-checked-bg; - color: $bootstrap-custom-control-indicator-checked-color; - } - - &:focus ~ .swal2-label::before { - box-shadow: $bootstrap-custom-control-indicator-focus-box-shadow; - } - - &:focus:not(:checked) ~ .swal2-label::before { - border-color: $bootstrap-custom-control-indicator-focus-border-color; - } - - &:not(:disabled):active ~ .swal2-label::before { - border-color: $bootstrap-custom-control-indicator-active-border-color; - background-color: $bootstrap-custom-control-indicator-active-bg; - color: $bootstrap-custom-control-indicator-active-color; - } - } - - input:checked ~ .swal2-label::after { - background-image: $bootstrap-custom-checkbox-indicator-icon-checked; - } - - input:disabled:checked ~ .swal2-label::before { - background-color: $bootstrap-custom-control-indicator-checked-disabled-bg; - } - - .swal2-label { - position: relative; - - &::before { - content: ''; - display: block; - position: absolute; - top: ($swal2-input-font-size * $bootstrap-input-line-height - $bootstrap-custom-control-indicator-size) / 2; - left: -($bootstrap-custom-control-gutter + $bootstrap-custom-control-indicator-size); - width: $bootstrap-custom-control-indicator-size; - height: $bootstrap-custom-control-indicator-size; - transition: $bootstrap-custom-forms-transition; - border: $bootstrap-custom-control-indicator-border-color solid $bootstrap-custom-control-indicator-border-width; - background-color: $bootstrap-custom-control-indicator-bg; - pointer-events: none; - } - - &::after { - content: ''; - display: block; - position: absolute; - top: ($swal2-input-font-size * $bootstrap-input-line-height - $bootstrap-custom-control-indicator-size) / 2; - left: -($bootstrap-custom-control-gutter + $bootstrap-custom-control-indicator-size); - width: $bootstrap-custom-control-indicator-size; - height: $bootstrap-custom-control-indicator-size; - transition: $bootstrap-custom-forms-transition; - border: transparent solid $bootstrap-custom-control-indicator-border-width; - background: no-repeat 50% / #{$bootstrap-custom-control-indicator-bg-size}; - } - } -} - -.swal2-range { - align-items: center; - - input { - width: 100%; - height: calc(#{$bootstrap-custom-range-thumb-height} + #{$bootstrap-custom-range-thumb-focus-box-shadow-width * 3}); - padding: 0; - background-color: transparent; - appearance: none; - - &:focus { - outline: none; - - &::-webkit-slider-thumb { - box-shadow: $bootstrap-custom-range-thumb-focus-box-shadow; - } - - &::-moz-range-thumb { - box-shadow: $bootstrap-custom-range-thumb-focus-box-shadow; - } - - &::-ms-thumb { - box-shadow: $bootstrap-custom-range-thumb-focus-box-shadow; - } - } - - &::-moz-focus-outer { - border: 0; - } - - &::-webkit-slider-thumb { - width: $bootstrap-custom-range-thumb-width; - height: $bootstrap-custom-range-thumb-height; - margin-top: ($bootstrap-custom-range-track-height - $bootstrap-custom-range-thumb-height) / 2; - transition: $bootstrap-custom-forms-transition; - border: $bootstrap-custom-range-thumb-border; - border-radius: $bootstrap-custom-range-thumb-border-radius; - background: $bootstrap-custom-range-thumb-bg; - box-shadow: $bootstrap-custom-range-thumb-box-shadow; - appearance: none; - - &:active { - background: $bootstrap-custom-range-thumb-active-bg; - } - } - - &::-webkit-slider-runnable-track { - width: $bootstrap-custom-range-track-width; - height: $bootstrap-custom-range-track-height; - border-radius: $bootstrap-custom-range-track-border-radius; - border-color: transparent; - background-color: $bootstrap-custom-range-track-bg; - box-shadow: $bootstrap-custom-range-track-box-shadow; - color: transparent; - cursor: $bootstrap-custom-range-track-cursor; - } - - &::-moz-range-thumb { - width: $bootstrap-custom-range-thumb-width; - height: $bootstrap-custom-range-thumb-height; - margin-top: 1rem; - transition: $bootstrap-custom-forms-transition; - border: $bootstrap-custom-range-thumb-border; - border-radius: $bootstrap-custom-range-thumb-border-radius; - background: $bootstrap-custom-range-thumb-bg; - box-shadow: $bootstrap-custom-range-thumb-box-shadow; - appearance: none; - - &:active { - background: $bootstrap-custom-range-thumb-active-bg; - } - } - - &::-moz-range-track { - width: $bootstrap-custom-range-track-width; - height: $bootstrap-custom-range-track-height; - border-radius: $bootstrap-custom-range-track-border-radius; - border-color: transparent; - background-color: $bootstrap-custom-range-track-bg; - box-shadow: $bootstrap-custom-range-track-box-shadow; - color: transparent; - cursor: $bootstrap-custom-range-track-cursor; - } - - &::-ms-thumb { - width: $bootstrap-custom-range-thumb-width; - height: $bootstrap-custom-range-thumb-height; - margin-top: 0; - margin-right: $bootstrap-custom-range-thumb-focus-box-shadow-width; - margin-left: $bootstrap-custom-range-thumb-focus-box-shadow-width; - transition: $bootstrap-custom-forms-transition; - border: $bootstrap-custom-range-thumb-border; - border-radius: $bootstrap-custom-range-thumb-border-radius; - background: $bootstrap-custom-range-thumb-bg; - box-shadow: $bootstrap-custom-range-thumb-box-shadow; - appearance: none; - - &:active { - background: $bootstrap-custom-range-thumb-active-bg; - } - } - - &::-ms-track { - width: $bootstrap-custom-range-track-width; - height: $bootstrap-custom-range-track-height; - border-width: $bootstrap-custom-range-thumb-height / 2; - border-color: transparent; - background-color: transparent; - box-shadow: $bootstrap-custom-range-track-box-shadow; - color: transparent; - cursor: $bootstrap-custom-range-track-cursor; - } - - &::-ms-fill-lower { - border-radius: $bootstrap-custom-range-track-border-radius; - background-color: $bootstrap-custom-range-track-bg; - } - - &::-ms-fill-upper { - margin-right: 15px; - border-radius: $bootstrap-custom-range-track-border-radius; - background-color: $bootstrap-custom-range-track-bg; - } - - &:disabled { - &::-webkit-slider-thumb { - background-color: $bootstrap-custom-range-thumb-disabled-bg; - } - - &::-webkit-slider-runnable-track { - cursor: default; - } - - &::-moz-range-thumb { - background-color: $bootstrap-custom-range-thumb-disabled-bg; - } - - &::-moz-range-track { - cursor: default; - } - - &::-ms-thumb { - background-color: $bootstrap-custom-range-thumb-disabled-bg; - } - } - } -} - -.swal2-validation-message { - position: relative; - margin-bottom: $bootstrap-alert-margin-bottom; - padding: $bootstrap-alert-padding-y $bootstrap-alert-padding-x; - border: $bootstrap-alert-border-width solid transparent; - border-radius: $bootstrap-alert-border-radius; - border-color: $bootstrap-alert-border-color; - background: $bootstrap-alert-background; - color: $bootstrap-alert-color; - font-size: $bootstrap-alert-font-size; - - &::before { - background-color: lighten($bootstrap-danger, 10%); - } -} - -.swal2-toast { - max-width: $bootstrap-toast-max-width; - border-radius: $bootstrap-toast-border-radius; - background-color: $bootstrap-toast-background-color; -} - -//