@fullcalendar/timegrid
Advanced tools
Comparing version 6.1.0 to 6.1.1
/*! | ||
FullCalendar Time Grid Plugin v6.1.0 | ||
FullCalendar Time Grid Plugin v6.1.1 | ||
Docs & License: https://fullcalendar.io/docs/timegrid-view | ||
(c) 2022 Adam Shaw | ||
(c) 2023 Adam Shaw | ||
*/ | ||
FullCalendar.TimeGrid=function(e,t,i,r,n){"use strict";class o extends i.Splitter{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?["allDay"]:["timed"]}getKeysForEventDef(e){return e.allDay?i.hasBgRendering(e)?["timed","allDay"]:["allDay"]:["timed"]}}const s=i.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});function l(e){let t=["fc-timegrid-slot","fc-timegrid-slot-label",e.isLabeled?"fc-scrollgrid-shrink":"fc-timegrid-slot-minor"];return r.createElement(i.ViewContextType.Consumer,null,n=>{if(!e.isLabeled)return r.createElement("td",{className:t.join(" "),"data-time":e.isoTimeStr});let{dateEnv:o,options:l,viewApi:c}=n,d=null==l.slotLabelFormat?s:Array.isArray(l.slotLabelFormat)?i.createFormatter(l.slotLabelFormat[0]):i.createFormatter(l.slotLabelFormat),m={level:0,time:e.time,date:o.toDate(e.date),view:c,text:o.format(e.date,d)};return r.createElement(i.ContentContainer,{elTag:"td",elClasses:t,elAttrs:{"data-time":e.isoTimeStr},renderProps:m,generatorName:"slotLabelContent",customGenerator:l.slotLabelContent,defaultGenerator:a,classNameGenerator:l.slotLabelClassNames,didMount:l.slotLabelDidMount,willUnmount:l.slotLabelWillUnmount},e=>r.createElement("div",{className:"fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame"},r.createElement(e,{elTag:"div",elClasses:["fc-timegrid-slot-label-cushion","fc-scrollgrid-shrink-cushion"]})))})}function a(e){return e.text}class c extends i.BaseComponent{render(){return this.props.slatMetas.map(e=>r.createElement("tr",{key:e.key},r.createElement(l,Object.assign({},e))))}}const d=i.createFormatter({week:"short"});class m extends i.DateComponent{constructor(){super(...arguments),this.allDaySplitter=new o,this.headerElRef=r.createRef(),this.rootElRef=r.createRef(),this.scrollerElRef=r.createRef(),this.state={slatCoords:null},this.handleScrollTopRequest=e=>{let t=this.scrollerElRef.current;t&&(t.scrollTop=e)},this.renderHeadAxis=(e,t="")=>{let{options:n}=this.context,{dateProfile:o}=this.props,s=o.renderRange,l=1===i.diffDays(s.start,s.end)?i.buildNavLinkAttrs(this.context,s.start,"week"):{};return n.weekNumbers&&"day"===e?r.createElement(i.WeekNumberContainer,{elTag:"th",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},date:s.start,defaultFormat:d},e=>r.createElement("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame","fc-timegrid-axis-frame-liquid"].join(" "),style:{height:t}},r.createElement(e,{elTag:"a",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"],elAttrs:l}))):r.createElement("th",{"aria-hidden":!0,className:"fc-timegrid-axis"},r.createElement("div",{className:"fc-timegrid-axis-frame",style:{height:t}}))},this.renderTableRowAxis=e=>{let{options:t,viewApi:n}=this.context,o={text:t.allDayText,view:n};return r.createElement(i.ContentContainer,{elTag:"td",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},renderProps:o,generatorName:"allDayContent",customGenerator:t.allDayContent,defaultGenerator:f,classNameGenerator:t.allDayClassNames,didMount:t.allDayDidMount,willUnmount:t.allDayWillUnmount},t=>r.createElement("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame",null==e?" fc-timegrid-axis-frame-liquid":""].join(" "),style:{height:e}},r.createElement(t,{elTag:"span",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"]})))},this.handleSlatCoords=e=>{this.setState({slatCoords:e})}}renderSimpleLayout(e,t,n){let{context:o,props:s}=this,l=[],a=i.getStickyHeaderDates(o.options);return e&&l.push({type:"header",key:"header",isSticky:a,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),t&&(l.push({type:"body",key:"all-day",chunk:{content:t}}),l.push({type:"body",key:"all-day-divider",outerContent:r.createElement("tr",{role:"presentation",className:"fc-scrollgrid-section"},r.createElement("td",{className:"fc-timegrid-divider "+o.theme.getClass("tableCellShaded")}))})),l.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(o.options.expandRows),chunk:{scrollerElRef:this.scrollerElRef,content:n}}),r.createElement(i.ViewContainer,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:o.viewSpec},r.createElement(i.SimpleScrollGrid,{liquid:!s.isHeightAuto&&!s.forPrint,collapsibleWidth:s.forPrint,cols:[{width:"shrink"}],sections:l}))}renderHScrollLayout(e,t,n,o,s,l,a){let d=this.context.pluginHooks.scrollGridImpl;if(!d)throw new Error("No ScrollGrid implementation");let{context:m,props:f}=this,h=!f.forPrint&&i.getStickyHeaderDates(m.options),g=!f.forPrint&&i.getStickyFooterScrollbar(m.options),u=[];e&&u.push({type:"header",key:"header",isSticky:h,syncRowHeights:!0,chunks:[{key:"axis",rowContent:e=>r.createElement("tr",{role:"presentation"},this.renderHeadAxis("day",e.rowSyncHeights[0]))},{key:"cols",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),t&&(u.push({type:"body",key:"all-day",syncRowHeights:!0,chunks:[{key:"axis",rowContent:e=>r.createElement("tr",{role:"presentation"},this.renderTableRowAxis(e.rowSyncHeights[0]))},{key:"cols",content:t}]}),u.push({key:"all-day-divider",type:"body",outerContent:r.createElement("tr",{role:"presentation",className:"fc-scrollgrid-section"},r.createElement("td",{colSpan:2,className:"fc-timegrid-divider "+m.theme.getClass("tableCellShaded")}))}));let p=m.options.nowIndicator;return u.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(m.options.expandRows),chunks:[{key:"axis",content:e=>r.createElement("div",{className:"fc-timegrid-axis-chunk"},r.createElement("table",{"aria-hidden":!0,style:{height:e.expandRows?e.clientHeight:""}},e.tableColGroupNode,r.createElement("tbody",null,r.createElement(c,{slatMetas:l}))),r.createElement("div",{className:"fc-timegrid-now-indicator-container"},r.createElement(i.NowTimer,{unit:p?"minute":"day"},e=>{let t=p&&a&&a.safeComputeTop(e);return"number"==typeof t?r.createElement(i.NowIndicatorContainer,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:t},isAxis:!0,date:e}):null})))},{key:"cols",scrollerElRef:this.scrollerElRef,content:n}]}),g&&u.push({key:"footer",type:"footer",isSticky:!0,chunks:[{key:"axis",content:i.renderScrollShim},{key:"cols",content:i.renderScrollShim}]}),r.createElement(i.ViewContainer,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:m.viewSpec},r.createElement(d,{liquid:!f.isHeightAuto&&!f.forPrint,collapsibleWidth:!1,colGroups:[{width:"shrink",cols:[{width:"shrink"}]},{cols:[{span:o,minWidth:s}]}],sections:u}))}getAllDayMaxEventProps(){let{dayMaxEvents:e,dayMaxEventRows:t}=this.context.options;return!0!==e&&!0!==t||(e=void 0,t=5),{dayMaxEvents:e,dayMaxEventRows:t}}}function f(e){return e.text}class h{constructor(e,t,i){this.positions=e,this.dateProfile=t,this.slotDuration=i}safeComputeTop(e){let{dateProfile:t}=this;if(i.rangeContainsMarker(t.currentRange,e)){let r=i.startOfDay(e),n=e.valueOf()-r.valueOf();if(n>=i.asRoughMs(t.slotMinTime)&&n<i.asRoughMs(t.slotMaxTime))return this.computeTimeTop(i.createDuration(n))}return null}computeDateTop(e,t){return t||(t=i.startOfDay(e)),this.computeTimeTop(i.createDuration(e.valueOf()-t.valueOf()))}computeTimeTop(e){let t,r,{positions:n,dateProfile:o}=this,s=n.els.length,l=(e.milliseconds-i.asRoughMs(o.slotMinTime))/i.asRoughMs(this.slotDuration);return l=Math.max(0,l),l=Math.min(s,l),t=Math.floor(l),t=Math.min(t,s-1),r=l-t,n.tops[t]+n.getHeight(t)*r}}class g extends i.BaseComponent{render(){let{props:e,context:t}=this,{options:n}=t,{slatElRefs:o}=e;return r.createElement("tbody",null,e.slatMetas.map((s,a)=>{let c={time:s.time,date:t.dateEnv.toDate(s.date),view:t.viewApi};return r.createElement("tr",{key:s.key,ref:o.createRef(s.key)},e.axis&&r.createElement(l,Object.assign({},s)),r.createElement(i.ContentContainer,{elTag:"td",elClasses:["fc-timegrid-slot","fc-timegrid-slot-lane",!s.isLabeled&&"fc-timegrid-slot-minor"],elAttrs:{"data-time":s.isoTimeStr},renderProps:c,generatorName:"slotLaneContent",customGenerator:n.slotLaneContent,classNameGenerator:n.slotLaneClassNames,didMount:n.slotLaneDidMount,willUnmount:n.slotLaneWillUnmount}))}))}}class u extends i.BaseComponent{constructor(){super(...arguments),this.rootElRef=r.createRef(),this.slatElRefs=new i.RefMap}render(){let{props:e,context:t}=this;return r.createElement("div",{ref:this.rootElRef,className:"fc-timegrid-slots"},r.createElement("table",{"aria-hidden":!0,className:t.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth,height:e.minHeight}},e.tableColGroupNode,r.createElement(g,{slatElRefs:this.slatElRefs,axis:e.axis,slatMetas:e.slatMetas})))}componentDidMount(){this.updateSizing()}componentDidUpdate(){this.updateSizing()}componentWillUnmount(){this.props.onCoords&&this.props.onCoords(null)}updateSizing(){let{context:e,props:t}=this;if(t.onCoords&&null!==t.clientWidth){this.rootElRef.current.offsetHeight&&t.onCoords(new h(new i.PositionCache(this.rootElRef.current,(r=this.slatElRefs.currentMap,t.slatMetas.map(e=>r[e.key])),!1,!0),this.props.dateProfile,e.options.slotDuration))}var r}}function p(e,t){let i,r=[];for(i=0;i<t;i+=1)r.push([]);if(e)for(i=0;i<e.length;i+=1)r[e[i].col].push(e[i]);return r}function v(e,t){let i=[];if(e){for(let r=0;r<t;r+=1)i[r]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(let t of e.segs)i[t.col].segs.push(t)}else for(let e=0;e<t;e+=1)i[e]=null;return i}class b extends i.BaseComponent{render(){let{props:e}=this;return r.createElement(i.MoreLinkContainer,{elClasses:["fc-timegrid-more-link"],elStyle:{top:e.top,bottom:e.bottom},allDayDate:null,moreCnt:e.hiddenSegs.length,allSegs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,extraDateSpan:e.extraDateSpan,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>T(e.hiddenSegs,e),defaultGenerator:y},e=>r.createElement(e,{elTag:"div",elClasses:["fc-timegrid-more-link-inner","fc-sticky"]}))}}function y(e){return e.shortText}function x(e,t,r){let n=new i.SegHierarchy;null!=t&&(n.strictOrder=t),null!=r&&(n.maxStackCnt=r);let o=n.addSegs(e),s=i.groupIntersectingEntries(o),l=function(e){const{entriesByLevel:t}=e,r=w((e,t)=>e+":"+t,(n,o)=>{let s=S(function(e,t,r){let{levelCoords:n,entriesByLevel:o}=e,s=o[t][r],l=n[t]+s.thickness,a=n.length,c=t;for(;c<a&&n[c]<l;c+=1);for(;c<a;c+=1){let e,t=o[c],r=i.binarySearch(t,s.span.start,i.getEntrySpanEnd),n=r[0]+r[1],l=n;for(;(e=t[l])&&e.span.start<s.span.end;)l+=1;if(n<l)return{level:c,lateralStart:n,lateralEnd:l}}return null}(e,n,o),r),l=t[n][o];return[Object.assign(Object.assign({},l),{nextLevelNodes:s[0]}),l.thickness+s[1]]});return S(t.length?{level:0,lateralStart:0,lateralEnd:t[0].length}:null,r)[0]}(n);return l=function(e,t){const r=w((e,t,r)=>i.buildEntryKey(e),(e,i,n)=>{let o,{nextLevelNodes:s,thickness:l}=e,a=l+n,c=l/a,d=[];if(s.length)for(let e of s)if(void 0===o){let t=r(e,i,a);o=t[0],d.push(t[1])}else{let t=r(e,o,0);d.push(t[1])}else o=t;let m=(o-i)*c;return[o-m,Object.assign(Object.assign({},e),{thickness:m,nextLevelNodes:d})]});return e.map(e=>r(e,0,0)[1])}(l,1),{segRects:function(e){let t=[];const r=w((e,t,r)=>i.buildEntryKey(e),(e,i,r)=>{let o=Object.assign(Object.assign({},e),{levelCoord:i,stackDepth:r,stackForward:0});return t.push(o),o.stackForward=n(e.nextLevelNodes,i+e.thickness,r+1)+1});function n(e,t,i){let n=0;for(let o of e)n=Math.max(r(o,t,i),n);return n}return n(e,0,0),t}(l),hiddenGroups:s}}function S(e,t){if(!e)return[[],0];let{level:i,lateralStart:r,lateralEnd:n}=e,o=r,s=[];for(;o<n;)s.push(t(i,o)),o+=1;return s.sort(C),[s.map(E),s[0][1]]}function C(e,t){return t[1]-e[1]}function E(e){return e[0]}function w(e,t){const i={};return(...r)=>{let n=e(...r);return n in i?i[n]:i[n]=t(...r)}}function D(e,t,i=null,r=0){let n=[];if(i)for(let o=0;o<e.length;o+=1){let s=e[o],l=i.computeDateTop(s.start,t),a=Math.max(l+(r||0),i.computeDateTop(s.end,t));n.push({start:Math.round(l),end:Math.round(a)})}return n}const R=i.createFormatter({hour:"numeric",minute:"2-digit",meridiem:!1});class k extends i.BaseComponent{render(){return r.createElement(i.StandardEvent,Object.assign({},this.props,{elClasses:["fc-timegrid-event","fc-v-event",this.props.isShort&&"fc-timegrid-event-short"],defaultTimeFormat:R}))}}class M extends i.BaseComponent{constructor(){super(...arguments),this.sortEventSegs=i.memoize(i.sortEventSegs)}render(){let{props:e,context:t}=this,{options:n}=t,o=n.selectMirror,s=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||o&&e.dateSelectionSegs||[],l=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{},a=this.sortEventSegs(e.fgEventSegs,n.eventOrder);return r.createElement(i.DayCellContainer,{elTag:"td",elRef:e.elRef,elClasses:["fc-timegrid-col",...e.extraClassNames||[]],elAttrs:Object.assign({role:"gridcell"},e.extraDataAttrs),date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,extraRenderProps:e.extraRenderProps},t=>r.createElement("div",{className:"fc-timegrid-col-frame"},r.createElement("div",{className:"fc-timegrid-col-bg"},this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(e.dateSelectionSegs,"highlight")),r.createElement("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(a,l,!1,!1,!1)),r.createElement("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(s,{},Boolean(e.eventDrag),Boolean(e.eventResize),Boolean(o))),r.createElement("div",{className:"fc-timegrid-now-indicator-container"},this.renderNowIndicator(e.nowIndicatorSegs)),i.hasCustomDayCellContent(n)&&r.createElement(t,{elTag:"div",elClasses:["fc-timegrid-col-misc"]})))}renderFgSegs(e,t,i,r,n){let{props:o}=this;return o.forPrint?T(e,o):this.renderPositionedFgSegs(e,t,i,r,n)}renderPositionedFgSegs(e,t,n,o,s){let{eventMaxStack:l,eventShortHeight:a,eventOrderStrict:c,eventMinHeight:d}=this.context.options,{date:m,slatCoords:f,eventSelection:h,todayRange:g,nowDate:u}=this.props,p=n||o||s,v=D(e,m,f,d),{segPlacements:b,hiddenGroups:y}=function(e,t,i,r){let n=[],o=[];for(let i=0;i<e.length;i+=1){let r=t[i];r?n.push({index:i,thickness:1,span:r}):o.push(e[i])}let{segRects:s,hiddenGroups:l}=x(n,i,r),a=[];for(let t of s)a.push({seg:e[t.index],rect:t});for(let e of o)a.push({seg:e,rect:null});return{segPlacements:a,hiddenGroups:l}}(e,v,c,l);return r.createElement(r.Fragment,null,this.renderHiddenGroups(y,e),b.map(e=>{let{seg:l,rect:c}=e,d=l.eventRange.instance.instanceId,m=p||Boolean(!t[d]&&c),f=N(c&&c.span),v=!p&&c?this.computeSegHStyle(c):{left:0,right:0},b=Boolean(c)&&c.stackForward>0,y=Boolean(c)&&c.span.end-c.span.start<a;return r.createElement("div",{className:"fc-timegrid-event-harness"+(b?" fc-timegrid-event-harness-inset":""),key:d,style:Object.assign(Object.assign({visibility:m?"":"hidden"},f),v)},r.createElement(k,Object.assign({seg:l,isDragging:n,isResizing:o,isDateSelecting:s,isSelected:d===h,isShort:y},i.getSegMeta(l,g,u))))}))}renderHiddenGroups(e,t){let{extraDateSpan:n,dateProfile:o,todayRange:s,nowDate:l,eventSelection:a,eventDrag:c,eventResize:d}=this.props;return r.createElement(r.Fragment,null,e.map(e=>{let m=N(e.span),f=(h=e.entries,g=t,h.map(e=>g[e.index]));var h,g;return r.createElement(b,{key:i.buildIsoString(i.computeEarliestSegStart(f)),hiddenSegs:f,top:m.top,bottom:m.bottom,extraDateSpan:n,dateProfile:o,todayRange:s,nowDate:l,eventSelection:a,eventDrag:c,eventResize:d})}))}renderFillSegs(e,t){let{props:n,context:o}=this,s=D(e,n.date,n.slatCoords,o.options.eventMinHeight).map((o,s)=>{let l=e[s];return r.createElement("div",{key:i.buildEventRangeKey(l.eventRange),className:"fc-timegrid-bg-harness",style:N(o)},"bg-event"===t?r.createElement(i.BgEvent,Object.assign({seg:l},i.getSegMeta(l,n.todayRange,n.nowDate))):i.renderFill(t))});return r.createElement(r.Fragment,null,s)}renderNowIndicator(e){let{slatCoords:t,date:n}=this.props;return t?e.map((e,o)=>r.createElement(i.NowIndicatorContainer,{key:o,elClasses:["fc-timegrid-now-indicator-line"],elStyle:{top:t.computeDateTop(e.start,n)},isAxis:!1,date:n})):null}computeSegHStyle(e){let t,i,{isRtl:r,options:n}=this.context,o=n.slotEventOverlap,s=e.levelCoord,l=e.levelCoord+e.thickness;o&&(l=Math.min(1,s+2*(l-s))),r?(t=1-l,i=s):(t=s,i=1-l);let a={zIndex:e.stackDepth+1,left:100*t+"%",right:100*i+"%"};return o&&!e.stackForward&&(a[r?"marginLeft":"marginRight"]=20),a}}function T(e,{todayRange:t,nowDate:n,eventSelection:o,eventDrag:s,eventResize:l}){let a=(s?s.affectedInstances:null)||(l?l.affectedInstances:null)||{};return r.createElement(r.Fragment,null,e.map(e=>{let s=e.eventRange.instance.instanceId;return r.createElement("div",{key:s,style:{visibility:a[s]?"hidden":""}},r.createElement(k,Object.assign({seg:e,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:s===o,isShort:!1},i.getSegMeta(e,t,n))))}))}function N(e){return e?{top:e.start,bottom:-e.end}:{top:"",bottom:""}}class P extends i.BaseComponent{constructor(){super(...arguments),this.splitFgEventSegs=i.memoize(p),this.splitBgEventSegs=i.memoize(p),this.splitBusinessHourSegs=i.memoize(p),this.splitNowIndicatorSegs=i.memoize(p),this.splitDateSelectionSegs=i.memoize(p),this.splitEventDrag=i.memoize(v),this.splitEventResize=i.memoize(v),this.rootElRef=r.createRef(),this.cellElRefs=new i.RefMap}render(){let{props:e,context:t}=this,n=t.options.nowIndicator&&e.slatCoords&&e.slatCoords.safeComputeTop(e.nowDate),o=e.cells.length,s=this.splitFgEventSegs(e.fgEventSegs,o),l=this.splitBgEventSegs(e.bgEventSegs,o),a=this.splitBusinessHourSegs(e.businessHourSegs,o),c=this.splitNowIndicatorSegs(e.nowIndicatorSegs,o),d=this.splitDateSelectionSegs(e.dateSelectionSegs,o),m=this.splitEventDrag(e.eventDrag,o),f=this.splitEventResize(e.eventResize,o);return r.createElement("div",{className:"fc-timegrid-cols",ref:this.rootElRef},r.createElement("table",{role:"presentation",style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,r.createElement("tbody",{role:"presentation"},r.createElement("tr",{role:"row"},e.axis&&r.createElement("td",{"aria-hidden":!0,className:"fc-timegrid-col fc-timegrid-axis"},r.createElement("div",{className:"fc-timegrid-col-frame"},r.createElement("div",{className:"fc-timegrid-now-indicator-container"},"number"==typeof n&&r.createElement(i.NowIndicatorContainer,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:n},isAxis:!0,date:e.nowDate})))),e.cells.map((t,i)=>r.createElement(M,{key:t.key,elRef:this.cellElRefs.createRef(t.key),dateProfile:e.dateProfile,date:t.date,nowDate:e.nowDate,todayRange:e.todayRange,extraRenderProps:t.extraRenderProps,extraDataAttrs:t.extraDataAttrs,extraClassNames:t.extraClassNames,extraDateSpan:t.extraDateSpan,fgEventSegs:s[i],bgEventSegs:l[i],businessHourSegs:a[i],nowIndicatorSegs:c[i],dateSelectionSegs:d[i],eventDrag:m[i],eventResize:f[i],slatCoords:e.slatCoords,eventSelection:e.eventSelection,forPrint:e.forPrint}))))))}componentDidMount(){this.updateCoords()}componentDidUpdate(){this.updateCoords()}updateCoords(){let{props:e}=this;var t;e.onColCoords&&null!==e.clientWidth&&e.onColCoords(new i.PositionCache(this.rootElRef.current,(t=this.cellElRefs.currentMap,e.cells.map(e=>t[e.key])),!0,!1))}}class z extends i.DateComponent{constructor(){super(...arguments),this.processSlotOptions=i.memoize(H),this.state={slatCoords:null},this.handleRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)},this.handleScrollRequest=e=>{let{onScrollTopRequest:t}=this.props,{slatCoords:i}=this.state;if(t&&i){if(e.time){let r=i.computeTimeTop(e.time);r=Math.ceil(r),r&&(r+=1),t(r)}return!0}return!1},this.handleColCoords=e=>{this.colCoords=e},this.handleSlatCoords=e=>{this.setState({slatCoords:e}),this.props.onSlatCoords&&this.props.onSlatCoords(e)}}render(){let{props:e,state:t}=this;return r.createElement("div",{className:"fc-timegrid-body",ref:this.handleRootEl,style:{width:e.clientWidth,minWidth:e.tableMinWidth}},r.createElement(u,{axis:e.axis,dateProfile:e.dateProfile,slatMetas:e.slatMetas,clientWidth:e.clientWidth,minHeight:e.expandRows?e.clientHeight:"",tableMinWidth:e.tableMinWidth,tableColGroupNode:e.axis?e.tableColGroupNode:null,onCoords:this.handleSlatCoords}),r.createElement(P,{cells:e.cells,axis:e.axis,dateProfile:e.dateProfile,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,nowDate:e.nowDate,nowIndicatorSegs:e.nowIndicatorSegs,clientWidth:e.clientWidth,tableMinWidth:e.tableMinWidth,tableColGroupNode:e.tableColGroupNode,slatCoords:t.slatCoords,onColCoords:this.handleColCoords,forPrint:e.forPrint}))}componentDidMount(){this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)}componentDidUpdate(e){this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)}componentWillUnmount(){this.scrollResponder.detach()}queryHit(e,t){let{dateEnv:r,options:n}=this.context,{colCoords:o}=this,{dateProfile:s}=this.props,{slatCoords:l}=this.state,{snapDuration:a,snapsPerSlot:c}=this.processSlotOptions(this.props.slotDuration,n.snapDuration),d=o.leftToIndex(e),m=l.positions.topToIndex(t);if(null!=d&&null!=m){let e=this.props.cells[d],n=l.positions.tops[m],f=l.positions.getHeight(m),h=(t-n)/f,g=m*c+Math.floor(h*c),u=this.props.cells[d].date,p=i.addDurations(s.slotMinTime,i.multiplyDuration(a,g)),v=r.add(u,p),b=r.add(v,a);return{dateProfile:s,dateSpan:Object.assign({range:{start:v,end:b},allDay:!1},e.extraDateSpan),dayEl:o.els[d],rect:{left:o.lefts[d],right:o.rights[d],top:n,bottom:n+f},layer:0}}return null}}function H(e,t){let r=t||e,n=i.wholeDivideDurations(e,r);return null===n&&(r=e,n=1),{snapDuration:r,snapsPerSlot:n}}class W extends i.Slicer{sliceRange(e,t){let r=[];for(let n=0;n<t.length;n+=1){let o=i.intersectRanges(e,t[n]);o&&r.push({start:o.start,end:o.end,isStart:o.start.valueOf()===e.start.valueOf(),isEnd:o.end.valueOf()===e.end.valueOf(),col:n})}return r}}class G extends i.DateComponent{constructor(){super(...arguments),this.buildDayRanges=i.memoize(I),this.slicer=new W,this.timeColsRef=r.createRef()}render(){let{props:e,context:t}=this,{dateProfile:n,dayTableModel:o}=e,{nowIndicator:s,nextDayThreshold:l}=t.options,a=this.buildDayRanges(o,n,t.dateEnv);return r.createElement(i.NowTimer,{unit:s?"minute":"day"},(i,c)=>r.createElement(z,Object.assign({ref:this.timeColsRef},this.slicer.sliceProps(e,n,null,t,a),{forPrint:e.forPrint,axis:e.axis,dateProfile:n,slatMetas:e.slatMetas,slotDuration:e.slotDuration,cells:o.cells[0],tableColGroupNode:e.tableColGroupNode,tableMinWidth:e.tableMinWidth,clientWidth:e.clientWidth,clientHeight:e.clientHeight,expandRows:e.expandRows,nowDate:i,nowIndicatorSegs:s&&this.slicer.sliceNowDate(i,n,l,t,a),todayRange:c,onScrollTopRequest:e.onScrollTopRequest,onSlatCoords:e.onSlatCoords})))}}function I(e,t,i){let r=[];for(let n of e.headerDates)r.push({start:i.add(n,t.slotMinTime),end:i.add(n,t.slotMaxTime)});return r}const F=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function O(e,t,r,n,o){let s=new Date(0),l=e,a=i.createDuration(0),c=r||function(e){let t,r,n;for(t=F.length-1;t>=0;t-=1)if(r=i.createDuration(F[t]),n=i.wholeDivideDurations(r,e),null!==n&&n>1)return r;return e}(n),d=[];for(;i.asRoughMs(l)<i.asRoughMs(t);){let e=o.add(s,l),t=null!==i.wholeDivideDurations(a,c);d.push({date:e,time:l,key:e.toISOString(),isoTimeStr:i.formatIsoTimeString(e),isLabeled:t}),l=i.addDurations(l,n),a=i.addDurations(a,n)}return d}class L extends m{constructor(){super(...arguments),this.buildTimeColsModel=i.memoize(A),this.buildSlatMetas=i.memoize(O)}render(){let{options:e,dateEnv:t,dateProfileGenerator:o}=this.context,{props:s}=this,{dateProfile:l}=s,a=this.buildTimeColsModel(l,o),c=this.allDaySplitter.splitProps(s),d=this.buildSlatMetas(l.slotMinTime,l.slotMaxTime,e.slotLabelInterval,e.slotDuration,t),{dayMinWidth:m}=e,f=!m,h=m,g=e.dayHeaders&&r.createElement(i.DayHeader,{dates:a.headerDates,dateProfile:l,datesRepDistinctDays:!0,renderIntro:f?this.renderHeadAxis:null}),u=!1!==e.allDaySlot&&(t=>r.createElement(n.DayTable,Object.assign({},c.allDay,{dateProfile:l,dayTableModel:a,nextDayThreshold:e.nextDayThreshold,tableMinWidth:t.tableMinWidth,colGroupNode:t.tableColGroupNode,renderRowIntro:f?this.renderTableRowAxis:null,showWeekNumbers:!1,expandRows:!1,headerAlignElRef:this.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:s.forPrint},this.getAllDayMaxEventProps()))),p=t=>r.createElement(G,Object.assign({},c.timed,{dayTableModel:a,dateProfile:l,axis:f,slotDuration:e.slotDuration,slatMetas:d,forPrint:s.forPrint,tableColGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,clientWidth:t.clientWidth,clientHeight:t.clientHeight,onSlatCoords:this.handleSlatCoords,expandRows:t.expandRows,onScrollTopRequest:this.handleScrollTopRequest}));return h?this.renderHScrollLayout(g,u,p,a.colCnt,m,d,this.state.slatCoords):this.renderSimpleLayout(g,u,p)}}function A(e,t){let r=new i.DaySeriesModel(e.renderRange,t);return new i.DayTableModel(r,!1)}const j={allDaySlot:Boolean};i.injectStyles('.fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:"\\00a0"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:"\\00a0-\\00a0"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}');var B=t.createPlugin({name:"@fullcalendar/timegrid",initialView:"timeGridWeek",optionRefiners:j,views:{timeGrid:{component:L,usesMinMaxTime:!0,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}}),q={__proto__:null,TimeColsView:m,DayTimeColsView:L,buildTimeColsModel:A,DayTimeCols:G,buildDayRanges:I,DayTimeColsSlicer:W,TimeCols:z,buildSlatMetas:O,TimeColsSlatsCoords:h};return t.globalPlugins.push(B),e.Internal=q,e.default=B,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.Internal,FullCalendar.Preact,FullCalendar.DayGrid.Internal); |
22
index.js
@@ -1,11 +0,7 @@ | ||
'use strict'; | ||
import { createPlugin } from '@fullcalendar/core'; | ||
import { DayTimeColsView } from './internal.js'; | ||
import { injectStyles } from '@fullcalendar/core/internal'; | ||
import '@fullcalendar/core/preact'; | ||
import '@fullcalendar/daygrid/internal'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var core = require('@fullcalendar/core'); | ||
var internalCommon = require('./internal.js'); | ||
var internal = require('@fullcalendar/core/internal'); | ||
require('@fullcalendar/core/preact'); | ||
require('@fullcalendar/daygrid/internal'); | ||
const OPTION_REFINERS = { | ||
@@ -16,5 +12,5 @@ allDaySlot: Boolean, | ||
var css_248z = ".fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:\"\\00a0\"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:\"\\00a0-\\00a0\"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}"; | ||
internal.injectStyles(css_248z); | ||
injectStyles(css_248z); | ||
var index = core.createPlugin({ | ||
var index = createPlugin({ | ||
name: '@fullcalendar/timegrid', | ||
@@ -25,3 +21,3 @@ initialView: 'timeGridWeek', | ||
timeGrid: { | ||
component: internalCommon.DayTimeColsView, | ||
component: DayTimeColsView, | ||
usesMinMaxTime: true, | ||
@@ -43,2 +39,2 @@ allDaySlot: true, | ||
exports["default"] = index; | ||
export { index as default }; |
320
internal.js
@@ -1,10 +0,6 @@ | ||
'use strict'; | ||
import { Splitter, hasBgRendering, createFormatter, ViewContextType, ContentContainer, BaseComponent, DateComponent, diffDays, buildNavLinkAttrs, WeekNumberContainer, getStickyHeaderDates, ViewContainer, SimpleScrollGrid, getStickyFooterScrollbar, NowTimer, NowIndicatorContainer, renderScrollShim, rangeContainsMarker, startOfDay, asRoughMs, createDuration, RefMap, PositionCache, MoreLinkContainer, SegHierarchy, groupIntersectingEntries, binarySearch, getEntrySpanEnd, buildEntryKey, StandardEvent, memoize, sortEventSegs, DayCellContainer, hasCustomDayCellContent, getSegMeta, buildIsoString, computeEarliestSegStart, buildEventRangeKey, BgEvent, renderFill, addDurations, multiplyDuration, wholeDivideDurations, Slicer, intersectRanges, formatIsoTimeString, DayHeader, DaySeriesModel, DayTableModel } from '@fullcalendar/core/internal'; | ||
import { createElement, createRef, Fragment } from '@fullcalendar/core/preact'; | ||
import { DayTable } from '@fullcalendar/daygrid/internal'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var internal = require('@fullcalendar/core/internal'); | ||
var preact = require('@fullcalendar/core/preact'); | ||
var internal$1 = require('@fullcalendar/daygrid/internal'); | ||
class AllDaySplitter extends internal.Splitter { | ||
class AllDaySplitter extends Splitter { | ||
getKeyInfo() { | ||
@@ -26,3 +22,3 @@ return { | ||
} | ||
if (internal.hasBgRendering(eventDef)) { | ||
if (hasBgRendering(eventDef)) { | ||
return ['timed', 'allDay']; | ||
@@ -34,3 +30,3 @@ } | ||
const DEFAULT_SLAT_LABEL_FORMAT = internal.createFormatter({ | ||
const DEFAULT_SLAT_LABEL_FORMAT = createFormatter({ | ||
hour: 'numeric', | ||
@@ -47,5 +43,5 @@ minute: '2-digit', | ||
]; | ||
return (preact.createElement(internal.ViewContextType.Consumer, null, (context) => { | ||
return (createElement(ViewContextType.Consumer, null, (context) => { | ||
if (!props.isLabeled) { | ||
return (preact.createElement("td", { className: classNames.join(' '), "data-time": props.isoTimeStr })); | ||
return (createElement("td", { className: classNames.join(' '), "data-time": props.isoTimeStr })); | ||
} | ||
@@ -55,4 +51,4 @@ let { dateEnv, options, viewApi } = context; | ||
options.slotLabelFormat == null ? DEFAULT_SLAT_LABEL_FORMAT : | ||
Array.isArray(options.slotLabelFormat) ? internal.createFormatter(options.slotLabelFormat[0]) : | ||
internal.createFormatter(options.slotLabelFormat); | ||
Array.isArray(options.slotLabelFormat) ? createFormatter(options.slotLabelFormat[0]) : | ||
createFormatter(options.slotLabelFormat); | ||
let renderProps = { | ||
@@ -65,6 +61,6 @@ level: 0, | ||
}; | ||
return (preact.createElement(internal.ContentContainer, { elTag: "td", elClasses: classNames, elAttrs: { | ||
return (createElement(ContentContainer, { elTag: "td", elClasses: classNames, elAttrs: { | ||
'data-time': props.isoTimeStr, | ||
}, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (preact.createElement("div", { className: "fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame" }, | ||
preact.createElement(InnerContent, { elTag: "div", elClasses: [ | ||
}, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (createElement("div", { className: "fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame" }, | ||
createElement(InnerContent, { elTag: "div", elClasses: [ | ||
'fc-timegrid-slot-label-cushion', | ||
@@ -79,18 +75,18 @@ 'fc-scrollgrid-shrink-cushion', | ||
class TimeBodyAxis extends internal.BaseComponent { | ||
class TimeBodyAxis extends BaseComponent { | ||
render() { | ||
return this.props.slatMetas.map((slatMeta) => (preact.createElement("tr", { key: slatMeta.key }, | ||
preact.createElement(TimeColsAxisCell, Object.assign({}, slatMeta))))); | ||
return this.props.slatMetas.map((slatMeta) => (createElement("tr", { key: slatMeta.key }, | ||
createElement(TimeColsAxisCell, Object.assign({}, slatMeta))))); | ||
} | ||
} | ||
const DEFAULT_WEEK_NUM_FORMAT = internal.createFormatter({ week: 'short' }); | ||
const DEFAULT_WEEK_NUM_FORMAT = createFormatter({ week: 'short' }); | ||
const AUTO_ALL_DAY_MAX_EVENT_ROWS = 5; | ||
class TimeColsView extends internal.DateComponent { | ||
class TimeColsView extends DateComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.allDaySplitter = new AllDaySplitter(); // for use by subclasses | ||
this.headerElRef = preact.createRef(); | ||
this.rootElRef = preact.createRef(); | ||
this.scrollerElRef = preact.createRef(); | ||
this.headerElRef = createRef(); | ||
this.rootElRef = createRef(); | ||
this.scrollerElRef = createRef(); | ||
this.state = { | ||
@@ -111,9 +107,9 @@ slatCoords: null, | ||
let range = dateProfile.renderRange; | ||
let dayCnt = internal.diffDays(range.start, range.end); | ||
let dayCnt = diffDays(range.start, range.end); | ||
// only do in day views (to avoid doing in week views that dont need it) | ||
let navLinkAttrs = (dayCnt === 1) | ||
? internal.buildNavLinkAttrs(this.context, range.start, 'week') | ||
? buildNavLinkAttrs(this.context, range.start, 'week') | ||
: {}; | ||
if (options.weekNumbers && rowKey === 'day') { | ||
return (preact.createElement(internal.WeekNumberContainer, { elTag: "th", elClasses: [ | ||
return (createElement(WeekNumberContainer, { elTag: "th", elClasses: [ | ||
'fc-timegrid-axis', | ||
@@ -123,3 +119,3 @@ 'fc-scrollgrid-shrink', | ||
'aria-hidden': true, | ||
}, date: range.start, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, (InnerContent) => (preact.createElement("div", { className: [ | ||
}, date: range.start, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, (InnerContent) => (createElement("div", { className: [ | ||
'fc-timegrid-axis-frame', | ||
@@ -129,3 +125,3 @@ 'fc-scrollgrid-shrink-frame', | ||
].join(' '), style: { height: frameHeight } }, | ||
preact.createElement(InnerContent, { elTag: "a", elClasses: [ | ||
createElement(InnerContent, { elTag: "a", elClasses: [ | ||
'fc-timegrid-axis-cushion', | ||
@@ -136,4 +132,4 @@ 'fc-scrollgrid-shrink-cushion', | ||
} | ||
return (preact.createElement("th", { "aria-hidden": true, className: "fc-timegrid-axis" }, | ||
preact.createElement("div", { className: "fc-timegrid-axis-frame", style: { height: frameHeight } }))); | ||
return (createElement("th", { "aria-hidden": true, className: "fc-timegrid-axis" }, | ||
createElement("div", { className: "fc-timegrid-axis-frame", style: { height: frameHeight } }))); | ||
}; | ||
@@ -152,3 +148,3 @@ /* Table Component Render Methods | ||
// TODO: make reusable hook. used in list view too | ||
preact.createElement(internal.ContentContainer, { elTag: "td", elClasses: [ | ||
createElement(ContentContainer, { elTag: "td", elClasses: [ | ||
'fc-timegrid-axis', | ||
@@ -158,3 +154,3 @@ 'fc-scrollgrid-shrink', | ||
'aria-hidden': true, | ||
}, renderProps: renderProps, generatorName: "allDayContent", customGenerator: options.allDayContent, defaultGenerator: renderAllDayInner, classNameGenerator: options.allDayClassNames, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, (InnerContent) => (preact.createElement("div", { className: [ | ||
}, renderProps: renderProps, generatorName: "allDayContent", customGenerator: options.allDayContent, defaultGenerator: renderAllDayInner, classNameGenerator: options.allDayClassNames, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, (InnerContent) => (createElement("div", { className: [ | ||
'fc-timegrid-axis-frame', | ||
@@ -164,3 +160,3 @@ 'fc-scrollgrid-shrink-frame', | ||
].join(' '), style: { height: rowHeight } }, | ||
preact.createElement(InnerContent, { elTag: "span", elClasses: [ | ||
createElement(InnerContent, { elTag: "span", elClasses: [ | ||
'fc-timegrid-axis-cushion', | ||
@@ -180,3 +176,3 @@ 'fc-scrollgrid-shrink-cushion', | ||
let sections = []; | ||
let stickyHeaderDates = internal.getStickyHeaderDates(context.options); | ||
let stickyHeaderDates = getStickyHeaderDates(context.options); | ||
if (headerRowContent) { | ||
@@ -204,4 +200,4 @@ sections.push({ | ||
outerContent: ( // TODO: rename to cellContent so don't need to define <tr>? | ||
preact.createElement("tr", { role: "presentation", className: "fc-scrollgrid-section" }, | ||
preact.createElement("td", { className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))), | ||
createElement("tr", { role: "presentation", className: "fc-scrollgrid-section" }, | ||
createElement("td", { className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))), | ||
}); | ||
@@ -219,4 +215,4 @@ } | ||
}); | ||
return (preact.createElement(internal.ViewContainer, { elRef: this.rootElRef, elClasses: ['fc-timegrid'], viewSpec: context.viewSpec }, | ||
preact.createElement(internal.SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [{ width: 'shrink' }], sections: sections }))); | ||
return (createElement(ViewContainer, { elRef: this.rootElRef, elClasses: ['fc-timegrid'], viewSpec: context.viewSpec }, | ||
createElement(SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [{ width: 'shrink' }], sections: sections }))); | ||
} | ||
@@ -229,4 +225,4 @@ renderHScrollLayout(headerRowContent, allDayContent, timeContent, colCnt, dayMinWidth, slatMetas, slatCoords) { | ||
let { context, props } = this; | ||
let stickyHeaderDates = !props.forPrint && internal.getStickyHeaderDates(context.options); | ||
let stickyFooterScrollbar = !props.forPrint && internal.getStickyFooterScrollbar(context.options); | ||
let stickyHeaderDates = !props.forPrint && getStickyHeaderDates(context.options); | ||
let stickyFooterScrollbar = !props.forPrint && getStickyFooterScrollbar(context.options); | ||
let sections = []; | ||
@@ -242,3 +238,3 @@ if (headerRowContent) { | ||
key: 'axis', | ||
rowContent: (arg) => (preact.createElement("tr", { role: "presentation" }, this.renderHeadAxis('day', arg.rowSyncHeights[0]))), | ||
rowContent: (arg) => (createElement("tr", { role: "presentation" }, this.renderHeadAxis('day', arg.rowSyncHeights[0]))), | ||
}, | ||
@@ -262,3 +258,3 @@ { | ||
key: 'axis', | ||
rowContent: (contentArg) => (preact.createElement("tr", { role: "presentation" }, this.renderTableRowAxis(contentArg.rowSyncHeights[0]))), | ||
rowContent: (contentArg) => (createElement("tr", { role: "presentation" }, this.renderTableRowAxis(contentArg.rowSyncHeights[0]))), | ||
}, | ||
@@ -275,4 +271,4 @@ { | ||
outerContent: ( // TODO: rename to cellContent so don't need to define <tr>? | ||
preact.createElement("tr", { role: "presentation", className: "fc-scrollgrid-section" }, | ||
preact.createElement("td", { colSpan: 2, className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))), | ||
createElement("tr", { role: "presentation", className: "fc-scrollgrid-section" }, | ||
createElement("td", { colSpan: 2, className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))), | ||
}); | ||
@@ -291,9 +287,9 @@ } | ||
// TODO: make this now-indicator arrow more DRY with TimeColsContent | ||
preact.createElement("div", { className: "fc-timegrid-axis-chunk" }, | ||
preact.createElement("table", { "aria-hidden": true, style: { height: arg.expandRows ? arg.clientHeight : '' } }, | ||
createElement("div", { className: "fc-timegrid-axis-chunk" }, | ||
createElement("table", { "aria-hidden": true, style: { height: arg.expandRows ? arg.clientHeight : '' } }, | ||
arg.tableColGroupNode, | ||
preact.createElement("tbody", null, | ||
preact.createElement(TimeBodyAxis, { slatMetas: slatMetas }))), | ||
preact.createElement("div", { className: "fc-timegrid-now-indicator-container" }, | ||
preact.createElement(internal.NowTimer, { unit: isNowIndicator ? 'minute' : 'day' /* hacky */ }, (nowDate) => { | ||
createElement("tbody", null, | ||
createElement(TimeBodyAxis, { slatMetas: slatMetas }))), | ||
createElement("div", { className: "fc-timegrid-now-indicator-container" }, | ||
createElement(NowTimer, { unit: isNowIndicator ? 'minute' : 'day' /* hacky */ }, (nowDate) => { | ||
let nowIndicatorTop = isNowIndicator && | ||
@@ -303,3 +299,3 @@ slatCoords && | ||
if (typeof nowIndicatorTop === 'number') { | ||
return (preact.createElement(internal.NowIndicatorContainer, { elClasses: ['fc-timegrid-now-indicator-arrow'], elStyle: { top: nowIndicatorTop }, isAxis: true, date: nowDate })); | ||
return (createElement(NowIndicatorContainer, { elClasses: ['fc-timegrid-now-indicator-arrow'], elStyle: { top: nowIndicatorTop }, isAxis: true, date: nowDate })); | ||
} | ||
@@ -324,7 +320,7 @@ return null; | ||
key: 'axis', | ||
content: internal.renderScrollShim, | ||
content: renderScrollShim, | ||
}, | ||
{ | ||
key: 'cols', | ||
content: internal.renderScrollShim, | ||
content: renderScrollShim, | ||
}, | ||
@@ -334,4 +330,4 @@ ], | ||
} | ||
return (preact.createElement(internal.ViewContainer, { elRef: this.rootElRef, elClasses: ['fc-timegrid'], viewSpec: context.viewSpec }, | ||
preact.createElement(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: false, colGroups: [ | ||
return (createElement(ViewContainer, { elRef: this.rootElRef, elClasses: ['fc-timegrid'], viewSpec: context.viewSpec }, | ||
createElement(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: false, colGroups: [ | ||
{ width: 'shrink', cols: [{ width: 'shrink' }] }, | ||
@@ -364,8 +360,8 @@ { cols: [{ span: colCnt, minWidth: dayMinWidth }] }, | ||
let { dateProfile } = this; | ||
if (internal.rangeContainsMarker(dateProfile.currentRange, date)) { | ||
let startOfDayDate = internal.startOfDay(date); | ||
if (rangeContainsMarker(dateProfile.currentRange, date)) { | ||
let startOfDayDate = startOfDay(date); | ||
let timeMs = date.valueOf() - startOfDayDate.valueOf(); | ||
if (timeMs >= internal.asRoughMs(dateProfile.slotMinTime) && | ||
timeMs < internal.asRoughMs(dateProfile.slotMaxTime)) { | ||
return this.computeTimeTop(internal.createDuration(timeMs)); | ||
if (timeMs >= asRoughMs(dateProfile.slotMinTime) && | ||
timeMs < asRoughMs(dateProfile.slotMaxTime)) { | ||
return this.computeTimeTop(createDuration(timeMs)); | ||
} | ||
@@ -379,5 +375,5 @@ } | ||
if (!startOfDayDate) { | ||
startOfDayDate = internal.startOfDay(when); | ||
startOfDayDate = startOfDay(when); | ||
} | ||
return this.computeTimeTop(internal.createDuration(when.valueOf() - startOfDayDate.valueOf())); | ||
return this.computeTimeTop(createDuration(when.valueOf() - startOfDayDate.valueOf())); | ||
} | ||
@@ -391,3 +387,3 @@ // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration). | ||
// floating-point value of # of slots covered | ||
let slatCoverage = (duration.milliseconds - internal.asRoughMs(dateProfile.slotMinTime)) / internal.asRoughMs(this.slotDuration); | ||
let slatCoverage = (duration.milliseconds - asRoughMs(dateProfile.slotMinTime)) / asRoughMs(this.slotDuration); | ||
let slatIndex; | ||
@@ -412,3 +408,3 @@ let slatRemainder; | ||
class TimeColsSlatsBody extends internal.BaseComponent { | ||
class TimeColsSlatsBody extends BaseComponent { | ||
render() { | ||
@@ -418,3 +414,3 @@ let { props, context } = this; | ||
let { slatElRefs } = props; | ||
return (preact.createElement("tbody", null, props.slatMetas.map((slatMeta, i) => { | ||
return (createElement("tbody", null, props.slatMetas.map((slatMeta, i) => { | ||
let renderProps = { | ||
@@ -425,5 +421,5 @@ time: slatMeta.time, | ||
}; | ||
return (preact.createElement("tr", { key: slatMeta.key, ref: slatElRefs.createRef(slatMeta.key) }, | ||
props.axis && (preact.createElement(TimeColsAxisCell, Object.assign({}, slatMeta))), | ||
preact.createElement(internal.ContentContainer, { elTag: "td", elClasses: [ | ||
return (createElement("tr", { key: slatMeta.key, ref: slatElRefs.createRef(slatMeta.key) }, | ||
props.axis && (createElement(TimeColsAxisCell, Object.assign({}, slatMeta))), | ||
createElement(ContentContainer, { elTag: "td", elClasses: [ | ||
'fc-timegrid-slot', | ||
@@ -442,12 +438,12 @@ 'fc-timegrid-slot-lane', | ||
*/ | ||
class TimeColsSlats extends internal.BaseComponent { | ||
class TimeColsSlats extends BaseComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.rootElRef = preact.createRef(); | ||
this.slatElRefs = new internal.RefMap(); | ||
this.rootElRef = createRef(); | ||
this.slatElRefs = new RefMap(); | ||
} | ||
render() { | ||
let { props, context } = this; | ||
return (preact.createElement("div", { ref: this.rootElRef, className: "fc-timegrid-slots" }, | ||
preact.createElement("table", { "aria-hidden": true, className: context.theme.getClass('table'), style: { | ||
return (createElement("div", { ref: this.rootElRef, className: "fc-timegrid-slots" }, | ||
createElement("table", { "aria-hidden": true, className: context.theme.getClass('table'), style: { | ||
minWidth: props.tableMinWidth, | ||
@@ -458,3 +454,3 @@ width: props.clientWidth, | ||
props.tableColGroupNode /* relies on there only being a single <col> for the axis */, | ||
preact.createElement(TimeColsSlatsBody, { slatElRefs: this.slatElRefs, axis: props.axis, slatMetas: props.slatMetas })))); | ||
createElement(TimeColsSlatsBody, { slatElRefs: this.slatElRefs, axis: props.axis, slatMetas: props.slatMetas })))); | ||
} | ||
@@ -479,3 +475,3 @@ componentDidMount() { | ||
if (rootEl.offsetHeight) { // not hidden by css | ||
props.onCoords(new TimeColsSlatsCoords(new internal.PositionCache(this.rootElRef.current, collectSlatEls(this.slatElRefs.currentMap, props.slatMetas), false, true), this.props.dateProfile, context.options.slotDuration)); | ||
props.onCoords(new TimeColsSlatsCoords(new PositionCache(this.rootElRef.current, collectSlatEls(this.slatElRefs.currentMap, props.slatMetas), false, true), this.props.dateProfile, context.options.slotDuration)); | ||
} | ||
@@ -524,9 +520,9 @@ } | ||
class TimeColMoreLink extends internal.BaseComponent { | ||
class TimeColMoreLink extends BaseComponent { | ||
render() { | ||
let { props } = this; | ||
return (preact.createElement(internal.MoreLinkContainer, { elClasses: ['fc-timegrid-more-link'], elStyle: { | ||
return (createElement(MoreLinkContainer, { elClasses: ['fc-timegrid-more-link'], elStyle: { | ||
top: props.top, | ||
bottom: props.bottom, | ||
}, allDayDate: null, moreCnt: props.hiddenSegs.length, allSegs: props.hiddenSegs, hiddenSegs: props.hiddenSegs, extraDateSpan: props.extraDateSpan, dateProfile: props.dateProfile, todayRange: props.todayRange, popoverContent: () => renderPlainFgSegs(props.hiddenSegs, props), defaultGenerator: renderMoreLinkInner }, (InnerContent) => (preact.createElement(InnerContent, { elTag: "div", elClasses: ['fc-timegrid-more-link-inner', 'fc-sticky'] })))); | ||
}, allDayDate: null, moreCnt: props.hiddenSegs.length, allSegs: props.hiddenSegs, hiddenSegs: props.hiddenSegs, extraDateSpan: props.extraDateSpan, dateProfile: props.dateProfile, todayRange: props.todayRange, popoverContent: () => renderPlainFgSegs(props.hiddenSegs, props), defaultGenerator: renderMoreLinkInner }, (InnerContent) => (createElement(InnerContent, { elTag: "div", elClasses: ['fc-timegrid-more-link-inner', 'fc-sticky'] })))); | ||
} | ||
@@ -540,3 +536,3 @@ } | ||
function buildPositioning(segInputs, strictOrder, maxStackCnt) { | ||
let hierarchy = new internal.SegHierarchy(); | ||
let hierarchy = new SegHierarchy(); | ||
if (strictOrder != null) { | ||
@@ -549,3 +545,3 @@ hierarchy.strictOrder = strictOrder; | ||
let hiddenEntries = hierarchy.addSegs(segInputs); | ||
let hiddenGroups = internal.groupIntersectingEntries(hiddenEntries); | ||
let hiddenGroups = groupIntersectingEntries(hiddenEntries); | ||
let web = buildWeb(hierarchy); | ||
@@ -606,3 +602,3 @@ web = stretchWeb(web, 1); // all levelCoords/thickness will have 0.0-1.0 | ||
let entry; | ||
let searchIndex = internal.binarySearch(entries, subjectEntry.span.start, internal.getEntrySpanEnd); | ||
let searchIndex = binarySearch(entries, subjectEntry.span.start, getEntrySpanEnd); | ||
let lateralStart = searchIndex[0] + searchIndex[1]; // if exact match (which doesn't collide), go to next one | ||
@@ -622,3 +618,3 @@ let lateralEnd = lateralStart; | ||
function stretchWeb(topLevelNodes, totalThickness) { | ||
const stretchNode = cacheable((node, startCoord, prevThickness) => internal.buildEntryKey(node), (node, startCoord, prevThickness) => { | ||
const stretchNode = cacheable((node, startCoord, prevThickness) => buildEntryKey(node), (node, startCoord, prevThickness) => { | ||
let { nextLevelNodes, thickness } = node; | ||
@@ -653,3 +649,3 @@ let allThickness = thickness + prevThickness; | ||
let rects = []; | ||
const processNode = cacheable((node, levelCoord, stackDepth) => internal.buildEntryKey(node), (node, levelCoord, stackDepth) => { | ||
const processNode = cacheable((node, levelCoord, stackDepth) => buildEntryKey(node), (node, levelCoord, stackDepth) => { | ||
let rect = Object.assign(Object.assign({}, node), { levelCoord, | ||
@@ -728,3 +724,3 @@ stackDepth, stackForward: 0 }); | ||
const DEFAULT_TIME_FORMAT = internal.createFormatter({ | ||
const DEFAULT_TIME_FORMAT = createFormatter({ | ||
hour: 'numeric', | ||
@@ -734,5 +730,5 @@ minute: '2-digit', | ||
}); | ||
class TimeColEvent extends internal.BaseComponent { | ||
class TimeColEvent extends BaseComponent { | ||
render() { | ||
return (preact.createElement(internal.StandardEvent, Object.assign({}, this.props, { elClasses: [ | ||
return (createElement(StandardEvent, Object.assign({}, this.props, { elClasses: [ | ||
'fc-timegrid-event', | ||
@@ -745,6 +741,6 @@ 'fc-v-event', | ||
class TimeCol extends internal.BaseComponent { | ||
class TimeCol extends BaseComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.sortEventSegs = internal.memoize(internal.sortEventSegs); | ||
this.sortEventSegs = memoize(sortEventSegs); | ||
} | ||
@@ -766,14 +762,14 @@ // TODO: memoize event-placement? | ||
let sortedFgSegs = this.sortEventSegs(props.fgEventSegs, options.eventOrder); | ||
return (preact.createElement(internal.DayCellContainer, { elTag: "td", elRef: props.elRef, elClasses: [ | ||
return (createElement(DayCellContainer, { elTag: "td", elRef: props.elRef, elClasses: [ | ||
'fc-timegrid-col', | ||
...(props.extraClassNames || []), | ||
], elAttrs: Object.assign({ role: 'gridcell' }, props.extraDataAttrs), date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, extraRenderProps: props.extraRenderProps }, (InnerContent) => (preact.createElement("div", { className: "fc-timegrid-col-frame" }, | ||
preact.createElement("div", { className: "fc-timegrid-col-bg" }, | ||
], elAttrs: Object.assign({ role: 'gridcell' }, props.extraDataAttrs), date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, extraRenderProps: props.extraRenderProps }, (InnerContent) => (createElement("div", { className: "fc-timegrid-col-frame" }, | ||
createElement("div", { className: "fc-timegrid-col-bg" }, | ||
this.renderFillSegs(props.businessHourSegs, 'non-business'), | ||
this.renderFillSegs(props.bgEventSegs, 'bg-event'), | ||
this.renderFillSegs(props.dateSelectionSegs, 'highlight')), | ||
preact.createElement("div", { className: "fc-timegrid-col-events" }, this.renderFgSegs(sortedFgSegs, interactionAffectedInstances, false, false, false)), | ||
preact.createElement("div", { className: "fc-timegrid-col-events" }, this.renderFgSegs(mirrorSegs, {}, Boolean(props.eventDrag), Boolean(props.eventResize), Boolean(isSelectMirror))), | ||
preact.createElement("div", { className: "fc-timegrid-now-indicator-container" }, this.renderNowIndicator(props.nowIndicatorSegs)), | ||
internal.hasCustomDayCellContent(options) && (preact.createElement(InnerContent, { elTag: "div", elClasses: ['fc-timegrid-col-misc'] })))))); | ||
createElement("div", { className: "fc-timegrid-col-events" }, this.renderFgSegs(sortedFgSegs, interactionAffectedInstances, false, false, false)), | ||
createElement("div", { className: "fc-timegrid-col-events" }, this.renderFgSegs(mirrorSegs, {}, Boolean(props.eventDrag), Boolean(props.eventResize), Boolean(isSelectMirror))), | ||
createElement("div", { className: "fc-timegrid-now-indicator-container" }, this.renderNowIndicator(props.nowIndicatorSegs)), | ||
hasCustomDayCellContent(options) && (createElement(InnerContent, { elTag: "div", elClasses: ['fc-timegrid-col-misc'] })))))); | ||
} | ||
@@ -794,3 +790,3 @@ renderFgSegs(sortedFgSegs, segIsInvisible, isDragging, isResizing, isDateSelecting) { | ||
let { segPlacements, hiddenGroups } = computeFgSegPlacements(segs, segVCoords, eventOrderStrict, eventMaxStack); | ||
return (preact.createElement(preact.Fragment, null, | ||
return (createElement(Fragment, null, | ||
this.renderHiddenGroups(hiddenGroups, segs), | ||
@@ -805,5 +801,5 @@ segPlacements.map((segPlacement) => { | ||
let isShort = Boolean(rect) && (rect.span.end - rect.span.start) < eventShortHeight; // look at other places for this problem | ||
return (preact.createElement("div", { className: 'fc-timegrid-event-harness' + | ||
return (createElement("div", { className: 'fc-timegrid-event-harness' + | ||
(isInset ? ' fc-timegrid-event-harness-inset' : ''), key: instanceId, style: Object.assign(Object.assign({ visibility: isVisible ? '' : 'hidden' }, vStyle), hStyle) }, | ||
preact.createElement(TimeColEvent, Object.assign({ seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === eventSelection, isShort: isShort }, internal.getSegMeta(seg, todayRange, nowDate))))); | ||
createElement(TimeColEvent, Object.assign({ seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === eventSelection, isShort: isShort }, getSegMeta(seg, todayRange, nowDate))))); | ||
}))); | ||
@@ -814,6 +810,6 @@ } | ||
let { extraDateSpan, dateProfile, todayRange, nowDate, eventSelection, eventDrag, eventResize } = this.props; | ||
return (preact.createElement(preact.Fragment, null, hiddenGroups.map((hiddenGroup) => { | ||
return (createElement(Fragment, null, hiddenGroups.map((hiddenGroup) => { | ||
let positionCss = computeSegVStyle(hiddenGroup.span); | ||
let hiddenSegs = compileSegsFromEntries(hiddenGroup.entries, segs); | ||
return (preact.createElement(TimeColMoreLink, { key: internal.buildIsoString(internal.computeEarliestSegStart(hiddenSegs)), hiddenSegs: hiddenSegs, top: positionCss.top, bottom: positionCss.bottom, extraDateSpan: extraDateSpan, dateProfile: dateProfile, todayRange: todayRange, nowDate: nowDate, eventSelection: eventSelection, eventDrag: eventDrag, eventResize: eventResize })); | ||
return (createElement(TimeColMoreLink, { key: buildIsoString(computeEarliestSegStart(hiddenSegs)), hiddenSegs: hiddenSegs, top: positionCss.top, bottom: positionCss.bottom, extraDateSpan: extraDateSpan, dateProfile: dateProfile, todayRange: todayRange, nowDate: nowDate, eventSelection: eventSelection, eventDrag: eventDrag, eventResize: eventResize })); | ||
}))); | ||
@@ -826,7 +822,7 @@ } | ||
let seg = segs[i]; | ||
return (preact.createElement("div", { key: internal.buildEventRangeKey(seg.eventRange), className: "fc-timegrid-bg-harness", style: computeSegVStyle(vcoords) }, fillType === 'bg-event' ? | ||
preact.createElement(internal.BgEvent, Object.assign({ seg: seg }, internal.getSegMeta(seg, props.todayRange, props.nowDate))) : | ||
internal.renderFill(fillType))); | ||
return (createElement("div", { key: buildEventRangeKey(seg.eventRange), className: "fc-timegrid-bg-harness", style: computeSegVStyle(vcoords) }, fillType === 'bg-event' ? | ||
createElement(BgEvent, Object.assign({ seg: seg }, getSegMeta(seg, props.todayRange, props.nowDate))) : | ||
renderFill(fillType))); | ||
}); | ||
return preact.createElement(preact.Fragment, null, children); | ||
return createElement(Fragment, null, children); | ||
} | ||
@@ -838,3 +834,3 @@ renderNowIndicator(segs) { | ||
} | ||
return segs.map((seg, i) => (preact.createElement(internal.NowIndicatorContainer | ||
return segs.map((seg, i) => (createElement(NowIndicatorContainer | ||
// key doesn't matter. will only ever be one | ||
@@ -882,6 +878,6 @@ , { | ||
{}; | ||
return (preact.createElement(preact.Fragment, null, sortedFgSegs.map((seg) => { | ||
return (createElement(Fragment, null, sortedFgSegs.map((seg) => { | ||
let instanceId = seg.eventRange.instance.instanceId; | ||
return (preact.createElement("div", { key: instanceId, style: { visibility: hiddenInstances[instanceId] ? 'hidden' : '' } }, | ||
preact.createElement(TimeColEvent, Object.assign({ seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === eventSelection, isShort: false }, internal.getSegMeta(seg, todayRange, nowDate))))); | ||
return (createElement("div", { key: instanceId, style: { visibility: hiddenInstances[instanceId] ? 'hidden' : '' } }, | ||
createElement(TimeColEvent, Object.assign({ seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === eventSelection, isShort: false }, getSegMeta(seg, todayRange, nowDate))))); | ||
}))); | ||
@@ -902,14 +898,14 @@ } | ||
class TimeColsContent extends internal.BaseComponent { | ||
class TimeColsContent extends BaseComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.splitFgEventSegs = internal.memoize(splitSegsByCol); | ||
this.splitBgEventSegs = internal.memoize(splitSegsByCol); | ||
this.splitBusinessHourSegs = internal.memoize(splitSegsByCol); | ||
this.splitNowIndicatorSegs = internal.memoize(splitSegsByCol); | ||
this.splitDateSelectionSegs = internal.memoize(splitSegsByCol); | ||
this.splitEventDrag = internal.memoize(splitInteractionByCol); | ||
this.splitEventResize = internal.memoize(splitInteractionByCol); | ||
this.rootElRef = preact.createRef(); | ||
this.cellElRefs = new internal.RefMap(); | ||
this.splitFgEventSegs = memoize(splitSegsByCol); | ||
this.splitBgEventSegs = memoize(splitSegsByCol); | ||
this.splitBusinessHourSegs = memoize(splitSegsByCol); | ||
this.splitNowIndicatorSegs = memoize(splitSegsByCol); | ||
this.splitDateSelectionSegs = memoize(splitSegsByCol); | ||
this.splitEventDrag = memoize(splitInteractionByCol); | ||
this.splitEventResize = memoize(splitInteractionByCol); | ||
this.rootElRef = createRef(); | ||
this.cellElRefs = new RefMap(); | ||
} | ||
@@ -929,4 +925,4 @@ render() { | ||
let eventResizeByRow = this.splitEventResize(props.eventResize, colCnt); | ||
return (preact.createElement("div", { className: "fc-timegrid-cols", ref: this.rootElRef }, | ||
preact.createElement("table", { role: "presentation", style: { | ||
return (createElement("div", { className: "fc-timegrid-cols", ref: this.rootElRef }, | ||
createElement("table", { role: "presentation", style: { | ||
minWidth: props.tableMinWidth, | ||
@@ -936,8 +932,8 @@ width: props.clientWidth, | ||
props.tableColGroupNode, | ||
preact.createElement("tbody", { role: "presentation" }, | ||
preact.createElement("tr", { role: "row" }, | ||
props.axis && (preact.createElement("td", { "aria-hidden": true, className: "fc-timegrid-col fc-timegrid-axis" }, | ||
preact.createElement("div", { className: "fc-timegrid-col-frame" }, | ||
preact.createElement("div", { className: "fc-timegrid-now-indicator-container" }, typeof nowIndicatorTop === 'number' && (preact.createElement(internal.NowIndicatorContainer, { elClasses: ['fc-timegrid-now-indicator-arrow'], elStyle: { top: nowIndicatorTop }, isAxis: true, date: props.nowDate })))))), | ||
props.cells.map((cell, i) => (preact.createElement(TimeCol, { key: cell.key, elRef: this.cellElRefs.createRef(cell.key), dateProfile: props.dateProfile, date: cell.date, nowDate: props.nowDate, todayRange: props.todayRange, extraRenderProps: cell.extraRenderProps, extraDataAttrs: cell.extraDataAttrs, extraClassNames: cell.extraClassNames, extraDateSpan: cell.extraDateSpan, fgEventSegs: fgEventSegsByRow[i], bgEventSegs: bgEventSegsByRow[i], businessHourSegs: businessHourSegsByRow[i], nowIndicatorSegs: nowIndicatorSegsByRow[i], dateSelectionSegs: dateSelectionSegsByRow[i], eventDrag: eventDragByRow[i], eventResize: eventResizeByRow[i], slatCoords: props.slatCoords, eventSelection: props.eventSelection, forPrint: props.forPrint })))))))); | ||
createElement("tbody", { role: "presentation" }, | ||
createElement("tr", { role: "row" }, | ||
props.axis && (createElement("td", { "aria-hidden": true, className: "fc-timegrid-col fc-timegrid-axis" }, | ||
createElement("div", { className: "fc-timegrid-col-frame" }, | ||
createElement("div", { className: "fc-timegrid-now-indicator-container" }, typeof nowIndicatorTop === 'number' && (createElement(NowIndicatorContainer, { elClasses: ['fc-timegrid-now-indicator-arrow'], elStyle: { top: nowIndicatorTop }, isAxis: true, date: props.nowDate })))))), | ||
props.cells.map((cell, i) => (createElement(TimeCol, { key: cell.key, elRef: this.cellElRefs.createRef(cell.key), dateProfile: props.dateProfile, date: cell.date, nowDate: props.nowDate, todayRange: props.todayRange, extraRenderProps: cell.extraRenderProps, extraDataAttrs: cell.extraDataAttrs, extraClassNames: cell.extraClassNames, extraDateSpan: cell.extraDateSpan, fgEventSegs: fgEventSegsByRow[i], bgEventSegs: bgEventSegsByRow[i], businessHourSegs: businessHourSegsByRow[i], nowIndicatorSegs: nowIndicatorSegsByRow[i], dateSelectionSegs: dateSelectionSegsByRow[i], eventDrag: eventDragByRow[i], eventResize: eventResizeByRow[i], slatCoords: props.slatCoords, eventSelection: props.eventSelection, forPrint: props.forPrint })))))))); | ||
} | ||
@@ -955,3 +951,3 @@ componentDidMount() { | ||
) { | ||
props.onColCoords(new internal.PositionCache(this.rootElRef.current, collectCellEls(this.cellElRefs.currentMap, props.cells), true, // horizontal | ||
props.onColCoords(new PositionCache(this.rootElRef.current, collectCellEls(this.cellElRefs.currentMap, props.cells), true, // horizontal | ||
false)); | ||
@@ -967,6 +963,6 @@ } | ||
----------------------------------------------------------------------------------------------------------------------*/ | ||
class TimeCols extends internal.DateComponent { | ||
class TimeCols extends DateComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.processSlotOptions = internal.memoize(processSlotOptions); | ||
this.processSlotOptions = memoize(processSlotOptions); | ||
this.state = { | ||
@@ -1014,3 +1010,3 @@ slatCoords: null, | ||
let { props, state } = this; | ||
return (preact.createElement("div", { className: "fc-timegrid-body", ref: this.handleRootEl, style: { | ||
return (createElement("div", { className: "fc-timegrid-body", ref: this.handleRootEl, style: { | ||
// these props are important to give this wrapper correct dimensions for interactions | ||
@@ -1021,4 +1017,4 @@ // TODO: if we set it here, can we avoid giving to inner tables? | ||
} }, | ||
preact.createElement(TimeColsSlats, { axis: props.axis, dateProfile: props.dateProfile, slatMetas: props.slatMetas, clientWidth: props.clientWidth, minHeight: props.expandRows ? props.clientHeight : '', tableMinWidth: props.tableMinWidth, tableColGroupNode: props.axis ? props.tableColGroupNode : null /* axis depends on the colgroup's shrinking */, onCoords: this.handleSlatCoords }), | ||
preact.createElement(TimeColsContent, { cells: props.cells, axis: props.axis, dateProfile: props.dateProfile, businessHourSegs: props.businessHourSegs, bgEventSegs: props.bgEventSegs, fgEventSegs: props.fgEventSegs, dateSelectionSegs: props.dateSelectionSegs, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange, nowDate: props.nowDate, nowIndicatorSegs: props.nowIndicatorSegs, clientWidth: props.clientWidth, tableMinWidth: props.tableMinWidth, tableColGroupNode: props.tableColGroupNode, slatCoords: state.slatCoords, onColCoords: this.handleColCoords, forPrint: props.forPrint }))); | ||
createElement(TimeColsSlats, { axis: props.axis, dateProfile: props.dateProfile, slatMetas: props.slatMetas, clientWidth: props.clientWidth, minHeight: props.expandRows ? props.clientHeight : '', tableMinWidth: props.tableMinWidth, tableColGroupNode: props.axis ? props.tableColGroupNode : null /* axis depends on the colgroup's shrinking */, onCoords: this.handleSlatCoords }), | ||
createElement(TimeColsContent, { cells: props.cells, axis: props.axis, dateProfile: props.dateProfile, businessHourSegs: props.businessHourSegs, bgEventSegs: props.bgEventSegs, fgEventSegs: props.fgEventSegs, dateSelectionSegs: props.dateSelectionSegs, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange, nowDate: props.nowDate, nowIndicatorSegs: props.nowIndicatorSegs, clientWidth: props.clientWidth, tableMinWidth: props.tableMinWidth, tableColGroupNode: props.tableColGroupNode, slatCoords: state.slatCoords, onColCoords: this.handleColCoords, forPrint: props.forPrint }))); | ||
} | ||
@@ -1050,3 +1046,3 @@ componentDidMount() { | ||
let dayDate = this.props.cells[colIndex].date; | ||
let time = internal.addDurations(dateProfile.slotMinTime, internal.multiplyDuration(snapDuration, snapIndex)); | ||
let time = addDurations(dateProfile.slotMinTime, multiplyDuration(snapDuration, snapIndex)); | ||
let start = dateEnv.add(dayDate, time); | ||
@@ -1072,3 +1068,3 @@ let end = dateEnv.add(start, snapDuration); | ||
let snapDuration = snapDurationOverride || slotDuration; | ||
let snapsPerSlot = internal.wholeDivideDurations(slotDuration, snapDuration); | ||
let snapsPerSlot = wholeDivideDurations(slotDuration, snapDuration); | ||
if (snapsPerSlot === null) { | ||
@@ -1082,7 +1078,7 @@ snapDuration = slotDuration; | ||
class DayTimeColsSlicer extends internal.Slicer { | ||
class DayTimeColsSlicer extends Slicer { | ||
sliceRange(range, dayRanges) { | ||
let segs = []; | ||
for (let col = 0; col < dayRanges.length; col += 1) { | ||
let segRange = internal.intersectRanges(range, dayRanges[col]); | ||
let segRange = intersectRanges(range, dayRanges[col]); | ||
if (segRange) { | ||
@@ -1102,8 +1098,8 @@ segs.push({ | ||
class DayTimeCols extends internal.DateComponent { | ||
class DayTimeCols extends DateComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.buildDayRanges = internal.memoize(buildDayRanges); | ||
this.buildDayRanges = memoize(buildDayRanges); | ||
this.slicer = new DayTimeColsSlicer(); | ||
this.timeColsRef = preact.createRef(); | ||
this.timeColsRef = createRef(); | ||
} | ||
@@ -1117,3 +1113,3 @@ render() { | ||
// TODO: would move this further down hierarchy, but sliceNowDate needs it | ||
return (preact.createElement(internal.NowTimer, { unit: nowIndicator ? 'minute' : 'day' }, (nowDate, todayRange) => (preact.createElement(TimeCols, Object.assign({ ref: this.timeColsRef }, this.slicer.sliceProps(props, dateProfile, null, context, dayRanges), { forPrint: props.forPrint, axis: props.axis, dateProfile: dateProfile, slatMetas: props.slatMetas, slotDuration: props.slotDuration, cells: dayTableModel.cells[0], tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, clientWidth: props.clientWidth, clientHeight: props.clientHeight, expandRows: props.expandRows, nowDate: nowDate, nowIndicatorSegs: nowIndicator && this.slicer.sliceNowDate(nowDate, dateProfile, nextDayThreshold, context, dayRanges), todayRange: todayRange, onScrollTopRequest: props.onScrollTopRequest, onSlatCoords: props.onSlatCoords }))))); | ||
return (createElement(NowTimer, { unit: nowIndicator ? 'minute' : 'day' }, (nowDate, todayRange) => (createElement(TimeCols, Object.assign({ ref: this.timeColsRef }, this.slicer.sliceProps(props, dateProfile, null, context, dayRanges), { forPrint: props.forPrint, axis: props.axis, dateProfile: dateProfile, slatMetas: props.slatMetas, slotDuration: props.slotDuration, cells: dayTableModel.cells[0], tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, clientWidth: props.clientWidth, clientHeight: props.clientHeight, expandRows: props.expandRows, nowDate: nowDate, nowIndicatorSegs: nowIndicator && this.slicer.sliceNowDate(nowDate, dateProfile, nextDayThreshold, context, dayRanges), todayRange: todayRange, onScrollTopRequest: props.onScrollTopRequest, onSlatCoords: props.onSlatCoords }))))); | ||
} | ||
@@ -1144,8 +1140,8 @@ } | ||
let slatTime = slotMinTime; | ||
let slatIterator = internal.createDuration(0); | ||
let slatIterator = createDuration(0); | ||
let labelInterval = explicitLabelInterval || computeLabelInterval(slotDuration); | ||
let metas = []; | ||
while (internal.asRoughMs(slatTime) < internal.asRoughMs(slotMaxTime)) { | ||
while (asRoughMs(slatTime) < asRoughMs(slotMaxTime)) { | ||
let date = dateEnv.add(dayStart, slatTime); | ||
let isLabeled = internal.wholeDivideDurations(slatIterator, labelInterval) !== null; | ||
let isLabeled = wholeDivideDurations(slatIterator, labelInterval) !== null; | ||
metas.push({ | ||
@@ -1155,7 +1151,7 @@ date, | ||
key: date.toISOString(), | ||
isoTimeStr: internal.formatIsoTimeString(date), | ||
isoTimeStr: formatIsoTimeString(date), | ||
isLabeled, | ||
}); | ||
slatTime = internal.addDurations(slatTime, slotDuration); | ||
slatIterator = internal.addDurations(slatIterator, slotDuration); | ||
slatTime = addDurations(slatTime, slotDuration); | ||
slatIterator = addDurations(slatIterator, slotDuration); | ||
} | ||
@@ -1171,4 +1167,4 @@ return metas; | ||
for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) { | ||
labelInterval = internal.createDuration(STOCK_SUB_DURATIONS[i]); | ||
slotsPerLabel = internal.wholeDivideDurations(labelInterval, slotDuration); | ||
labelInterval = createDuration(STOCK_SUB_DURATIONS[i]); | ||
slotsPerLabel = wholeDivideDurations(labelInterval, slotDuration); | ||
if (slotsPerLabel !== null && slotsPerLabel > 1) { | ||
@@ -1184,4 +1180,4 @@ return labelInterval; | ||
super(...arguments); | ||
this.buildTimeColsModel = internal.memoize(buildTimeColsModel); | ||
this.buildSlatMetas = internal.memoize(buildSlatMetas); | ||
this.buildTimeColsModel = memoize(buildTimeColsModel); | ||
this.buildSlatMetas = memoize(buildSlatMetas); | ||
} | ||
@@ -1198,5 +1194,5 @@ render() { | ||
let hasDetachedAxis = dayMinWidth; | ||
let headerContent = options.dayHeaders && (preact.createElement(internal.DayHeader, { dates: dayTableModel.headerDates, dateProfile: dateProfile, datesRepDistinctDays: true, renderIntro: hasAttachedAxis ? this.renderHeadAxis : null })); | ||
let allDayContent = (options.allDaySlot !== false) && ((contentArg) => (preact.createElement(internal$1.DayTable, Object.assign({}, splitProps.allDay, { dateProfile: dateProfile, dayTableModel: dayTableModel, nextDayThreshold: options.nextDayThreshold, tableMinWidth: contentArg.tableMinWidth, colGroupNode: contentArg.tableColGroupNode, renderRowIntro: hasAttachedAxis ? this.renderTableRowAxis : null, showWeekNumbers: false, expandRows: false, headerAlignElRef: this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }, this.getAllDayMaxEventProps())))); | ||
let timeGridContent = (contentArg) => (preact.createElement(DayTimeCols, Object.assign({}, splitProps.timed, { dayTableModel: dayTableModel, dateProfile: dateProfile, axis: hasAttachedAxis, slotDuration: options.slotDuration, slatMetas: slatMetas, forPrint: props.forPrint, tableColGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, onSlatCoords: this.handleSlatCoords, expandRows: contentArg.expandRows, onScrollTopRequest: this.handleScrollTopRequest }))); | ||
let headerContent = options.dayHeaders && (createElement(DayHeader, { dates: dayTableModel.headerDates, dateProfile: dateProfile, datesRepDistinctDays: true, renderIntro: hasAttachedAxis ? this.renderHeadAxis : null })); | ||
let allDayContent = (options.allDaySlot !== false) && ((contentArg) => (createElement(DayTable, Object.assign({}, splitProps.allDay, { dateProfile: dateProfile, dayTableModel: dayTableModel, nextDayThreshold: options.nextDayThreshold, tableMinWidth: contentArg.tableMinWidth, colGroupNode: contentArg.tableColGroupNode, renderRowIntro: hasAttachedAxis ? this.renderTableRowAxis : null, showWeekNumbers: false, expandRows: false, headerAlignElRef: this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }, this.getAllDayMaxEventProps())))); | ||
let timeGridContent = (contentArg) => (createElement(DayTimeCols, Object.assign({}, splitProps.timed, { dayTableModel: dayTableModel, dateProfile: dateProfile, axis: hasAttachedAxis, slotDuration: options.slotDuration, slatMetas: slatMetas, forPrint: props.forPrint, tableColGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, onSlatCoords: this.handleSlatCoords, expandRows: contentArg.expandRows, onScrollTopRequest: this.handleScrollTopRequest }))); | ||
return hasDetachedAxis | ||
@@ -1208,14 +1204,6 @@ ? this.renderHScrollLayout(headerContent, allDayContent, timeGridContent, dayTableModel.colCnt, dayMinWidth, slatMetas, this.state.slatCoords) | ||
function buildTimeColsModel(dateProfile, dateProfileGenerator) { | ||
let daySeries = new internal.DaySeriesModel(dateProfile.renderRange, dateProfileGenerator); | ||
return new internal.DayTableModel(daySeries, false); | ||
let daySeries = new DaySeriesModel(dateProfile.renderRange, dateProfileGenerator); | ||
return new DayTableModel(daySeries, false); | ||
} | ||
exports.DayTimeCols = DayTimeCols; | ||
exports.DayTimeColsSlicer = DayTimeColsSlicer; | ||
exports.DayTimeColsView = DayTimeColsView; | ||
exports.TimeCols = TimeCols; | ||
exports.TimeColsSlatsCoords = TimeColsSlatsCoords; | ||
exports.TimeColsView = TimeColsView; | ||
exports.buildDayRanges = buildDayRanges; | ||
exports.buildSlatMetas = buildSlatMetas; | ||
exports.buildTimeColsModel = buildTimeColsModel; | ||
export { DayTimeCols, DayTimeColsSlicer, DayTimeColsView, TimeCols, TimeColsSlatsCoords, TimeColsView, buildDayRanges, buildSlatMetas, buildTimeColsModel }; |
{ | ||
"name": "@fullcalendar/timegrid", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"title": "FullCalendar Time Grid Plugin", | ||
@@ -16,6 +16,6 @@ "description": "Display events on time slots", | ||
"dependencies": { | ||
"@fullcalendar/daygrid": "~6.1.0" | ||
"@fullcalendar/daygrid": "~6.1.1" | ||
}, | ||
"peerDependencies": { | ||
"@fullcalendar/core": "~6.1.0" | ||
"@fullcalendar/core": "~6.1.1" | ||
}, | ||
@@ -35,6 +35,6 @@ "type": "module", | ||
}, | ||
"copyright": "2022 Adam Shaw", | ||
"copyright": "2023 Adam Shaw", | ||
"types": "./index.d.ts", | ||
"main": "./index.js", | ||
"module": "./index.esm.js", | ||
"main": "./index.cjs", | ||
"module": "./index.js", | ||
"unpkg": "./index.global.min.js", | ||
@@ -44,11 +44,13 @@ "jsdelivr": "./index.global.min.js", | ||
"./package.json": "./package.json", | ||
"./index.cjs": "./index.cjs", | ||
".": { | ||
"types": "./index.d.ts", | ||
"require": "./index.js", | ||
"import": "./index.esm.js" | ||
"require": "./index.cjs", | ||
"import": "./index.js" | ||
}, | ||
"./internal.cjs": "./internal.cjs", | ||
"./internal": { | ||
"types": "./internal.d.ts", | ||
"require": "./internal.js", | ||
"import": "./internal.esm.js" | ||
"require": "./internal.cjs", | ||
"import": "./internal.js" | ||
} | ||
@@ -55,0 +57,0 @@ }, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
236406
Updated@fullcalendar/daygrid@~6.1.1