New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fullcalendar/scrollgrid

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fullcalendar/scrollgrid - npm Package Compare versions

Comparing version 6.0.2 to 6.0.3

index.esm.js

4

index.global.js
/*!
FullCalendar ScrollGrid Plugin v6.0.2
FullCalendar ScrollGrid Plugin v6.0.3
Docs & License: https://fullcalendar.io/docs/premium

@@ -841,3 +841,3 @@ (c) 2022 Adam Shaw

name: '@fullcalendar/scrollgrid',
premiumReleaseDate: '2022-12-27',
premiumReleaseDate: '2023-01-11',
deps: [premiumCommonPlugin__default["default"]],

@@ -844,0 +844,0 @@ scrollGridImpl: ScrollGrid,

/*!
FullCalendar ScrollGrid Plugin v6.0.2
FullCalendar ScrollGrid Plugin v6.0.3
Docs & License: https://fullcalendar.io/docs/premium
(c) 2022 Adam Shaw
*/
FullCalendar.ScrollGrid=function(e,t,l,s,i){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=r(l);function n(e){let t=e.scrollLeft;if("rtl"===window.getComputedStyle(e).direction)switch(a()){case"negative":t*=-1;case"reverse":t=e.scrollWidth-t-e.clientWidth}return t}function h(e,t){if("rtl"===window.getComputedStyle(e).direction)switch(a()){case"reverse":t=e.scrollWidth-t;break;case"negative":t=-(e.scrollWidth-t)}e.scrollLeft=t}let c;function a(){return c||(c=function(){let e,t=document.createElement("div");t.style.position="absolute",t.style.top="-1000px",t.style.width="1px",t.style.height="1px",t.style.overflow="scroll",t.style.direction="rtl",t.style.fontSize="100px",t.innerHTML="A",document.body.appendChild(t),t.scrollLeft>0?e="positive":(t.scrollLeft=1,e=t.scrollLeft>0?"reverse":"negative");return s.removeElement(t),e}())}class d{constructor(e,t){this.scrollEl=e,this.isRtl=t,this.updateSize=()=>{let{scrollEl:e}=this,t=s.findElements(e,".fc-sticky");!function(e,t,l){e.forEach((e,i)=>{let r,{textAlign:o,elWidth:n,parentBound:h}=t[i],c=h.right-h.left;r="center"===o&&c>l?(l-n)/2:"",s.applyStyle(e,{left:r,right:r,top:0})})}(t,this.queryElGeoms(t),e.clientWidth)}}queryElGeoms(e){let{scrollEl:t,isRtl:l}=this,i=function(e){let t=e.getBoundingClientRect(),l=s.computeEdges(e);return{left:t.left+l.borderLeft+l.scrollbarLeft-n(e),top:t.top+l.borderTop-e.scrollTop}}(t),r=[];for(let t of e){let e=s.translateRect(s.computeInnerRect(t.parentNode,!0,!0),-i.left,-i.top),o=t.getBoundingClientRect(),n=window.getComputedStyle(t),h=window.getComputedStyle(t.parentNode).textAlign,c=null;"start"===h?h=l?"right":"left":"end"===h&&(h=l?"left":"right"),"sticky"!==n.position&&(c=s.translateRect(o,-i.left-(parseFloat(n.left)||0),-i.top-(parseFloat(n.top)||0))),r.push({parentBound:e,naturalBound:c,elWidth:o.width,elHeight:o.height,textAlign:h})}return r}}class u extends s.BaseComponent{constructor(){super(...arguments),this.elRef=i.createRef(),this.state={xScrollbarWidth:0,yScrollbarWidth:0},this.handleScroller=e=>{this.scroller=e,s.setRef(this.props.scrollerRef,e)},this.handleSizing=()=>{let{props:e}=this;"scroll-hidden"===e.overflowY&&this.setState({yScrollbarWidth:this.scroller.getYScrollbarWidth()}),"scroll-hidden"===e.overflowX&&this.setState({xScrollbarWidth:this.scroller.getXScrollbarWidth()})}}render(){let{props:e,state:t,context:l}=this,r=l.isRtl&&s.getIsRtlScrollbarOnLeft(),o=0,n=0,h=0;return"scroll-hidden"===e.overflowX&&(h=t.xScrollbarWidth),"scroll-hidden"===e.overflowY&&null!=t.yScrollbarWidth&&(r?o=t.yScrollbarWidth:n=t.yScrollbarWidth),i.createElement("div",{ref:this.elRef,className:"fc-scroller-harness"+(e.liquid?" fc-scroller-harness-liquid":"")},i.createElement(s.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:o,overcomeRight:n,overcomeBottom:h,maxHeight:"number"==typeof e.maxHeight?e.maxHeight+("scroll-hidden"===e.overflowX?t.xScrollbarWidth:0):"",liquid:e.liquid,liquidIsAbsolute:!0},e.children))}componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(e){s.isPropsEqual(e,this.props)||this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}needsXScrolling(){return this.scroller.needsXScrolling()}needsYScrolling(){return this.scroller.needsYScrolling()}}const f="wheel mousewheel DomMouseScroll MozMousePixelScroll".split(" ");class g{constructor(e){this.el=e,this.emitter=new s.Emitter,this.isScrolling=!1,this.isTouching=!1,this.isRecentlyWheeled=!1,this.isRecentlyScrolled=!1,this.wheelWaiter=new s.DelayedRunner(this._handleWheelWaited.bind(this)),this.scrollWaiter=new s.DelayedRunner(this._handleScrollWaited.bind(this)),this.handleScroll=()=>{this.startScroll(),this.emitter.trigger("scroll",this.isRecentlyWheeled,this.isTouching),this.isRecentlyScrolled=!0,this.scrollWaiter.request(500)},this.handleWheel=()=>{this.isRecentlyWheeled=!0,this.wheelWaiter.request(500)},this.handleTouchStart=()=>{this.isTouching=!0},this.handleTouchEnd=()=>{this.isTouching=!1,this.isRecentlyScrolled||this.endScroll()},e.addEventListener("scroll",this.handleScroll),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.addEventListener("touchend",this.handleTouchEnd);for(let t of f)e.addEventListener(t,this.handleWheel)}destroy(){let{el:e}=this;e.removeEventListener("scroll",this.handleScroll),e.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.removeEventListener("touchend",this.handleTouchEnd);for(let t of f)e.removeEventListener(t,this.handleWheel)}startScroll(){this.isScrolling||(this.isScrolling=!0,this.emitter.trigger("scrollStart",this.isRecentlyWheeled,this.isTouching))}endScroll(){this.isScrolling&&(this.emitter.trigger("scrollEnd"),this.isScrolling=!1,this.isRecentlyScrolled=!0,this.isRecentlyWheeled=!1,this.scrollWaiter.clear(),this.wheelWaiter.clear())}_handleScrollWaited(){this.isRecentlyScrolled=!1,this.isTouching||this.endScroll()}_handleWheelWaited(){this.isRecentlyWheeled=!1}}class p{constructor(e,t){this.isVertical=e,this.scrollEls=t,this.isPaused=!1,this.scrollListeners=t.map(e=>this.bindScroller(e))}destroy(){for(let e of this.scrollListeners)e.destroy()}bindScroller(e){let{scrollEls:t,isVertical:l}=this,s=new g(e);return s.emitter.on("scroll",(s,i)=>{if(!this.isPaused&&((!this.masterEl||this.masterEl!==e&&(s||i))&&this.assignMaster(e),this.masterEl===e))for(let s of t)s!==e&&(l?s.scrollTop=e.scrollTop:s.scrollLeft=e.scrollLeft)}),s.emitter.on("scrollEnd",()=>{this.masterEl===e&&(this.masterEl=null)}),s}assignMaster(e){this.masterEl=e;for(let t of this.scrollListeners)t.el!==e&&t.endScroll()}forceScrollLeft(e){this.isPaused=!0;for(let t of this.scrollListeners)h(t.el,e);this.isPaused=!1}forceScrollTop(e){this.isPaused=!0;for(let t of this.scrollListeners)t.el.scrollTop=e;this.isPaused=!1}}s.config.SCROLLGRID_RESIZE_INTERVAL=500;class S extends s.BaseComponent{constructor(){super(...arguments),this.compileColGroupStats=s.memoizeArraylike(w,W),this.renderMicroColGroups=s.memoizeArraylike(s.renderMicroColGroup),this.clippedScrollerRefs=new s.RefMap,this.scrollerElRefs=new s.RefMap(this._handleScrollerEl.bind(this)),this.chunkElRefs=new s.RefMap(this._handleChunkEl.bind(this)),this.scrollSyncersBySection={},this.scrollSyncersByColumn={},this.rowUnstableMap=new Map,this.rowInnerMaxHeightMap=new Map,this.anyRowHeightsChanged=!1,this.recentSizingCnt=0,this.state={shrinkWidths:[],forceYScrollbars:!1,forceXScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{},sectionRowMaxHeights:[]},this.handleSizing=(e,t)=>{if(!this.allowSizing())return;t||(this.anyRowHeightsChanged=!0);let l={};(e||!t&&!this.rowUnstableMap.size)&&(l.sectionRowMaxHeights=this.computeSectionRowMaxHeights()),this.setState(Object.assign(Object.assign({shrinkWidths:this.computeShrinkWidths()},this.computeScrollerDims()),l),()=>{this.rowUnstableMap.size||this.updateStickyScrolling()})},this.handleRowHeightChange=(e,t)=>{let{rowUnstableMap:l,rowInnerMaxHeightMap:s}=this;if(t){l.delete(e);let t=y(e);s.has(e)&&s.get(e)===t||(s.set(e,t),this.anyRowHeightsChanged=!0),!l.size&&this.anyRowHeightsChanged&&(this.anyRowHeightsChanged=!1,this.setState({sectionRowMaxHeights:this.computeSectionRowMaxHeights()}))}else l.set(e,!0)}}render(){let{props:e,state:t,context:l}=this,{shrinkWidths:r}=t,o=this.compileColGroupStats(e.colGroups.map(e=>[e])),n=this.renderMicroColGroups(o.map((e,t)=>[e.cols,r[t]])),h=s.getScrollGridClassNames(e.liquid,l);this.getDims();let c,a=e.sections,d=a.length,u=0,f=[],g=[],p=[];for(;u<d&&"header"===(c=a[u]).type;)f.push(this.renderSection(c,u,o,n,t.sectionRowMaxHeights,!0)),u+=1;for(;u<d&&"body"===(c=a[u]).type;)g.push(this.renderSection(c,u,o,n,t.sectionRowMaxHeights,!1)),u+=1;for(;u<d&&"footer"===(c=a[u]).type;)p.push(this.renderSection(c,u,o,n,t.sectionRowMaxHeights,!0)),u+=1;const S=!s.getCanVGrowWithinCell(),m={role:"rowgroup"};return i.createElement("table",{ref:e.elRef,role:"grid",className:h.join(" ")},function(e,t){let l=e.map((e,l)=>{let r=e.width;return"shrink"===r&&(r=e.totalColWidth+s.sanitizeShrinkWidth(t[l])+1),i.createElement("col",{style:{width:r}})});return i.createElement("colgroup",{},...l)}(o,r),Boolean(!S&&f.length)&&i.createElement("thead",m,...f),Boolean(!S&&g.length)&&i.createElement("tbody",m,...g),Boolean(!S&&p.length)&&i.createElement("tfoot",m,...p),S&&i.createElement("tbody",m,...f,...g,...p))}renderSection(e,t,l,r,o,n){return"outerContent"in e?i.createElement(i.Fragment,{key:e.key},e.outerContent):i.createElement("tr",{key:e.key,role:"presentation",className:s.getSectionClassNames(e,this.props.liquid).join(" ")},e.chunks.map((s,i)=>this.renderChunk(e,t,l[i],r[i],s,i,(o[t]||[])[i]||[],n)))}renderChunk(e,t,l,r,o,n,h,c){if("outerContent"in o)return i.createElement(i.Fragment,{key:o.key},o.outerContent);let{state:a}=this,{scrollerClientWidths:d,scrollerClientHeights:f}=a,[g,p]=this.getDims(),S=t*p+n,m=n===(!this.context.isRtl||s.getIsRtlScrollbarOnLeft()?p-1:0),y=t===g-1,R=y&&a.forceXScrollbars,w=m&&a.forceYScrollbars,C=l&&l.allowXScrolling,E=s.getAllowYScrolling(this.props,e),W=s.getSectionHasLiquidHeight(this.props,e),b=e.expandRows&&W,M=l&&l.totalColMinWidth||"",k=s.renderChunkContent(e,o,{tableColGroupNode:r,tableMinWidth:M,clientWidth:void 0!==d[S]?d[S]:null,clientHeight:void 0!==f[S]?f[S]:null,expandRows:b,syncRowHeights:Boolean(e.syncRowHeights),rowSyncHeights:h,reportRowHeightChange:this.handleRowHeightChange},c),v=R?y?"scroll":"scroll-hidden":C?y?"auto":"scroll-hidden":"hidden",x=w?m?"scroll":"scroll-hidden":E?m?"auto":"scroll-hidden":"hidden";return k=i.createElement(u,{ref:this.clippedScrollerRefs.createRef(S),scrollerElRef:this.scrollerElRefs.createRef(S),overflowX:v,overflowY:x,liquid:W,maxHeight:e.maxHeight},k),i.createElement(c?"th":"td",{key:o.key,ref:this.chunkElRefs.createRef(S),role:"presentation"},k)}componentDidMount(){this.getStickyScrolling=s.memoizeArraylike(k),this.getScrollSyncersBySection=s.memoizeHashlike(b.bind(this,!0),null,M),this.getScrollSyncersByColumn=s.memoizeHashlike(b.bind(this,!1),null,M),this.updateScrollSyncers(),this.handleSizing(!1),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(e,t){this.updateScrollSyncers(),this.handleSizing(!1,t.sectionRowMaxHeights!==this.state.sectionRowMaxHeights)}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing),this.destroyScrollSyncers()}allowSizing(){let e=new Date;return!this.lastSizingDate||e.valueOf()>this.lastSizingDate.valueOf()+s.config.SCROLLGRID_RESIZE_INTERVAL?(this.lastSizingDate=e,this.recentSizingCnt=0,!0):(this.recentSizingCnt+=1)<=10}computeShrinkWidths(){let e=this.compileColGroupStats(this.props.colGroups.map(e=>[e])),[t,l]=this.getDims(),i=t*l,r=[];return e.forEach((e,t)=>{if(e.hasShrinkCol){let e=this.chunkElRefs.collect(t,i,l);r[t]=s.computeShrinkWidth(e)}}),r}computeSectionRowMaxHeights(){let e=new Map,[t,l]=this.getDims(),i=[];for(let r=0;r<t;r+=1){let t=this.props.sections[r],o=[];if(t&&t.syncRowHeights){let i=[];for(let t=0;t<l;t+=1){let o=r*l+t,n=[],h=this.chunkElRefs.currentMap[o];n=h?s.findElements(h,".fc-scrollgrid-sync-table tr").map(t=>{let l=y(t);return e.set(t,l),l}):[],i.push(n)}let n=i[0].length,h=!0;for(let e=1;e<l;e+=1){if(!(t.chunks[e]&&void 0!==t.chunks[e].outerContent)&&i[e].length!==n){h=!1;break}}if(h){for(let e=0;e<l;e+=1)o.push([]);for(let e=0;e<n;e+=1){let t=[];for(let s=0;s<l;s+=1){let l=i[s][e];null!=l&&t.push(l)}let s=Math.max(...t);for(let e=0;e<l;e+=1)o[e].push(s)}}else{let e=[];for(let t=0;t<l;t+=1)e.push(m(i[t])+i[t].length);let t=Math.max(...e);for(let e=0;e<l;e+=1){let l=i[e].length,s=t-l,r=Math.floor(s/l),n=s-r*(l-1),h=[],c=0;for(c<l&&(h.push(n),c+=1);c<l;)h.push(r),c+=1;o.push(h)}}}i.push(o)}return this.rowInnerMaxHeightMap=e,i}computeScrollerDims(){let e=s.getScrollbarWidths(),[t,l]=this.getDims(),i=!this.context.isRtl||s.getIsRtlScrollbarOnLeft()?l-1:0,r=t-1,o=this.clippedScrollerRefs.currentMap,n=this.scrollerElRefs.currentMap,h=!1,c=!1,a={},d={};for(let e=0;e<t;e+=1){let t=o[e*l+i];if(t&&t.needsYScrolling()){h=!0;break}}for(let e=0;e<l;e+=1){let t=o[r*l+e];if(t&&t.needsXScrolling()){c=!0;break}}for(let s=0;s<t;s+=1)for(let t=0;t<l;t+=1){let o=s*l+t,u=n[o];if(u){let l=u.parentNode;a[o]=Math.floor(l.getBoundingClientRect().width-(t===i&&h?e.y:0)),d[o]=Math.floor(l.getBoundingClientRect().height-(s===r&&c?e.x:0))}}return{forceYScrollbars:h,forceXScrollbars:c,scrollerClientWidths:a,scrollerClientHeights:d}}updateStickyScrolling(){let{isRtl:e}=this.context,t=this.scrollerElRefs.getAll().map(t=>[t,e]);this.getStickyScrolling(t).forEach(e=>e.updateSize())}updateScrollSyncers(){let[e,t]=this.getDims(),l=e*t,i={},r={},o=this.scrollerElRefs.currentMap;for(let l=0;l<e;l+=1){let e=l*t,r=e+t;i[l]=s.collectFromHash(o,e,r,1)}for(let e=0;e<t;e+=1)r[e]=this.scrollerElRefs.collect(e,l,t);this.scrollSyncersBySection=this.getScrollSyncersBySection(i),this.scrollSyncersByColumn=this.getScrollSyncersByColumn(r)}destroyScrollSyncers(){s.mapHash(this.scrollSyncersBySection,M),s.mapHash(this.scrollSyncersByColumn,M)}getChunkConfigByIndex(e){let t=this.getDims()[1],l=Math.floor(e/t),s=e%t,i=this.props.sections[l];return i&&i.chunks[s]}forceScrollLeft(e,t){let l=this.scrollSyncersByColumn[e];l&&l.forceScrollLeft(t)}forceScrollTop(e,t){let l=this.scrollSyncersBySection[e];l&&l.forceScrollTop(t)}_handleChunkEl(e,t){let l=this.getChunkConfigByIndex(parseInt(t,10));l&&s.setRef(l.elRef,e)}_handleScrollerEl(e,t){let l=this.getChunkConfigByIndex(parseInt(t,10));l&&s.setRef(l.scrollerElRef,e)}getDims(){let e=this.props.sections.length;return[e,e?this.props.sections[0].chunks.length:0]}}function m(e){let t=0;for(let l of e)t+=l;return t}function y(e){let t=s.findElements(e,".fc-scrollgrid-sync-inner").map(R);return t.length?Math.max(...t):0}function R(e){return e.offsetHeight}function w(e){let t=C(e.cols,"width"),l=C(e.cols,"minWidth"),i=s.hasShrinkWidth(e.cols);return{hasShrinkCol:i,totalColWidth:t,totalColMinWidth:l,allowXScrolling:"shrink"!==e.width&&Boolean(t||l||i),cols:e.cols,width:e.width}}function C(e,t){let l=0;for(let s of e){let e=s[t];"number"==typeof e&&(l+=e*(s.span||1))}return l}S.addStateEquality({shrinkWidths:s.isArraysEqual,scrollerClientWidths:s.isPropsEqual,scrollerClientHeights:s.isPropsEqual});const E={cols:s.isColPropsEqual};function W(e,t){return s.compareObjs(e,t,E)}function b(e,...t){return new p(e,t)}function M(e){e.destroy()}function k(e,t){return new d(e,t)}var v=t.createPlugin({name:"@fullcalendar/scrollgrid",premiumReleaseDate:"2022-12-27",deps:[o.default],scrollGridImpl:S}),x={__proto__:null,ScrollGrid:S};return t.globalPlugins.push(v),e.Internal=x,e.default=v,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.PremiumCommon,FullCalendar.Internal,FullCalendar.Preact);
FullCalendar.ScrollGrid=function(e,t,l,s,i){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=r(l);function n(e){let t=e.scrollLeft;if("rtl"===window.getComputedStyle(e).direction)switch(a()){case"negative":t*=-1;case"reverse":t=e.scrollWidth-t-e.clientWidth}return t}function h(e,t){if("rtl"===window.getComputedStyle(e).direction)switch(a()){case"reverse":t=e.scrollWidth-t;break;case"negative":t=-(e.scrollWidth-t)}e.scrollLeft=t}let c;function a(){return c||(c=function(){let e,t=document.createElement("div");t.style.position="absolute",t.style.top="-1000px",t.style.width="1px",t.style.height="1px",t.style.overflow="scroll",t.style.direction="rtl",t.style.fontSize="100px",t.innerHTML="A",document.body.appendChild(t),t.scrollLeft>0?e="positive":(t.scrollLeft=1,e=t.scrollLeft>0?"reverse":"negative");return s.removeElement(t),e}())}class d{constructor(e,t){this.scrollEl=e,this.isRtl=t,this.updateSize=()=>{let{scrollEl:e}=this,t=s.findElements(e,".fc-sticky");!function(e,t,l){e.forEach((e,i)=>{let r,{textAlign:o,elWidth:n,parentBound:h}=t[i],c=h.right-h.left;r="center"===o&&c>l?(l-n)/2:"",s.applyStyle(e,{left:r,right:r,top:0})})}(t,this.queryElGeoms(t),e.clientWidth)}}queryElGeoms(e){let{scrollEl:t,isRtl:l}=this,i=function(e){let t=e.getBoundingClientRect(),l=s.computeEdges(e);return{left:t.left+l.borderLeft+l.scrollbarLeft-n(e),top:t.top+l.borderTop-e.scrollTop}}(t),r=[];for(let t of e){let e=s.translateRect(s.computeInnerRect(t.parentNode,!0,!0),-i.left,-i.top),o=t.getBoundingClientRect(),n=window.getComputedStyle(t),h=window.getComputedStyle(t.parentNode).textAlign,c=null;"start"===h?h=l?"right":"left":"end"===h&&(h=l?"left":"right"),"sticky"!==n.position&&(c=s.translateRect(o,-i.left-(parseFloat(n.left)||0),-i.top-(parseFloat(n.top)||0))),r.push({parentBound:e,naturalBound:c,elWidth:o.width,elHeight:o.height,textAlign:h})}return r}}class u extends s.BaseComponent{constructor(){super(...arguments),this.elRef=i.createRef(),this.state={xScrollbarWidth:0,yScrollbarWidth:0},this.handleScroller=e=>{this.scroller=e,s.setRef(this.props.scrollerRef,e)},this.handleSizing=()=>{let{props:e}=this;"scroll-hidden"===e.overflowY&&this.setState({yScrollbarWidth:this.scroller.getYScrollbarWidth()}),"scroll-hidden"===e.overflowX&&this.setState({xScrollbarWidth:this.scroller.getXScrollbarWidth()})}}render(){let{props:e,state:t,context:l}=this,r=l.isRtl&&s.getIsRtlScrollbarOnLeft(),o=0,n=0,h=0;return"scroll-hidden"===e.overflowX&&(h=t.xScrollbarWidth),"scroll-hidden"===e.overflowY&&null!=t.yScrollbarWidth&&(r?o=t.yScrollbarWidth:n=t.yScrollbarWidth),i.createElement("div",{ref:this.elRef,className:"fc-scroller-harness"+(e.liquid?" fc-scroller-harness-liquid":"")},i.createElement(s.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:o,overcomeRight:n,overcomeBottom:h,maxHeight:"number"==typeof e.maxHeight?e.maxHeight+("scroll-hidden"===e.overflowX?t.xScrollbarWidth:0):"",liquid:e.liquid,liquidIsAbsolute:!0},e.children))}componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(e){s.isPropsEqual(e,this.props)||this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}needsXScrolling(){return this.scroller.needsXScrolling()}needsYScrolling(){return this.scroller.needsYScrolling()}}const f="wheel mousewheel DomMouseScroll MozMousePixelScroll".split(" ");class g{constructor(e){this.el=e,this.emitter=new s.Emitter,this.isScrolling=!1,this.isTouching=!1,this.isRecentlyWheeled=!1,this.isRecentlyScrolled=!1,this.wheelWaiter=new s.DelayedRunner(this._handleWheelWaited.bind(this)),this.scrollWaiter=new s.DelayedRunner(this._handleScrollWaited.bind(this)),this.handleScroll=()=>{this.startScroll(),this.emitter.trigger("scroll",this.isRecentlyWheeled,this.isTouching),this.isRecentlyScrolled=!0,this.scrollWaiter.request(500)},this.handleWheel=()=>{this.isRecentlyWheeled=!0,this.wheelWaiter.request(500)},this.handleTouchStart=()=>{this.isTouching=!0},this.handleTouchEnd=()=>{this.isTouching=!1,this.isRecentlyScrolled||this.endScroll()},e.addEventListener("scroll",this.handleScroll),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.addEventListener("touchend",this.handleTouchEnd);for(let t of f)e.addEventListener(t,this.handleWheel)}destroy(){let{el:e}=this;e.removeEventListener("scroll",this.handleScroll),e.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.removeEventListener("touchend",this.handleTouchEnd);for(let t of f)e.removeEventListener(t,this.handleWheel)}startScroll(){this.isScrolling||(this.isScrolling=!0,this.emitter.trigger("scrollStart",this.isRecentlyWheeled,this.isTouching))}endScroll(){this.isScrolling&&(this.emitter.trigger("scrollEnd"),this.isScrolling=!1,this.isRecentlyScrolled=!0,this.isRecentlyWheeled=!1,this.scrollWaiter.clear(),this.wheelWaiter.clear())}_handleScrollWaited(){this.isRecentlyScrolled=!1,this.isTouching||this.endScroll()}_handleWheelWaited(){this.isRecentlyWheeled=!1}}class p{constructor(e,t){this.isVertical=e,this.scrollEls=t,this.isPaused=!1,this.scrollListeners=t.map(e=>this.bindScroller(e))}destroy(){for(let e of this.scrollListeners)e.destroy()}bindScroller(e){let{scrollEls:t,isVertical:l}=this,s=new g(e);return s.emitter.on("scroll",(s,i)=>{if(!this.isPaused&&((!this.masterEl||this.masterEl!==e&&(s||i))&&this.assignMaster(e),this.masterEl===e))for(let s of t)s!==e&&(l?s.scrollTop=e.scrollTop:s.scrollLeft=e.scrollLeft)}),s.emitter.on("scrollEnd",()=>{this.masterEl===e&&(this.masterEl=null)}),s}assignMaster(e){this.masterEl=e;for(let t of this.scrollListeners)t.el!==e&&t.endScroll()}forceScrollLeft(e){this.isPaused=!0;for(let t of this.scrollListeners)h(t.el,e);this.isPaused=!1}forceScrollTop(e){this.isPaused=!0;for(let t of this.scrollListeners)t.el.scrollTop=e;this.isPaused=!1}}s.config.SCROLLGRID_RESIZE_INTERVAL=500;class S extends s.BaseComponent{constructor(){super(...arguments),this.compileColGroupStats=s.memoizeArraylike(w,W),this.renderMicroColGroups=s.memoizeArraylike(s.renderMicroColGroup),this.clippedScrollerRefs=new s.RefMap,this.scrollerElRefs=new s.RefMap(this._handleScrollerEl.bind(this)),this.chunkElRefs=new s.RefMap(this._handleChunkEl.bind(this)),this.scrollSyncersBySection={},this.scrollSyncersByColumn={},this.rowUnstableMap=new Map,this.rowInnerMaxHeightMap=new Map,this.anyRowHeightsChanged=!1,this.recentSizingCnt=0,this.state={shrinkWidths:[],forceYScrollbars:!1,forceXScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{},sectionRowMaxHeights:[]},this.handleSizing=(e,t)=>{if(!this.allowSizing())return;t||(this.anyRowHeightsChanged=!0);let l={};(e||!t&&!this.rowUnstableMap.size)&&(l.sectionRowMaxHeights=this.computeSectionRowMaxHeights()),this.setState(Object.assign(Object.assign({shrinkWidths:this.computeShrinkWidths()},this.computeScrollerDims()),l),()=>{this.rowUnstableMap.size||this.updateStickyScrolling()})},this.handleRowHeightChange=(e,t)=>{let{rowUnstableMap:l,rowInnerMaxHeightMap:s}=this;if(t){l.delete(e);let t=y(e);s.has(e)&&s.get(e)===t||(s.set(e,t),this.anyRowHeightsChanged=!0),!l.size&&this.anyRowHeightsChanged&&(this.anyRowHeightsChanged=!1,this.setState({sectionRowMaxHeights:this.computeSectionRowMaxHeights()}))}else l.set(e,!0)}}render(){let{props:e,state:t,context:l}=this,{shrinkWidths:r}=t,o=this.compileColGroupStats(e.colGroups.map(e=>[e])),n=this.renderMicroColGroups(o.map((e,t)=>[e.cols,r[t]])),h=s.getScrollGridClassNames(e.liquid,l);this.getDims();let c,a=e.sections,d=a.length,u=0,f=[],g=[],p=[];for(;u<d&&"header"===(c=a[u]).type;)f.push(this.renderSection(c,u,o,n,t.sectionRowMaxHeights,!0)),u+=1;for(;u<d&&"body"===(c=a[u]).type;)g.push(this.renderSection(c,u,o,n,t.sectionRowMaxHeights,!1)),u+=1;for(;u<d&&"footer"===(c=a[u]).type;)p.push(this.renderSection(c,u,o,n,t.sectionRowMaxHeights,!0)),u+=1;const S=!s.getCanVGrowWithinCell(),m={role:"rowgroup"};return i.createElement("table",{ref:e.elRef,role:"grid",className:h.join(" ")},function(e,t){let l=e.map((e,l)=>{let r=e.width;return"shrink"===r&&(r=e.totalColWidth+s.sanitizeShrinkWidth(t[l])+1),i.createElement("col",{style:{width:r}})});return i.createElement("colgroup",{},...l)}(o,r),Boolean(!S&&f.length)&&i.createElement("thead",m,...f),Boolean(!S&&g.length)&&i.createElement("tbody",m,...g),Boolean(!S&&p.length)&&i.createElement("tfoot",m,...p),S&&i.createElement("tbody",m,...f,...g,...p))}renderSection(e,t,l,r,o,n){return"outerContent"in e?i.createElement(i.Fragment,{key:e.key},e.outerContent):i.createElement("tr",{key:e.key,role:"presentation",className:s.getSectionClassNames(e,this.props.liquid).join(" ")},e.chunks.map((s,i)=>this.renderChunk(e,t,l[i],r[i],s,i,(o[t]||[])[i]||[],n)))}renderChunk(e,t,l,r,o,n,h,c){if("outerContent"in o)return i.createElement(i.Fragment,{key:o.key},o.outerContent);let{state:a}=this,{scrollerClientWidths:d,scrollerClientHeights:f}=a,[g,p]=this.getDims(),S=t*p+n,m=n===(!this.context.isRtl||s.getIsRtlScrollbarOnLeft()?p-1:0),y=t===g-1,R=y&&a.forceXScrollbars,w=m&&a.forceYScrollbars,C=l&&l.allowXScrolling,E=s.getAllowYScrolling(this.props,e),W=s.getSectionHasLiquidHeight(this.props,e),b=e.expandRows&&W,M=l&&l.totalColMinWidth||"",k=s.renderChunkContent(e,o,{tableColGroupNode:r,tableMinWidth:M,clientWidth:void 0!==d[S]?d[S]:null,clientHeight:void 0!==f[S]?f[S]:null,expandRows:b,syncRowHeights:Boolean(e.syncRowHeights),rowSyncHeights:h,reportRowHeightChange:this.handleRowHeightChange},c),v=R?y?"scroll":"scroll-hidden":C?y?"auto":"scroll-hidden":"hidden",x=w?m?"scroll":"scroll-hidden":E?m?"auto":"scroll-hidden":"hidden";return k=i.createElement(u,{ref:this.clippedScrollerRefs.createRef(S),scrollerElRef:this.scrollerElRefs.createRef(S),overflowX:v,overflowY:x,liquid:W,maxHeight:e.maxHeight},k),i.createElement(c?"th":"td",{key:o.key,ref:this.chunkElRefs.createRef(S),role:"presentation"},k)}componentDidMount(){this.getStickyScrolling=s.memoizeArraylike(k),this.getScrollSyncersBySection=s.memoizeHashlike(b.bind(this,!0),null,M),this.getScrollSyncersByColumn=s.memoizeHashlike(b.bind(this,!1),null,M),this.updateScrollSyncers(),this.handleSizing(!1),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(e,t){this.updateScrollSyncers(),this.handleSizing(!1,t.sectionRowMaxHeights!==this.state.sectionRowMaxHeights)}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing),this.destroyScrollSyncers()}allowSizing(){let e=new Date;return!this.lastSizingDate||e.valueOf()>this.lastSizingDate.valueOf()+s.config.SCROLLGRID_RESIZE_INTERVAL?(this.lastSizingDate=e,this.recentSizingCnt=0,!0):(this.recentSizingCnt+=1)<=10}computeShrinkWidths(){let e=this.compileColGroupStats(this.props.colGroups.map(e=>[e])),[t,l]=this.getDims(),i=t*l,r=[];return e.forEach((e,t)=>{if(e.hasShrinkCol){let e=this.chunkElRefs.collect(t,i,l);r[t]=s.computeShrinkWidth(e)}}),r}computeSectionRowMaxHeights(){let e=new Map,[t,l]=this.getDims(),i=[];for(let r=0;r<t;r+=1){let t=this.props.sections[r],o=[];if(t&&t.syncRowHeights){let i=[];for(let t=0;t<l;t+=1){let o=r*l+t,n=[],h=this.chunkElRefs.currentMap[o];n=h?s.findElements(h,".fc-scrollgrid-sync-table tr").map(t=>{let l=y(t);return e.set(t,l),l}):[],i.push(n)}let n=i[0].length,h=!0;for(let e=1;e<l;e+=1){if(!(t.chunks[e]&&void 0!==t.chunks[e].outerContent)&&i[e].length!==n){h=!1;break}}if(h){for(let e=0;e<l;e+=1)o.push([]);for(let e=0;e<n;e+=1){let t=[];for(let s=0;s<l;s+=1){let l=i[s][e];null!=l&&t.push(l)}let s=Math.max(...t);for(let e=0;e<l;e+=1)o[e].push(s)}}else{let e=[];for(let t=0;t<l;t+=1)e.push(m(i[t])+i[t].length);let t=Math.max(...e);for(let e=0;e<l;e+=1){let l=i[e].length,s=t-l,r=Math.floor(s/l),n=s-r*(l-1),h=[],c=0;for(c<l&&(h.push(n),c+=1);c<l;)h.push(r),c+=1;o.push(h)}}}i.push(o)}return this.rowInnerMaxHeightMap=e,i}computeScrollerDims(){let e=s.getScrollbarWidths(),[t,l]=this.getDims(),i=!this.context.isRtl||s.getIsRtlScrollbarOnLeft()?l-1:0,r=t-1,o=this.clippedScrollerRefs.currentMap,n=this.scrollerElRefs.currentMap,h=!1,c=!1,a={},d={};for(let e=0;e<t;e+=1){let t=o[e*l+i];if(t&&t.needsYScrolling()){h=!0;break}}for(let e=0;e<l;e+=1){let t=o[r*l+e];if(t&&t.needsXScrolling()){c=!0;break}}for(let s=0;s<t;s+=1)for(let t=0;t<l;t+=1){let o=s*l+t,u=n[o];if(u){let l=u.parentNode;a[o]=Math.floor(l.getBoundingClientRect().width-(t===i&&h?e.y:0)),d[o]=Math.floor(l.getBoundingClientRect().height-(s===r&&c?e.x:0))}}return{forceYScrollbars:h,forceXScrollbars:c,scrollerClientWidths:a,scrollerClientHeights:d}}updateStickyScrolling(){let{isRtl:e}=this.context,t=this.scrollerElRefs.getAll().map(t=>[t,e]);this.getStickyScrolling(t).forEach(e=>e.updateSize())}updateScrollSyncers(){let[e,t]=this.getDims(),l=e*t,i={},r={},o=this.scrollerElRefs.currentMap;for(let l=0;l<e;l+=1){let e=l*t,r=e+t;i[l]=s.collectFromHash(o,e,r,1)}for(let e=0;e<t;e+=1)r[e]=this.scrollerElRefs.collect(e,l,t);this.scrollSyncersBySection=this.getScrollSyncersBySection(i),this.scrollSyncersByColumn=this.getScrollSyncersByColumn(r)}destroyScrollSyncers(){s.mapHash(this.scrollSyncersBySection,M),s.mapHash(this.scrollSyncersByColumn,M)}getChunkConfigByIndex(e){let t=this.getDims()[1],l=Math.floor(e/t),s=e%t,i=this.props.sections[l];return i&&i.chunks[s]}forceScrollLeft(e,t){let l=this.scrollSyncersByColumn[e];l&&l.forceScrollLeft(t)}forceScrollTop(e,t){let l=this.scrollSyncersBySection[e];l&&l.forceScrollTop(t)}_handleChunkEl(e,t){let l=this.getChunkConfigByIndex(parseInt(t,10));l&&s.setRef(l.elRef,e)}_handleScrollerEl(e,t){let l=this.getChunkConfigByIndex(parseInt(t,10));l&&s.setRef(l.scrollerElRef,e)}getDims(){let e=this.props.sections.length;return[e,e?this.props.sections[0].chunks.length:0]}}function m(e){let t=0;for(let l of e)t+=l;return t}function y(e){let t=s.findElements(e,".fc-scrollgrid-sync-inner").map(R);return t.length?Math.max(...t):0}function R(e){return e.offsetHeight}function w(e){let t=C(e.cols,"width"),l=C(e.cols,"minWidth"),i=s.hasShrinkWidth(e.cols);return{hasShrinkCol:i,totalColWidth:t,totalColMinWidth:l,allowXScrolling:"shrink"!==e.width&&Boolean(t||l||i),cols:e.cols,width:e.width}}function C(e,t){let l=0;for(let s of e){let e=s[t];"number"==typeof e&&(l+=e*(s.span||1))}return l}S.addStateEquality({shrinkWidths:s.isArraysEqual,scrollerClientWidths:s.isPropsEqual,scrollerClientHeights:s.isPropsEqual});const E={cols:s.isColPropsEqual};function W(e,t){return s.compareObjs(e,t,E)}function b(e,...t){return new p(e,t)}function M(e){e.destroy()}function k(e,t){return new d(e,t)}var v=t.createPlugin({name:"@fullcalendar/scrollgrid",premiumReleaseDate:"2023-01-11",deps:[o.default],scrollGridImpl:S}),x={__proto__:null,ScrollGrid:S};return t.globalPlugins.push(v),e.Internal=x,e.default=v,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.PremiumCommon,FullCalendar.Internal,FullCalendar.Preact);

@@ -1,14 +0,22 @@

import { createPlugin } from '@fullcalendar/core/index.js';
import premiumCommonPlugin from '@fullcalendar/premium-common/index.js';
import { ScrollGrid } from './internal.js';
import '@fullcalendar/core/internal.js';
import '@fullcalendar/core/preact.js';
'use strict';
var index = createPlugin({
Object.defineProperty(exports, '__esModule', { value: true });
var core = require('@fullcalendar/core');
var premiumCommonPlugin = require('@fullcalendar/premium-common');
var internalCommon = require('./internal.js');
require('@fullcalendar/core/internal');
require('@fullcalendar/core/preact');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var premiumCommonPlugin__default = /*#__PURE__*/_interopDefaultLegacy(premiumCommonPlugin);
var index = core.createPlugin({
name: '@fullcalendar/scrollgrid',
premiumReleaseDate: '2022-12-27',
deps: [premiumCommonPlugin],
scrollGridImpl: ScrollGrid,
premiumReleaseDate: '2023-01-11',
deps: [premiumCommonPlugin__default["default"]],
scrollGridImpl: internalCommon.ScrollGrid,
});
export { index as default };
exports["default"] = index;

@@ -1,8 +0,12 @@

import { computeEdges, removeElement, findElements, translateRect, computeInnerRect, applyStyle, BaseComponent, setRef, getIsRtlScrollbarOnLeft, Scroller, isPropsEqual, Emitter, DelayedRunner, config, memoizeArraylike, renderMicroColGroup, RefMap, getScrollGridClassNames, getCanVGrowWithinCell, getSectionClassNames, getAllowYScrolling, getSectionHasLiquidHeight, renderChunkContent, memoizeHashlike, computeShrinkWidth, getScrollbarWidths, collectFromHash, mapHash, isArraysEqual, sanitizeShrinkWidth, hasShrinkWidth, compareObjs, isColPropsEqual } from '@fullcalendar/core/internal.js';
import { createRef, createElement, Fragment } from '@fullcalendar/core/preact.js';
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var internal = require('@fullcalendar/core/internal');
var preact = require('@fullcalendar/core/preact');
// TODO: assume the el has no borders?
function getScrollCanvasOrigin(scrollEl) {
let rect = scrollEl.getBoundingClientRect();
let edges = computeEdges(scrollEl); // TODO: pass in isRtl?
let edges = internal.computeEdges(scrollEl); // TODO: pass in isRtl?
return {

@@ -70,3 +74,3 @@ left: rect.left + edges.borderLeft + edges.scrollbarLeft - getScrollFromLeftEdge(scrollEl),

}
removeElement(el);
internal.removeElement(el);
return system;

@@ -90,3 +94,3 @@ }

let { scrollEl } = this;
let els = findElements(scrollEl, STICKY_SELECTOR);
let els = internal.findElements(scrollEl, STICKY_SELECTOR);
let elGeoms = this.queryElGeoms(els);

@@ -102,3 +106,3 @@ let viewportWidth = scrollEl.clientWidth;

for (let el of els) {
let parentBound = translateRect(computeInnerRect(el.parentNode, true, true), // weird way to call this!!!
let parentBound = internal.translateRect(internal.computeInnerRect(el.parentNode, true, true), // weird way to call this!!!
-canvasOrigin.left, -canvasOrigin.top);

@@ -116,3 +120,3 @@ let elRect = el.getBoundingClientRect();

if (computedStyles.position !== 'sticky') {
naturalBound = translateRect(elRect, -canvasOrigin.left - (parseFloat(computedStyles.left) || 0), // could be 'auto'
naturalBound = internal.translateRect(elRect, -canvasOrigin.left - (parseFloat(computedStyles.left) || 0), // could be 'auto'
-canvasOrigin.top - (parseFloat(computedStyles.top) || 0));

@@ -143,3 +147,3 @@ }

}
applyStyle(el, {
internal.applyStyle(el, {
left,

@@ -152,6 +156,6 @@ right: left,

class ClippedScroller extends BaseComponent {
class ClippedScroller extends internal.BaseComponent {
constructor() {
super(...arguments);
this.elRef = createRef();
this.elRef = preact.createRef();
this.state = {

@@ -163,3 +167,3 @@ xScrollbarWidth: 0,

this.scroller = scroller;
setRef(this.props.scrollerRef, scroller);
internal.setRef(this.props.scrollerRef, scroller);
};

@@ -178,3 +182,3 @@ this.handleSizing = () => {

let { props, state, context } = this;
let isScrollbarOnLeft = context.isRtl && getIsRtlScrollbarOnLeft();
let isScrollbarOnLeft = context.isRtl && internal.getIsRtlScrollbarOnLeft();
let overcomeLeft = 0;

@@ -196,4 +200,4 @@ let overcomeRight = 0;

}
return (createElement("div", { ref: this.elRef, className: 'fc-scroller-harness' + (props.liquid ? ' fc-scroller-harness-liquid' : '') },
createElement(Scroller, { ref: this.handleScroller, elRef: this.props.scrollerElRef, overflowX: props.overflowX === 'scroll-hidden' ? 'scroll' : props.overflowX, overflowY: props.overflowY === 'scroll-hidden' ? 'scroll' : props.overflowY, overcomeLeft: overcomeLeft, overcomeRight: overcomeRight, overcomeBottom: overcomeBottom, maxHeight: typeof props.maxHeight === 'number'
return (preact.createElement("div", { ref: this.elRef, className: 'fc-scroller-harness' + (props.liquid ? ' fc-scroller-harness-liquid' : '') },
preact.createElement(internal.Scroller, { ref: this.handleScroller, elRef: this.props.scrollerElRef, overflowX: props.overflowX === 'scroll-hidden' ? 'scroll' : props.overflowX, overflowY: props.overflowY === 'scroll-hidden' ? 'scroll' : props.overflowY, overcomeLeft: overcomeLeft, overcomeRight: overcomeRight, overcomeBottom: overcomeBottom, maxHeight: typeof props.maxHeight === 'number'
? (props.maxHeight + (props.overflowX === 'scroll-hidden' ? state.xScrollbarWidth : 0))

@@ -207,3 +211,3 @@ : '', liquid: props.liquid, liquidIsAbsolute: true }, props.children)));

componentDidUpdate(prevProps) {
if (!isPropsEqual(prevProps, this.props)) { // an external change?
if (!internal.isPropsEqual(prevProps, this.props)) { // an external change?
this.handleSizing();

@@ -230,3 +234,3 @@ }

this.el = el;
this.emitter = new Emitter();
this.emitter = new internal.Emitter();
this.isScrolling = false;

@@ -236,4 +240,4 @@ this.isTouching = false; // user currently has finger down?

this.isRecentlyScrolled = false;
this.wheelWaiter = new DelayedRunner(this._handleWheelWaited.bind(this));
this.scrollWaiter = new DelayedRunner(this._handleScrollWaited.bind(this));
this.wheelWaiter = new internal.DelayedRunner(this._handleWheelWaited.bind(this));
this.scrollWaiter = new internal.DelayedRunner(this._handleScrollWaited.bind(this));
// Handlers

@@ -381,3 +385,3 @@ // ----------------------------------------------------------------------------------------------

config.SCROLLGRID_RESIZE_INTERVAL = 500;
internal.config.SCROLLGRID_RESIZE_INTERVAL = 500;
/*

@@ -387,11 +391,11 @@ TODO: make <ScrollGridSection> subcomponent

*/
class ScrollGrid extends BaseComponent {
class ScrollGrid extends internal.BaseComponent {
constructor() {
super(...arguments);
this.compileColGroupStats = memoizeArraylike(compileColGroupStat, isColGroupStatsEqual);
this.renderMicroColGroups = memoizeArraylike(renderMicroColGroup); // yucky to memoize VNodes, but much more efficient for consumers
this.clippedScrollerRefs = new RefMap();
this.compileColGroupStats = internal.memoizeArraylike(compileColGroupStat, isColGroupStatsEqual);
this.renderMicroColGroups = internal.memoizeArraylike(internal.renderMicroColGroup); // yucky to memoize VNodes, but much more efficient for consumers
this.clippedScrollerRefs = new internal.RefMap();
// doesn't hold non-scrolling els used just for padding
this.scrollerElRefs = new RefMap(this._handleScrollerEl.bind(this));
this.chunkElRefs = new RefMap(this._handleChunkEl.bind(this));
this.scrollerElRefs = new internal.RefMap(this._handleScrollerEl.bind(this));
this.chunkElRefs = new internal.RefMap(this._handleChunkEl.bind(this));
this.scrollSyncersBySection = {};

@@ -456,3 +460,3 @@ this.scrollSyncersByColumn = {};

let microColGroupNodes = this.renderMicroColGroups(colGroupStats.map((stat, i) => [stat.cols, shrinkWidths[i]]));
let classNames = getScrollGridClassNames(props.liquid, context);
let classNames = internal.getScrollGridClassNames(props.liquid, context);
this.getDims();

@@ -479,19 +483,19 @@ // TODO: make DRY

}
const isBuggy = !getCanVGrowWithinCell(); // see NOTE in SimpleScrollGrid
const isBuggy = !internal.getCanVGrowWithinCell(); // see NOTE in SimpleScrollGrid
const roleAttrs = { role: 'rowgroup' };
return createElement('table', {
return preact.createElement('table', {
ref: props.elRef,
role: 'grid',
className: classNames.join(' '),
}, renderMacroColGroup(colGroupStats, shrinkWidths), Boolean(!isBuggy && headSectionNodes.length) && createElement('thead', roleAttrs, ...headSectionNodes), Boolean(!isBuggy && bodySectionNodes.length) && createElement('tbody', roleAttrs, ...bodySectionNodes), Boolean(!isBuggy && footSectionNodes.length) && createElement('tfoot', roleAttrs, ...footSectionNodes), isBuggy && createElement('tbody', roleAttrs, ...headSectionNodes, ...bodySectionNodes, ...footSectionNodes));
}, renderMacroColGroup(colGroupStats, shrinkWidths), Boolean(!isBuggy && headSectionNodes.length) && preact.createElement('thead', roleAttrs, ...headSectionNodes), Boolean(!isBuggy && bodySectionNodes.length) && preact.createElement('tbody', roleAttrs, ...bodySectionNodes), Boolean(!isBuggy && footSectionNodes.length) && preact.createElement('tfoot', roleAttrs, ...footSectionNodes), isBuggy && preact.createElement('tbody', roleAttrs, ...headSectionNodes, ...bodySectionNodes, ...footSectionNodes));
}
renderSection(sectionConfig, sectionIndex, colGroupStats, microColGroupNodes, sectionRowMaxHeights, isHeader) {
if ('outerContent' in sectionConfig) {
return (createElement(Fragment, { key: sectionConfig.key }, sectionConfig.outerContent));
return (preact.createElement(preact.Fragment, { key: sectionConfig.key }, sectionConfig.outerContent));
}
return (createElement("tr", { key: sectionConfig.key, role: "presentation", className: getSectionClassNames(sectionConfig, this.props.liquid).join(' ') }, sectionConfig.chunks.map((chunkConfig, i) => this.renderChunk(sectionConfig, sectionIndex, colGroupStats[i], microColGroupNodes[i], chunkConfig, i, (sectionRowMaxHeights[sectionIndex] || [])[i] || [], isHeader))));
return (preact.createElement("tr", { key: sectionConfig.key, role: "presentation", className: internal.getSectionClassNames(sectionConfig, this.props.liquid).join(' ') }, sectionConfig.chunks.map((chunkConfig, i) => this.renderChunk(sectionConfig, sectionIndex, colGroupStats[i], microColGroupNodes[i], chunkConfig, i, (sectionRowMaxHeights[sectionIndex] || [])[i] || [], isHeader))));
}
renderChunk(sectionConfig, sectionIndex, colGroupStat, microColGroupNode, chunkConfig, chunkIndex, rowHeights, isHeader) {
if ('outerContent' in chunkConfig) {
return (createElement(Fragment, { key: chunkConfig.key }, chunkConfig.outerContent));
return (preact.createElement(preact.Fragment, { key: chunkConfig.key }, chunkConfig.outerContent));
}

@@ -502,3 +506,3 @@ let { state } = this;

let index = sectionIndex * chunksPerSection + chunkIndex;
let sideScrollIndex = (!this.context.isRtl || getIsRtlScrollbarOnLeft()) ? chunksPerSection - 1 : 0;
let sideScrollIndex = (!this.context.isRtl || internal.getIsRtlScrollbarOnLeft()) ? chunksPerSection - 1 : 0;
let isVScrollSide = chunkIndex === sideScrollIndex;

@@ -509,7 +513,7 @@ let isLastSection = sectionIndex === sectionCnt - 1;

let allowXScrolling = colGroupStat && colGroupStat.allowXScrolling; // rename?
let allowYScrolling = getAllowYScrolling(this.props, sectionConfig); // rename? do in section func?
let chunkVGrow = getSectionHasLiquidHeight(this.props, sectionConfig); // do in section func?
let allowYScrolling = internal.getAllowYScrolling(this.props, sectionConfig); // rename? do in section func?
let chunkVGrow = internal.getSectionHasLiquidHeight(this.props, sectionConfig); // do in section func?
let expandRows = sectionConfig.expandRows && chunkVGrow;
let tableMinWidth = (colGroupStat && colGroupStat.totalColMinWidth) || '';
let content = renderChunkContent(sectionConfig, chunkConfig, {
let content = internal.renderChunkContent(sectionConfig, chunkConfig, {
tableColGroupNode: microColGroupNode,

@@ -532,4 +536,4 @@ tableMinWidth,

// but if these values were to change, the inner components would be unmounted/remounted because of the parent change.
content = (createElement(ClippedScroller, { ref: this.clippedScrollerRefs.createRef(index), scrollerElRef: this.scrollerElRefs.createRef(index), overflowX: overflowX, overflowY: overflowY, liquid: chunkVGrow, maxHeight: sectionConfig.maxHeight }, content));
return createElement(isHeader ? 'th' : 'td', {
content = (preact.createElement(ClippedScroller, { ref: this.clippedScrollerRefs.createRef(index), scrollerElRef: this.scrollerElRefs.createRef(index), overflowX: overflowX, overflowY: overflowY, liquid: chunkVGrow, maxHeight: sectionConfig.maxHeight }, content));
return preact.createElement(isHeader ? 'th' : 'td', {
key: chunkConfig.key,

@@ -541,5 +545,5 @@ ref: this.chunkElRefs.createRef(index),

componentDidMount() {
this.getStickyScrolling = memoizeArraylike(initStickyScrolling);
this.getScrollSyncersBySection = memoizeHashlike(initScrollSyncer.bind(this, true), null, destroyScrollSyncer);
this.getScrollSyncersByColumn = memoizeHashlike(initScrollSyncer.bind(this, false), null, destroyScrollSyncer);
this.getStickyScrolling = internal.memoizeArraylike(initStickyScrolling);
this.getScrollSyncersBySection = internal.memoizeHashlike(initScrollSyncer.bind(this, true), null, destroyScrollSyncer);
this.getScrollSyncersByColumn = internal.memoizeHashlike(initScrollSyncer.bind(this, false), null, destroyScrollSyncer);
this.updateScrollSyncers();

@@ -561,3 +565,3 @@ this.handleSizing(false);

if (!this.lastSizingDate ||
now.valueOf() > this.lastSizingDate.valueOf() + config.SCROLLGRID_RESIZE_INTERVAL) {
now.valueOf() > this.lastSizingDate.valueOf() + internal.config.SCROLLGRID_RESIZE_INTERVAL) {
this.lastSizingDate = now;

@@ -577,3 +581,3 @@ this.recentSizingCnt = 0;

let chunkEls = this.chunkElRefs.collect(i, cnt, chunksPerSection); // in one col
shrinkWidths[i] = computeShrinkWidth(chunkEls);
shrinkWidths[i] = internal.computeShrinkWidth(chunkEls);
}

@@ -599,3 +603,3 @@ });

if (chunkEl) {
rowHeights = findElements(chunkEl, '.fc-scrollgrid-sync-table tr').map((rowEl) => {
rowHeights = internal.findElements(chunkEl, '.fc-scrollgrid-sync-table tr').map((rowEl) => {
let max = getRowInnerMaxHeight(rowEl);

@@ -671,5 +675,5 @@ newHeightMap.set(rowEl, max);

computeScrollerDims() {
let scrollbarWidth = getScrollbarWidths();
let scrollbarWidth = internal.getScrollbarWidths();
let [sectionCnt, chunksPerSection] = this.getDims();
let sideScrollI = (!this.context.isRtl || getIsRtlScrollbarOnLeft()) ? chunksPerSection - 1 : 0;
let sideScrollI = (!this.context.isRtl || internal.getIsRtlScrollbarOnLeft()) ? chunksPerSection - 1 : 0;
let lastSectionI = sectionCnt - 1;

@@ -731,3 +735,3 @@ let currentScrollers = this.clippedScrollerRefs.currentMap;

let endIndex = startIndex + chunksPerSection;
scrollElsBySection[sectionI] = collectFromHash(scrollElMap, startIndex, endIndex, 1); // use the filtered
scrollElsBySection[sectionI] = internal.collectFromHash(scrollElMap, startIndex, endIndex, 1); // use the filtered
}

@@ -741,4 +745,4 @@ for (let col = 0; col < chunksPerSection; col += 1) {

destroyScrollSyncers() {
mapHash(this.scrollSyncersBySection, destroyScrollSyncer);
mapHash(this.scrollSyncersByColumn, destroyScrollSyncer);
internal.mapHash(this.scrollSyncersBySection, destroyScrollSyncer);
internal.mapHash(this.scrollSyncersByColumn, destroyScrollSyncer);
}

@@ -767,3 +771,3 @@ getChunkConfigByIndex(index) {

if (chunkConfig) { // null if section disappeared. bad, b/c won't null-set the elRef
setRef(chunkConfig.elRef, chunkEl);
internal.setRef(chunkConfig.elRef, chunkEl);
}

@@ -774,3 +778,3 @@ }

if (chunkConfig) { // null if section disappeared. bad, b/c won't null-set the elRef
setRef(chunkConfig.scrollerElRef, scrollerEl);
internal.setRef(chunkConfig.scrollerElRef, scrollerEl);
}

@@ -785,5 +789,5 @@ }

ScrollGrid.addStateEquality({
shrinkWidths: isArraysEqual,
scrollerClientWidths: isPropsEqual,
scrollerClientHeights: isPropsEqual,
shrinkWidths: internal.isArraysEqual,
scrollerClientWidths: internal.isPropsEqual,
scrollerClientHeights: internal.isPropsEqual,
});

@@ -798,3 +802,3 @@ function sumNumbers(numbers) {

function getRowInnerMaxHeight(rowEl) {
let innerHeights = findElements(rowEl, '.fc-scrollgrid-sync-inner').map(getElHeight);
let innerHeights = internal.findElements(rowEl, '.fc-scrollgrid-sync-inner').map(getElHeight);
if (innerHeights.length) {

@@ -812,8 +816,8 @@ return Math.max(...innerHeights);

if (width === 'shrink') {
width = colGroupStat.totalColWidth + sanitizeShrinkWidth(shrinkWidths[i]) + 1; // +1 for border :(
width = colGroupStat.totalColWidth + internal.sanitizeShrinkWidth(shrinkWidths[i]) + 1; // +1 for border :(
}
return ( // eslint-disable-next-line react/jsx-key
createElement("col", { style: { width } }));
preact.createElement("col", { style: { width } }));
});
return createElement('colgroup', {}, ...children);
return preact.createElement('colgroup', {}, ...children);
}

@@ -823,3 +827,3 @@ function compileColGroupStat(colGroupConfig) {

let totalColMinWidth = sumColProp(colGroupConfig.cols, 'minWidth');
let hasShrinkCol = hasShrinkWidth(colGroupConfig.cols);
let hasShrinkCol = internal.hasShrinkWidth(colGroupConfig.cols);
let allowXScrolling = colGroupConfig.width !== 'shrink' && Boolean(totalColWidth || totalColMinWidth || hasShrinkCol);

@@ -846,6 +850,6 @@ return {

const COL_GROUP_STAT_EQUALITY = {
cols: isColPropsEqual,
cols: internal.isColPropsEqual,
};
function isColGroupStatsEqual(stat0, stat1) {
return compareObjs(stat0, stat1, COL_GROUP_STAT_EQUALITY);
return internal.compareObjs(stat0, stat1, COL_GROUP_STAT_EQUALITY);
}

@@ -863,2 +867,2 @@ // for memoizers...

export { ScrollGrid };
exports.ScrollGrid = ScrollGrid;
{
"name": "@fullcalendar/scrollgrid",
"version": "6.0.2",
"version": "6.0.3",
"title": "FullCalendar ScrollGrid Plugin",
"description": "Tabular data chunked into scrollable panes",
"dependencies": {
"@fullcalendar/premium-common": "~6.0.2"
"@fullcalendar/premium-common": "~6.0.3"
},
"peerDependencies": {
"@fullcalendar/core": "~6.0.2"
"@fullcalendar/core": "~6.0.3"
},

@@ -35,5 +35,5 @@ "type": "module",

"copyright": "2022 Adam Shaw",
"main": "./index.cjs",
"module": "./index.js",
"types": "./index.d.ts",
"main": "./index.js",
"module": "./index.esm.js",
"unpkg": "./index.global.min.js",

@@ -43,15 +43,11 @@ "jsdelivr": "./index.global.min.js",

"./package.json": "./package.json",
"./index.cjs": "./index.cjs",
"./index.js": "./index.js",
".": {
"types": "./index.d.ts",
"require": "./index.cjs",
"import": "./index.js"
"require": "./index.js",
"import": "./index.esm.js"
},
"./internal.cjs": "./internal.cjs",
"./internal.js": "./internal.js",
"./internal": {
"types": "./internal.d.ts",
"require": "./internal.cjs",
"import": "./internal.js"
"require": "./internal.js",
"import": "./internal.esm.js"
}

@@ -58,0 +54,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc