-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.global.min.js
6 lines (6 loc) · 17.6 KB
/
main.global.min.js
1
2
3
4
5
6
/*!
FullCalendar Scheduler v5.2.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2020 Adam Shaw
*/
var FullCalendarScrollGrid=function(e,t,r){"use strict";r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function l(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){return(n=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var l in t=arguments[r])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};function i(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var o=Array(e),l=0;for(t=0;t<r;t++)for(var n=arguments[t],i=0,s=n.length;i<s;i++,l++)o[l]=n[i];return o}var s,c="wheel mousewheel DomMouseScroll MozMousePixelScroll".split(" "),a=function(){function e(e){var r=this;this.el=e,this.emitter=new t.Emitter,this.isScrolling=!1,this.isTouching=!1,this.isRecentlyWheeled=!1,this.isRecentlyScrolled=!1,this.wheelWaiter=new t.DelayedRunner(this._handleWheelWaited.bind(this)),this.scrollWaiter=new t.DelayedRunner(this._handleScrollWaited.bind(this)),this.handleScroll=function(){r.startScroll(),r.emitter.trigger("scroll",r.isRecentlyWheeled,r.isTouching),r.isRecentlyScrolled=!0,r.scrollWaiter.request(500)},this.handleWheel=function(){r.isRecentlyWheeled=!0,r.wheelWaiter.request(500)},this.handleTouchStart=function(){r.isTouching=!0},this.handleTouchEnd=function(){r.isTouching=!1,r.isRecentlyScrolled||r.endScroll()},e.addEventListener("scroll",this.handleScroll),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.addEventListener("touchend",this.handleTouchEnd);for(var o=0,l=c;o<l.length;o++){var n=l[o];e.addEventListener(n,this.handleWheel)}}return e.prototype.destroy=function(){var e=this.el;e.removeEventListener("scroll",this.handleScroll),e.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.removeEventListener("touchend",this.handleTouchEnd);for(var t=0,r=c;t<r.length;t++){var o=r[t];e.removeEventListener(o,this.handleWheel)}},e.prototype.startScroll=function(){this.isScrolling||(this.isScrolling=!0,this.emitter.trigger("scrollStart",this.isRecentlyWheeled,this.isTouching))},e.prototype.endScroll=function(){this.isScrolling&&(this.emitter.trigger("scrollEnd"),this.isScrolling=!1,this.isRecentlyScrolled=!0,this.isRecentlyWheeled=!1,this.scrollWaiter.clear(),this.wheelWaiter.clear())},e.prototype._handleScrollWaited=function(){this.isRecentlyScrolled=!1,this.isTouching||this.endScroll()},e.prototype._handleWheelWaited=function(){this.isRecentlyWheeled=!1},e}();function h(e){var t=e.scrollLeft;if("rtl"===window.getComputedStyle(e).direction)switch(d()){case"negative":t=e.scrollWidth-e.clientWidth+t;break;case"reverse":t=e.scrollWidth-e.clientWidth-t}return t}function u(e,t){if("rtl"===window.getComputedStyle(e).direction)switch(d()){case"positive":t=e.scrollWidth-e.clientWidth+t;break;case"reverse":t=-t}e.scrollLeft=t}function d(){return s||(s=function(){var e,r=document.createElement("div");r.style.position="absolute",r.style.top="-1000px",r.style.width="1px",r.style.height="1px",r.style.overflow="scroll",r.style.direction="rtl",r.style.fontSize="100px",r.innerHTML="A",document.body.appendChild(r),r.scrollLeft>0?e="positive":(r.scrollLeft=1,e=r.scrollLeft>0?"reverse":"negative");return t.removeElement(r),e}())}var p=/Edge/.test(navigator.userAgent),f=function(){function e(e,r){var o=this;this.scrollEl=e,this.isRtl=r,this.usingRelative=null,this.updateSize=function(){var e=o.scrollEl,r=t.findElements(e,".fc-sticky"),l=o.queryElGeoms(r),n=e.clientWidth,i=e.clientHeight;o.usingRelative?function(e,r,o,l,n){e.forEach((function(e,i){var s,c,a=r[i],h=a.naturalBound,u=a.parentBound,d=u.right-u.left,p=u.bottom-u.bottom;d>l||p>n?(s=o[i].left-h.left,c=o[i].top-h.top):(s="",c=""),t.applyStyle(e,{position:"relative",left:s,right:-s,top:c})}))}(r,l,o.computeElDestinations(l,n),n,i):function(e,r,o){e.forEach((function(e,l){var n,i=r[l],s=i.textAlign,c=i.elWidth,a=i.parentBound,h=a.right-a.left;n="center"===s&&h>o?(o-c)/2:"",t.applyStyle(e,{left:n,right:n,top:0})}))}(r,l,n)},this.usingRelative=!function(){var e=document.createElement("div");e.className="fc-sticky",document.body.appendChild(e);var r=window.getComputedStyle(e).position;return t.removeElement(e),-1!==r.indexOf("sticky")?r:null}()||p&&r,this.usingRelative&&(this.listener=new a(e),this.listener.emitter.on("scrollEnd",this.updateSize))}return e.prototype.destroy=function(){this.listener&&this.listener.destroy()},e.prototype.queryElGeoms=function(e){for(var r=this.scrollEl,o=this.isRtl,l=function(e){var r=e.getBoundingClientRect(),o=t.computeEdges(e);return{left:r.left+o.borderLeft+o.scrollbarLeft-h(e),top:r.top+o.borderTop-e.scrollTop}}(r),n=[],i=0,s=e;i<s.length;i++){var c=s[i],a=t.translateRect(t.computeInnerRect(c.parentNode,!0,!0),-l.left,-l.top),u=c.getBoundingClientRect(),d=window.getComputedStyle(c),p=window.getComputedStyle(c.parentNode).textAlign,f=null;"start"===p?p=o?"right":"left":"end"===p&&(p=o?"left":"right"),"sticky"!==d.position&&(f=t.translateRect(u,-l.left-(parseFloat(d.left)||0),-l.top-(parseFloat(d.top)||0))),n.push({parentBound:a,naturalBound:f,elWidth:u.width,elHeight:u.height,textAlign:p})}return n},e.prototype.computeElDestinations=function(e,t){var r=this.scrollEl,o=r.scrollTop,l=h(r),n=l+t;return e.map((function(e){var t,r,i=e.elWidth,s=e.elHeight,c=e.parentBound,a=e.naturalBound;switch(e.textAlign){case"left":t=l;break;case"right":t=n-i;break;case"center":t=(l+n)/2-i/2}return t=Math.min(t,c.right-i),t=Math.max(t,c.left),r=o,r=Math.min(r,c.bottom-s),{left:t,top:r=Math.max(r,a.top)}}))},e}();var g=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.elRef=t.createRef(),r.state={xScrollbarWidth:t.getScrollbarWidths().x,yScrollbarWidth:t.getScrollbarWidths().y},r.handleScroller=function(e){r.scroller=e,t.setRef(r.props.scrollerRef,e)},r.handleSizing=function(){var e=r.props;"scroll-hidden"===e.overflowY&&r.setState({yScrollbarWidth:r.scroller.getYScrollbarWidth()}),"scroll-hidden"===e.overflowX&&r.setState({xScrollbarWidth:r.scroller.getXScrollbarWidth()})},r}return l(r,e),r.prototype.render=function(){var e=this.props,r=this.state,o=this.context.isRtl&&t.getIsRtlScrollbarOnLeft(),l=0,n=0,i=0;return"scroll-hidden"===e.overflowX&&(i=r.xScrollbarWidth),"scroll-hidden"===e.overflowY&&null!=r.yScrollbarWidth&&(o?l=r.yScrollbarWidth:n=r.yScrollbarWidth),t.createElement("div",{ref:this.elRef,className:"fc-scroller-harness"+(e.liquid?" fc-scroller-harness-liquid":"")},t.createElement(t.Scroller,{ref:this.handleScroller,elRef:this.props.scrollerElRef,overflowX:"scroll-hidden"===e.overflowX?"scroll":e.overflowX,overflowY:"scroll-hidden"===e.overflowY?"scroll":e.overflowY,overcomeLeft:l,overcomeRight:n,overcomeBottom:i,maxHeight:"number"==typeof e.maxHeight?e.maxHeight+("scroll-hidden"===e.overflowX?r.xScrollbarWidth:0):"",liquid:e.liquid,liquidIsAbsolute:!0},e.children))},r.prototype.componentDidMount=function(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)},r.prototype.componentDidUpdate=function(e){t.isPropsEqual(e,this.props)||this.handleSizing()},r.prototype.componentWillUnmount=function(){this.context.removeResizeHandler(this.handleSizing)},r.prototype.needsXScrolling=function(){return this.scroller.needsXScrolling()},r.prototype.needsYScrolling=function(){return this.scroller.needsYScrolling()},r}(t.BaseComponent),y=function(){function e(e,t){var r=this;this.isVertical=e,this.scrollEls=t,this.isPaused=!1,this.scrollListeners=t.map((function(e){return r.bindScroller(e)}))}return e.prototype.destroy=function(){for(var e=0,t=this.scrollListeners;e<t.length;e++){t[e].destroy()}},e.prototype.bindScroller=function(e){var t=this,r=this.scrollEls,o=this.isVertical,l=new a(e);return l.emitter.on("scroll",(function(l,n){if(!t.isPaused&&((!t.masterEl||t.masterEl!==e&&(l||n))&&t.assignMaster(e),t.masterEl===e))for(var i=0,s=r;i<s.length;i++){var c=s[i];c!==e&&(o?c.scrollTop=e.scrollTop:c.scrollLeft=e.scrollLeft)}})),l.emitter.on("scrollEnd",(function(){t.masterEl===e&&(t.masterEl=null)})),l},e.prototype.assignMaster=function(e){this.masterEl=e;for(var t=0,r=this.scrollListeners;t<r.length;t++){var o=r[t];o.el!==e&&o.endScroll()}},e.prototype.forceScrollLeft=function(e){this.isPaused=!0;for(var t=0,r=this.scrollListeners;t<r.length;t++){u(r[t].el,e)}this.isPaused=!1},e.prototype.forceScrollTop=function(e){this.isPaused=!0;for(var t=0,r=this.scrollListeners;t<r.length;t++){r[t].el.scrollTop=e}this.isPaused=!1},e}(),S=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.compileColGroupStats=t.memoizeArraylike(R,b),r.renderMicroColGroups=t.memoizeArraylike(t.renderMicroColGroup),r.clippedScrollerRefs=new t.RefMap,r.scrollerElRefs=new t.RefMap(r._handleScrollerEl.bind(r)),r.chunkElRefs=new t.RefMap(r._handleChunkEl.bind(r)),r.getStickyScrolling=t.memoizeArraylike(M,null,x),r.getScrollSyncersBySection=t.memoizeHashlike(W.bind(r,!0),null,k),r.getScrollSyncersByColumn=t.memoizeHashlike(W.bind(r,!1),null,k),r.stickyScrollings=[],r.scrollSyncersBySection={},r.scrollSyncersByColumn={},r.rowUnstableMap=new Map,r.rowInnerMaxHeightMap=new Map,r.anyRowHeightsChanged=!1,r.state={shrinkWidths:[],forceYScrollbars:!1,forceXScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{},sectionRowMaxHeights:[]},r.handleSizing=function(e){e||(r.anyRowHeightsChanged=!0);var t={};e||r.rowUnstableMap.size||(t.sectionRowMaxHeights=r.computeSectionRowMaxHeights()),r.setState(n(n({shrinkWidths:r.computeShrinkWidths()},r.computeScrollerDims()),t),(function(){r.rowUnstableMap.size||r.updateStickyScrolling()}))},r.handleRowHeightChange=function(e,t){var o=r,l=o.rowUnstableMap,n=o.rowInnerMaxHeightMap;if(t){l.delete(e);var i=v(e);n.has(e)&&n.get(e)===i||(n.set(e,i),r.anyRowHeightsChanged=!0),!l.size&&r.anyRowHeightsChanged&&(r.anyRowHeightsChanged=!1,r.setState({sectionRowMaxHeights:r.computeSectionRowMaxHeights()}))}else l.set(e,!0)},r}return l(r,e),r.prototype.render=function(){for(var e,r=this.props,o=this.state,l=this.context,n=o.shrinkWidths,s=this.compileColGroupStats(r.colGroups.map((function(e){return[e]}))),c=this.renderMicroColGroups(s.map((function(e,t){return[e.cols,n[t]]}))),a=t.getScrollGridClassNames(r.liquid,l),h=this.getDims(),u=(h[0],h[1],r.sections),d=u.length,p=0,f=[],g=[],y=[];p<d&&"header"===(e=u[p]).type;)f.push(this.renderSection(e,p,s,c,o.sectionRowMaxHeights)),p++;for(;p<d&&"body"===(e=u[p]).type;)g.push(this.renderSection(e,p,s,c,o.sectionRowMaxHeights)),p++;for(;p<d&&"footer"===(e=u[p]).type;)y.push(this.renderSection(e,p,s,c,o.sectionRowMaxHeights)),p++;var S=!t.getCanVGrowWithinCell();return t.createElement("table",{ref:r.elRef,className:a.join(" ")},function(e,r){var o=e.map((function(e,o){var l=e.width;return"shrink"===l&&(l=e.totalColWidth+t.sanitizeShrinkWidth(r[o])+1),t.createElement("col",{style:{width:l}})}));return t.createElement.apply(void 0,i(["colgroup",{}],o))}(s,n),Boolean(!S&&f.length)&&t.createElement.apply(void 0,i(["thead",{}],f)),Boolean(!S&&g.length)&&t.createElement.apply(void 0,i(["tbody",{}],g)),Boolean(!S&&y.length)&&t.createElement.apply(void 0,i(["tfoot",{}],y)),S&&t.createElement.apply(void 0,i(["tbody",{}],f,g,y)))},r.prototype.renderSection=function(e,r,o,l,n){var i=this;return"outerContent"in e?t.createElement(t.Fragment,{key:e.key},e.outerContent):t.createElement("tr",{key:e.key,className:t.getSectionClassNames(e,this.props.liquid).join(" ")},e.chunks.map((function(t,s){return i.renderChunk(e,r,o[s],l[s],t,s,(n[r]||[])[s]||[])})))},r.prototype.renderChunk=function(e,r,o,l,n,i,s){if("outerContent"in n)return t.createElement(t.Fragment,{key:n.key},n.outerContent);var c=this.state,a=c.scrollerClientWidths,h=c.scrollerClientHeights,u=this.getDims(),d=u[0],p=u[1],f=r*p+i,y=i===(!this.context.isRtl||t.getIsRtlScrollbarOnLeft()?p-1:0),S=r===d-1,m=S&&c.forceXScrollbars,v=y&&c.forceYScrollbars,w=o&&o.allowXScrolling,R=t.getAllowYScrolling(this.props,e),E=t.getSectionHasLiquidHeight(this.props,e),C=e.expandRows&&E,b=o&&o.totalColMinWidth||"",W=t.renderChunkContent(e,n,{tableColGroupNode:l,tableMinWidth:b,clientWidth:void 0!==a[f]?a[f]:null,clientHeight:void 0!==h[f]?h[f]:null,expandRows:C,syncRowHeights:Boolean(e.syncRowHeights),rowSyncHeights:s,reportRowHeightChange:this.handleRowHeightChange}),k=m?S?"scroll":"scroll-hidden":w?S?"auto":"scroll-hidden":"hidden",M=v?y?"scroll":"scroll-hidden":R?y?"auto":"scroll-hidden":"hidden";return W=t.createElement(g,{ref:this.clippedScrollerRefs.createRef(f),scrollerElRef:this.scrollerElRefs.createRef(f),overflowX:k,overflowY:M,liquid:E,maxHeight:e.maxHeight},W),t.createElement("td",{key:n.key,ref:this.chunkElRefs.createRef(f)},W)},r.prototype.componentDidMount=function(){this.updateScrollSyncers(),this.handleSizing(),this.context.addResizeHandler(this.handleSizing)},r.prototype.componentDidUpdate=function(e,t){this.updateScrollSyncers(),this.handleSizing(t.sectionRowMaxHeights!==this.state.sectionRowMaxHeights)},r.prototype.componentWillUnmount=function(){this.context.removeResizeHandler(this.handleSizing),this.destroyStickyScrolling(),this.destroyScrollSyncers()},r.prototype.computeShrinkWidths=function(){var e=this,r=this.compileColGroupStats(this.props.colGroups.map((function(e){return[e]}))),o=this.getDims(),l=o[0],n=o[1],i=l*n,s=[];return r.forEach((function(r,o){if(r.hasShrinkCol){var l=e.chunkElRefs.collect(o,i,n);s[o]=t.computeShrinkWidth(l)}})),s},r.prototype.computeSectionRowMaxHeights=function(){for(var e=this.rowInnerMaxHeightMap,r=new Map,o=this.getDims(),l=o[0],n=o[1],i=[],s=0;s<l;s++){var c=this.props.sections[s],a=[];if(c&&c.syncRowHeights){for(var h=[],u=0;u<n;u++){var d=s*n+u,p=[],f=this.chunkElRefs.currentMap[d];p=f?t.findElements(f,".fc-scrollgrid-sync-table tr").map((function(t){var o=e.get(t);return null==o&&(o=v(t)),r.set(t,o),o})):[],h.push(p)}var g=h[0].length,y=!0;for(u=1;u<n;u++){if(!(c.chunks[u]&&void 0!==c.chunks[u].outerContent)&&h[u].length!==g){y=!1;break}}if(y){for(u=0;u<n;u++)a.push([]);for(b=0;b<g;b++){var S=[];for(u=0;u<n;u++){var w=h[u][b];null!=w&&S.push(w)}var R=Math.max.apply(Math,S);for(u=0;u<n;u++)a[u].push(R)}}else{for(var E=[],u=0;u<n;u++)E.push(m(h[u])+h[u].length);for(var C=Math.max.apply(Math,E),u=0;u<n;u++){var b,W=h[u].length,k=C-W,M=Math.floor(k/W),x=k-M*(W-1),H=[];for((b=0)<W&&(H.push(x),b++);b<W;)H.push(M),b++;a.push(H)}}}i.push(a)}return this.rowInnerMaxHeightMap=r,i},r.prototype.computeScrollerDims=function(){for(var e=t.getScrollbarWidths(),r=this.getDims(),o=r[0],l=r[1],n=!this.context.isRtl||t.getIsRtlScrollbarOnLeft()?l-1:0,i=o-1,s=this.clippedScrollerRefs.currentMap,c=this.scrollerElRefs.currentMap,a=!1,h=!1,u={},d={},p=0;p<o;p++){if((g=s[y=p*l+n])&&g.needsYScrolling()){a=!0;break}}for(var f=0;f<l;f++){var g;if((g=s[y=i*l+f])&&g.needsXScrolling()){h=!0;break}}for(p=0;p<o;p++)for(f=0;f<l;f++){var y,S=c[y=p*l+f];if(S){var m=S.parentNode;u[y]=Math.floor(m.getBoundingClientRect().width-(f===n&&a?e.y:0)),d[y]=Math.floor(m.getBoundingClientRect().height-(p===i&&h?e.x:0))}}return{forceYScrollbars:a,forceXScrollbars:h,scrollerClientWidths:u,scrollerClientHeights:d}},r.prototype.updateStickyScrolling=function(){var e=this.context.isRtl,t=this.scrollerElRefs.getAll().map((function(t){return[t,e]})),r=this.getStickyScrolling(t);for(var o in r)r[o].updateSize();this.stickyScrollings=r},r.prototype.destroyStickyScrolling=function(){this.stickyScrollings.forEach(x)},r.prototype.updateScrollSyncers=function(){for(var e=this.getDims(),r=e[0],o=e[1],l=r*o,n={},i={},s=this.scrollerElRefs.currentMap,c=0;c<r;c++){var a=c*o,h=a+o;n[c]=t.collectFromHash(s,a,h,1)}for(var u=0;u<o;u++)i[u]=this.scrollerElRefs.collect(u,l,o);this.scrollSyncersBySection=this.getScrollSyncersBySection(n),this.scrollSyncersByColumn=this.getScrollSyncersByColumn(i)},r.prototype.destroyScrollSyncers=function(){t.mapHash(this.scrollSyncersBySection,k),t.mapHash(this.scrollSyncersByColumn,k)},r.prototype.getChunkConfigByIndex=function(e){var t=this.getDims()[1],r=Math.floor(e/t),o=e%t,l=this.props.sections[r];return l&&l.chunks[o]},r.prototype.forceScrollLeft=function(e,t){var r=this.scrollSyncersByColumn[e];r&&r.forceScrollLeft(t)},r.prototype.forceScrollTop=function(e,t){var r=this.scrollSyncersBySection[e];r&&r.forceScrollTop(t)},r.prototype._handleChunkEl=function(e,r){var o=this.getChunkConfigByIndex(parseInt(r,10));o&&t.setRef(o.elRef,e)},r.prototype._handleScrollerEl=function(e,r){var o=this.getChunkConfigByIndex(parseInt(r,10));o&&t.setRef(o.scrollerElRef,e)},r.prototype.getDims=function(){var e=this.props.sections.length;return[e,e?this.props.sections[0].chunks.length:0]},r}(t.BaseComponent);function m(e){for(var t=0,r=0,o=e;r<o.length;r++){t+=o[r]}return t}function v(e){var r=t.findElements(e,".fc-scrollgrid-sync-inner").map(w);return r.length?Math.max.apply(Math,r):0}function w(e){return e.offsetHeight}function R(e){var r=E(e.cols,"width"),o=E(e.cols,"minWidth"),l=t.hasShrinkWidth(e.cols);return{hasShrinkCol:l,totalColWidth:r,totalColMinWidth:o,allowXScrolling:"shrink"!==e.width&&Boolean(r||o||l),cols:e.cols,width:e.width}}function E(e,t){for(var r=0,o=0,l=e;o<l.length;o++){var n=l[o],i=n[t];"number"==typeof i&&(r+=i*(n.span||1))}return r}S.addStateEquality({shrinkWidths:t.isArraysEqual,scrollerClientWidths:t.isPropsEqual,scrollerClientHeights:t.isPropsEqual});var C={cols:t.isColPropsEqual};function b(e,r){return t.compareObjs(e,r,C)}function W(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new y(e,t)}function k(e){e.destroy()}function M(e,t){return new f(e,t)}function x(e){e.destroy()}var H=t.createPlugin({deps:[r],scrollGridImpl:S});return t.globalPlugins.push(H),e.ScrollGrid=S,e.default=H,e.setScrollFromStartingEdge=u,e}({},FullCalendar,FullCalendarPremiumCommon);