@fullcalendar/list 6.0.0-beta.3 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,32 @@
1
1
 
2
2
  # FullCalendar List View Plugin
3
3
 
4
- View your events as a bulleted list
4
+ Display events on a calendar view that looks like a bulleted list
5
5
 
6
- [View the docs »](https://fullcalendar.io/docs/list-view)
6
+ ## Installation
7
7
 
8
- This package was created from the [FullCalendar monorepo »](https://github.com/fullcalendar/fullcalendar)
8
+ Install the necessary packages:
9
+
10
+ ```sh
11
+ npm install @fullcalendar/core @fullcalendar/list
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ Instantiate a Calendar with the necessary plugin:
17
+
18
+ ```js
19
+ import { Calendar } from '@fullcalendar/core'
20
+ import listPlugin from '@fullcalendar/list'
21
+
22
+ const calendarEl = document.getElementById('calendar')
23
+ const calendar = new Calendar(calendarEl, {
24
+ plugins: [listPlugin],
25
+ initialView: 'listWeek',
26
+ events: [
27
+ { title: 'Meeting', start: new Date() }
28
+ ]
29
+ })
30
+
31
+ calendar.render()
32
+ ```
package/index.cjs CHANGED
@@ -20,7 +20,7 @@ function createFalsableFormatter(input) {
20
20
  return input === false ? null : internal_cjs.createFormatter(input);
21
21
  }
22
22
 
23
- var css_248z = "\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n\n.fc-theme-standard .fc-list {\n border: 1px solid var(--fc-border-color);\n }\n\n.fc {\n\n /* message when no events */\n\n}\n\n.fc .fc-list-empty {\n background-color: var(--fc-neutral-bg-color);\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: var(--fc-page-bg-color); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table's border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: \"\";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: var(--fc-neutral-bg-color);\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: var(--fc-list-event-hover-bg-color);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: calc(var(--fc-list-event-dot-width) / 2) solid var(--fc-event-border-color);\n border-radius: calc(var(--fc-list-event-dot-width) / 2);\n }\n.fc {\n\n /* reset <a> styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n";
23
+ var css_248z = ":root{--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-theme-standard .fc-list{border:1px solid var(--fc-border-color)}.fc .fc-list-empty{align-items:center;background-color:var(--fc-neutral-bg-color);display:flex;height:100%;justify-content:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{border-style:hidden;width:100%}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{background:var(--fc-page-bg-color);position:sticky;top:0}.fc .fc-list-table thead{left:-10000px;position:absolute}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{clear:both;content:\"\";display:table}.fc-theme-standard .fc-list-day-cushion{background-color:var(--fc-neutral-bg-color)}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:var(--fc-list-event-hover-bg-color)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{border:calc(var(--fc-list-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-list-event-dot-width)/2);box-sizing:content-box;display:inline-block;height:0;width:0}.fc .fc-list-event-title a{color:inherit;text-decoration:none}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}";
24
24
  internal_cjs.injectStyles(css_248z);
25
25
 
26
26
  var index = index_cjs.createPlugin({
package/index.global.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- FullCalendar List View Plugin v6.0.0-beta.3
3
- Docs & License: https://fullcalendar.io/
2
+ FullCalendar List View Plugin v6.0.0
3
+ Docs & License: https://fullcalendar.io/docs/list-view
4
4
  (c) 2022 Adam Shaw
5
5
  */
6
6
  FullCalendar.List = (function (exports, internal$1, core, preact) {
@@ -279,7 +279,7 @@ FullCalendar.List = (function (exports, internal$1, core, preact) {
279
279
  return input === false ? null : internal$1.createFormatter(input);
280
280
  }
281
281
 
282
- var css_248z = "\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n\n.fc-theme-standard .fc-list {\n border: 1px solid var(--fc-border-color);\n }\n\n.fc {\n\n /* message when no events */\n\n}\n\n.fc .fc-list-empty {\n background-color: var(--fc-neutral-bg-color);\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: var(--fc-page-bg-color); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table's border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: \"\";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: var(--fc-neutral-bg-color);\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: var(--fc-list-event-hover-bg-color);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: calc(var(--fc-list-event-dot-width) / 2) solid var(--fc-event-border-color);\n border-radius: calc(var(--fc-list-event-dot-width) / 2);\n }\n.fc {\n\n /* reset <a> styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n";
282
+ var css_248z = ":root{--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-theme-standard .fc-list{border:1px solid var(--fc-border-color)}.fc .fc-list-empty{align-items:center;background-color:var(--fc-neutral-bg-color);display:flex;height:100%;justify-content:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{border-style:hidden;width:100%}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{background:var(--fc-page-bg-color);position:sticky;top:0}.fc .fc-list-table thead{left:-10000px;position:absolute}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{clear:both;content:\"\";display:table}.fc-theme-standard .fc-list-day-cushion{background-color:var(--fc-neutral-bg-color)}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:var(--fc-list-event-hover-bg-color)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{border:calc(var(--fc-list-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-list-event-dot-width)/2);box-sizing:content-box;display:inline-block;height:0;width:0}.fc .fc-list-event-title a{color:inherit;text-decoration:none}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}";
283
283
  internal$1.injectStyles(css_248z);
284
284
 
285
285
  var plugin = core.createPlugin({
@@ -1,6 +1,6 @@
1
1
  /*!
2
- FullCalendar List View Plugin v6.0.0-beta.3
3
- Docs & License: https://fullcalendar.io/
2
+ FullCalendar List View Plugin v6.0.0
3
+ Docs & License: https://fullcalendar.io/docs/list-view
4
4
  (c) 2022 Adam Shaw
5
5
  */
6
- FullCalendar.List=function(e,t,n,a){"use strict";class r extends t.BaseComponent{constructor(){super(...arguments),this.state={textId:t.getUniqueDomId()}}render(){let{theme:e,dateEnv:n,options:r,viewApi:s}=this.context,{cellId:l,dayDate:o,todayRange:d}=this.props,{textId:c}=this.state,f=t.getDateMeta(o,d),g=r.listDayFormat?n.format(o,r.listDayFormat):"",u=r.listDaySideFormat?n.format(o,r.listDaySideFormat):"",m=Object.assign({date:n.toDate(o),view:s,textId:c,text:g,sideText:u,navLinkAttrs:t.buildNavLinkAttrs(this.context,o),sideNavLinkAttrs:t.buildNavLinkAttrs(this.context,o,"day",!1)},f);return a.createElement(t.ContentContainer,{elTag:"tr",elClasses:["fc-list-day",...t.getDayClassNames(f,e)],elAttrs:{"data-date":t.formatDayString(o)},renderProps:m,generatorName:"dayHeaderContent",generator:r.dayHeaderContent||i,classNameGenerator:r.dayHeaderClassNames,didMount:r.dayHeaderDidMount,willUnmount:r.dayHeaderWillUnmount},t=>a.createElement("th",{scope:"colgroup",colSpan:3,id:l,"aria-labelledby":c},a.createElement(t,{elTag:"div",elClasses:["fc-list-day-cushion",e.getClass("tableCellShaded")]})))}}function i(e){return a.createElement(a.Fragment,null,e.text&&a.createElement("a",Object.assign({id:e.textId,className:"fc-list-day-text"},e.navLinkAttrs),e.text),e.sideText&&a.createElement("a",Object.assign({"aria-hidden":!0,className:"fc-list-day-side-text"},e.sideNavLinkAttrs),e.sideText))}const s=t.createFormatter({hour:"numeric",minute:"2-digit",meridiem:"short"});class l extends t.BaseComponent{render(){let{props:e,context:n}=this,{options:r}=n,{seg:i,timeHeaderId:l,eventHeaderId:d,dateHeaderId:c}=e,f=r.eventTimeFormat||s;return a.createElement(t.EventContainer,Object.assign({},e,{elTag:"tr",elClasses:["fc-list-event",i.eventRange.def.url&&"fc-event-forced-url"],defaultGenerator:()=>function(e,n){let r=t.getSegAnchorAttrs(e,n);return a.createElement("a",Object.assign({},r),e.eventRange.def.title)}(i,n),seg:i,timeText:"",disableDragging:!0,disableResizing:!0}),(e,r)=>a.createElement(a.Fragment,null,function(e,n,r,i,s){let{options:l}=r;if(!1!==l.displayEventTime){let d,c=e.eventRange.def,f=e.eventRange.instance,g=!1;if(c.allDay?g=!0:t.isMultiDayRange(e.eventRange.range)?e.isStart?d=t.buildSegTimeText(e,n,r,null,null,f.range.start,e.end):e.isEnd?d=t.buildSegTimeText(e,n,r,null,null,e.start,f.range.end):g=!0:d=t.buildSegTimeText(e,n,r),g){let e={text:r.options.allDayText,view:r.viewApi};return a.createElement(t.ContentContainer,{elTag:"td",elClasses:["fc-list-event-time"],elAttrs:{headers:`${i} ${s}`},renderProps:e,generatorName:"allDayContent",generator:l.allDayContent||o,classNameGenerator:l.allDayClassNames,didMount:l.allDayDidMount,willUnmount:l.allDayWillUnmount})}return a.createElement("td",{className:"fc-list-event-time"},d)}return null}(i,f,n,l,c),a.createElement("td",{"aria-hidden":!0,className:"fc-list-event-graphic"},a.createElement("span",{className:"fc-list-event-dot",style:{borderColor:r.borderColor||r.backgroundColor}})),a.createElement(e,{elTag:"td",elClasses:["fc-list-event-title"],elAttrs:{headers:`${d} ${c}`}})))}}function o(e){return e.text}class d extends t.DateComponent{constructor(){super(...arguments),this.computeDateVars=t.memoize(f),this.eventStoreToSegs=t.memoize(this._eventStoreToSegs),this.state={timeHeaderId:t.getUniqueDomId(),eventHeaderId:t.getUniqueDomId(),dateHeaderIdRoot:t.getUniqueDomId()},this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n}=this,{dayDates:r,dayRanges:i}=this.computeDateVars(e.dateProfile),s=this.eventStoreToSegs(e.eventStore,e.eventUiBases,i);return a.createElement(t.ViewContainer,{elRef:this.setRootEl,elClasses:["fc-list",n.theme.getClass("table"),!1!==n.options.stickyHeaderDates?"fc-list-sticky":""],viewSpec:n.viewSpec},a.createElement(t.Scroller,{liquid:!e.isHeightAuto,overflowX:e.isHeightAuto?"visible":"hidden",overflowY:e.isHeightAuto?"visible":"auto"},s.length>0?this.renderSegList(s,r):this.renderEmptyMessage()))}renderEmptyMessage(){let{options:e,viewApi:n}=this.context,r={text:e.noEventsText,view:n};return a.createElement(t.ContentContainer,{elTag:"div",elClasses:["fc-list-empty"],renderProps:r,generatorName:"noEventsContent",generator:e.noEventsContent||c,classNameGenerator:e.noEventsClassNames,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount},e=>a.createElement(e,{elTag:"div",elClasses:["fc-list-empty-cushion"]}))}renderSegList(e,n){let{theme:i,options:s}=this.context,{timeHeaderId:o,eventHeaderId:d,dateHeaderIdRoot:c}=this.state,f=function(e){let t,n,a=[];for(t=0;t<e.length;t+=1)n=e[t],(a[n.dayIndex]||(a[n.dayIndex]=[])).push(n);return a}(e);return a.createElement(t.NowTimer,{unit:"day"},(e,g)=>{let u=[];for(let i=0;i<f.length;i+=1){let m=f[i];if(m){let f=t.formatDayString(n[i]),h=c+"-"+f;u.push(a.createElement(r,{key:f,cellId:h,dayDate:n[i],todayRange:g})),m=t.sortEventSegs(m,s.eventOrder);for(let n of m)u.push(a.createElement(l,Object.assign({key:f+":"+n.eventRange.instance.instanceId,seg:n,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,timeHeaderId:o,eventHeaderId:d,dateHeaderId:h},t.getSegMeta(n,g,e))))}}return a.createElement("table",{className:"fc-list-table "+i.getClass("table")},a.createElement("thead",null,a.createElement("tr",null,a.createElement("th",{scope:"col",id:o},s.timeHint),a.createElement("th",{scope:"col","aria-hidden":!0}),a.createElement("th",{scope:"col",id:d},s.eventHint))),a.createElement("tbody",null,u))})}_eventStoreToSegs(e,n,a){return this.eventRangesToSegs(t.sliceEventStore(e,n,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,a)}eventRangesToSegs(e,t){let n=[];for(let a of e)n.push(...this.eventRangeToSegs(a,t));return n}eventRangeToSegs(e,n){let a,r,i,{dateEnv:s}=this.context,{nextDayThreshold:l}=this.context.options,o=e.range,d=e.def.allDay,c=[];for(a=0;a<n.length;a+=1)if(r=t.intersectRanges(o,n[a]),r&&(i={component:this,eventRange:e,start:r.start,end:r.end,isStart:e.isStart&&r.start.valueOf()===o.start.valueOf(),isEnd:e.isEnd&&r.end.valueOf()===o.end.valueOf(),dayIndex:a},c.push(i),!i.isEnd&&!d&&a+1<n.length&&o.end<s.add(n[a+1].start,l))){i.end=o.end,i.isEnd=!0;break}return c}}function c(e){return e.text}function f(e){let n=t.startOfDay(e.renderRange.start),a=e.renderRange.end,r=[],i=[];for(;n<a;)r.push(n),i.push({start:n,end:t.addDays(n,1)}),n=t.addDays(n,1);return{dayDates:r,dayRanges:i}}const g={listDayFormat:u,listDaySideFormat:u,noEventsClassNames:t.identity,noEventsContent:t.identity,noEventsDidMount:t.identity,noEventsWillUnmount:t.identity};function u(e){return!1===e?null:t.createFormatter(e)}t.injectStyles('\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n\n.fc-theme-standard .fc-list {\n border: 1px solid var(--fc-border-color);\n }\n\n.fc {\n\n /* message when no events */\n\n}\n\n.fc .fc-list-empty {\n background-color: var(--fc-neutral-bg-color);\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: var(--fc-page-bg-color); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table\'s border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: "";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: var(--fc-neutral-bg-color);\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: var(--fc-list-event-hover-bg-color);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: calc(var(--fc-list-event-dot-width) / 2) solid var(--fc-event-border-color);\n border-radius: calc(var(--fc-list-event-dot-width) / 2);\n }\n.fc {\n\n /* reset <a> styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n');var m=n.createPlugin({name:"@fullcalendar/list",optionRefiners:g,views:{list:{component:d,buttonTextKey:"list",listDayFormat:{month:"long",day:"numeric",year:"numeric"}},listDay:{type:"list",duration:{days:1},listDayFormat:{weekday:"long"}},listWeek:{type:"list",duration:{weeks:1},listDayFormat:{weekday:"long"},listDaySideFormat:{month:"long",day:"numeric",year:"numeric"}},listMonth:{type:"list",duration:{month:1},listDaySideFormat:{weekday:"long"}},listYear:{type:"list",duration:{year:1},listDaySideFormat:{weekday:"long"}}}}),h={__proto__:null,ListView:d};return t.globalPlugins.push(m),e.Internal=h,e.default=m,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar.Internal,FullCalendar,FullCalendar.Preact);
6
+ FullCalendar.List=function(e,t,n,a){"use strict";class i extends t.BaseComponent{constructor(){super(...arguments),this.state={textId:t.getUniqueDomId()}}render(){let{theme:e,dateEnv:n,options:i,viewApi:s}=this.context,{cellId:l,dayDate:o,todayRange:d}=this.props,{textId:c}=this.state,f=t.getDateMeta(o,d),g=i.listDayFormat?n.format(o,i.listDayFormat):"",u=i.listDaySideFormat?n.format(o,i.listDaySideFormat):"",m=Object.assign({date:n.toDate(o),view:s,textId:c,text:g,sideText:u,navLinkAttrs:t.buildNavLinkAttrs(this.context,o),sideNavLinkAttrs:t.buildNavLinkAttrs(this.context,o,"day",!1)},f);return a.createElement(t.ContentContainer,{elTag:"tr",elClasses:["fc-list-day",...t.getDayClassNames(f,e)],elAttrs:{"data-date":t.formatDayString(o)},renderProps:m,generatorName:"dayHeaderContent",generator:i.dayHeaderContent||r,classNameGenerator:i.dayHeaderClassNames,didMount:i.dayHeaderDidMount,willUnmount:i.dayHeaderWillUnmount},t=>a.createElement("th",{scope:"colgroup",colSpan:3,id:l,"aria-labelledby":c},a.createElement(t,{elTag:"div",elClasses:["fc-list-day-cushion",e.getClass("tableCellShaded")]})))}}function r(e){return a.createElement(a.Fragment,null,e.text&&a.createElement("a",Object.assign({id:e.textId,className:"fc-list-day-text"},e.navLinkAttrs),e.text),e.sideText&&a.createElement("a",Object.assign({"aria-hidden":!0,className:"fc-list-day-side-text"},e.sideNavLinkAttrs),e.sideText))}const s=t.createFormatter({hour:"numeric",minute:"2-digit",meridiem:"short"});class l extends t.BaseComponent{render(){let{props:e,context:n}=this,{options:i}=n,{seg:r,timeHeaderId:l,eventHeaderId:d,dateHeaderId:c}=e,f=i.eventTimeFormat||s;return a.createElement(t.EventContainer,Object.assign({},e,{elTag:"tr",elClasses:["fc-list-event",r.eventRange.def.url&&"fc-event-forced-url"],defaultGenerator:()=>function(e,n){let i=t.getSegAnchorAttrs(e,n);return a.createElement("a",Object.assign({},i),e.eventRange.def.title)}(r,n),seg:r,timeText:"",disableDragging:!0,disableResizing:!0}),(e,i)=>a.createElement(a.Fragment,null,function(e,n,i,r,s){let{options:l}=i;if(!1!==l.displayEventTime){let d,c=e.eventRange.def,f=e.eventRange.instance,g=!1;if(c.allDay?g=!0:t.isMultiDayRange(e.eventRange.range)?e.isStart?d=t.buildSegTimeText(e,n,i,null,null,f.range.start,e.end):e.isEnd?d=t.buildSegTimeText(e,n,i,null,null,e.start,f.range.end):g=!0:d=t.buildSegTimeText(e,n,i),g){let e={text:i.options.allDayText,view:i.viewApi};return a.createElement(t.ContentContainer,{elTag:"td",elClasses:["fc-list-event-time"],elAttrs:{headers:`${r} ${s}`},renderProps:e,generatorName:"allDayContent",generator:l.allDayContent||o,classNameGenerator:l.allDayClassNames,didMount:l.allDayDidMount,willUnmount:l.allDayWillUnmount})}return a.createElement("td",{className:"fc-list-event-time"},d)}return null}(r,f,n,l,c),a.createElement("td",{"aria-hidden":!0,className:"fc-list-event-graphic"},a.createElement("span",{className:"fc-list-event-dot",style:{borderColor:i.borderColor||i.backgroundColor}})),a.createElement(e,{elTag:"td",elClasses:["fc-list-event-title"],elAttrs:{headers:`${d} ${c}`}})))}}function o(e){return e.text}class d extends t.DateComponent{constructor(){super(...arguments),this.computeDateVars=t.memoize(f),this.eventStoreToSegs=t.memoize(this._eventStoreToSegs),this.state={timeHeaderId:t.getUniqueDomId(),eventHeaderId:t.getUniqueDomId(),dateHeaderIdRoot:t.getUniqueDomId()},this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n}=this,{dayDates:i,dayRanges:r}=this.computeDateVars(e.dateProfile),s=this.eventStoreToSegs(e.eventStore,e.eventUiBases,r);return a.createElement(t.ViewContainer,{elRef:this.setRootEl,elClasses:["fc-list",n.theme.getClass("table"),!1!==n.options.stickyHeaderDates?"fc-list-sticky":""],viewSpec:n.viewSpec},a.createElement(t.Scroller,{liquid:!e.isHeightAuto,overflowX:e.isHeightAuto?"visible":"hidden",overflowY:e.isHeightAuto?"visible":"auto"},s.length>0?this.renderSegList(s,i):this.renderEmptyMessage()))}renderEmptyMessage(){let{options:e,viewApi:n}=this.context,i={text:e.noEventsText,view:n};return a.createElement(t.ContentContainer,{elTag:"div",elClasses:["fc-list-empty"],renderProps:i,generatorName:"noEventsContent",generator:e.noEventsContent||c,classNameGenerator:e.noEventsClassNames,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount},e=>a.createElement(e,{elTag:"div",elClasses:["fc-list-empty-cushion"]}))}renderSegList(e,n){let{theme:r,options:s}=this.context,{timeHeaderId:o,eventHeaderId:d,dateHeaderIdRoot:c}=this.state,f=function(e){let t,n,a=[];for(t=0;t<e.length;t+=1)n=e[t],(a[n.dayIndex]||(a[n.dayIndex]=[])).push(n);return a}(e);return a.createElement(t.NowTimer,{unit:"day"},(e,g)=>{let u=[];for(let r=0;r<f.length;r+=1){let m=f[r];if(m){let f=t.formatDayString(n[r]),h=c+"-"+f;u.push(a.createElement(i,{key:f,cellId:h,dayDate:n[r],todayRange:g})),m=t.sortEventSegs(m,s.eventOrder);for(let n of m)u.push(a.createElement(l,Object.assign({key:f+":"+n.eventRange.instance.instanceId,seg:n,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,timeHeaderId:o,eventHeaderId:d,dateHeaderId:h},t.getSegMeta(n,g,e))))}}return a.createElement("table",{className:"fc-list-table "+r.getClass("table")},a.createElement("thead",null,a.createElement("tr",null,a.createElement("th",{scope:"col",id:o},s.timeHint),a.createElement("th",{scope:"col","aria-hidden":!0}),a.createElement("th",{scope:"col",id:d},s.eventHint))),a.createElement("tbody",null,u))})}_eventStoreToSegs(e,n,a){return this.eventRangesToSegs(t.sliceEventStore(e,n,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,a)}eventRangesToSegs(e,t){let n=[];for(let a of e)n.push(...this.eventRangeToSegs(a,t));return n}eventRangeToSegs(e,n){let a,i,r,{dateEnv:s}=this.context,{nextDayThreshold:l}=this.context.options,o=e.range,d=e.def.allDay,c=[];for(a=0;a<n.length;a+=1)if(i=t.intersectRanges(o,n[a]),i&&(r={component:this,eventRange:e,start:i.start,end:i.end,isStart:e.isStart&&i.start.valueOf()===o.start.valueOf(),isEnd:e.isEnd&&i.end.valueOf()===o.end.valueOf(),dayIndex:a},c.push(r),!r.isEnd&&!d&&a+1<n.length&&o.end<s.add(n[a+1].start,l))){r.end=o.end,r.isEnd=!0;break}return c}}function c(e){return e.text}function f(e){let n=t.startOfDay(e.renderRange.start),a=e.renderRange.end,i=[],r=[];for(;n<a;)i.push(n),r.push({start:n,end:t.addDays(n,1)}),n=t.addDays(n,1);return{dayDates:i,dayRanges:r}}const g={listDayFormat:u,listDaySideFormat:u,noEventsClassNames:t.identity,noEventsContent:t.identity,noEventsDidMount:t.identity,noEventsWillUnmount:t.identity};function u(e){return!1===e?null:t.createFormatter(e)}t.injectStyles(':root{--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-theme-standard .fc-list{border:1px solid var(--fc-border-color)}.fc .fc-list-empty{align-items:center;background-color:var(--fc-neutral-bg-color);display:flex;height:100%;justify-content:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{border-style:hidden;width:100%}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{background:var(--fc-page-bg-color);position:sticky;top:0}.fc .fc-list-table thead{left:-10000px;position:absolute}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{clear:both;content:"";display:table}.fc-theme-standard .fc-list-day-cushion{background-color:var(--fc-neutral-bg-color)}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:var(--fc-list-event-hover-bg-color)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{border:calc(var(--fc-list-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-list-event-dot-width)/2);box-sizing:content-box;display:inline-block;height:0;width:0}.fc .fc-list-event-title a{color:inherit;text-decoration:none}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}');var m=n.createPlugin({name:"@fullcalendar/list",optionRefiners:g,views:{list:{component:d,buttonTextKey:"list",listDayFormat:{month:"long",day:"numeric",year:"numeric"}},listDay:{type:"list",duration:{days:1},listDayFormat:{weekday:"long"}},listWeek:{type:"list",duration:{weeks:1},listDayFormat:{weekday:"long"},listDaySideFormat:{month:"long",day:"numeric",year:"numeric"}},listMonth:{type:"list",duration:{month:1},listDaySideFormat:{weekday:"long"}},listYear:{type:"list",duration:{year:1},listDaySideFormat:{weekday:"long"}}}}),h={__proto__:null,ListView:d};return t.globalPlugins.push(m),e.Internal=h,e.default=m,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar.Internal,FullCalendar,FullCalendar.Preact);
package/index.js CHANGED
@@ -16,7 +16,7 @@ function createFalsableFormatter(input) {
16
16
  return input === false ? null : createFormatter(input);
17
17
  }
18
18
 
19
- var css_248z = "\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n\n.fc-theme-standard .fc-list {\n border: 1px solid var(--fc-border-color);\n }\n\n.fc {\n\n /* message when no events */\n\n}\n\n.fc .fc-list-empty {\n background-color: var(--fc-neutral-bg-color);\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: var(--fc-page-bg-color); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table's border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: \"\";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: var(--fc-neutral-bg-color);\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: var(--fc-list-event-hover-bg-color);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: calc(var(--fc-list-event-dot-width) / 2) solid var(--fc-event-border-color);\n border-radius: calc(var(--fc-list-event-dot-width) / 2);\n }\n.fc {\n\n /* reset <a> styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n";
19
+ var css_248z = ":root{--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-theme-standard .fc-list{border:1px solid var(--fc-border-color)}.fc .fc-list-empty{align-items:center;background-color:var(--fc-neutral-bg-color);display:flex;height:100%;justify-content:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{border-style:hidden;width:100%}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{background:var(--fc-page-bg-color);position:sticky;top:0}.fc .fc-list-table thead{left:-10000px;position:absolute}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{clear:both;content:\"\";display:table}.fc-theme-standard .fc-list-day-cushion{background-color:var(--fc-neutral-bg-color)}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:var(--fc-list-event-hover-bg-color)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{border:calc(var(--fc-list-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-list-event-dot-width)/2);box-sizing:content-box;display:inline-block;height:0;width:0}.fc .fc-list-event-title a{color:inherit;text-decoration:none}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}";
20
20
  injectStyles(css_248z);
21
21
 
22
22
  var index = createPlugin({
package/package.json CHANGED
@@ -1,18 +1,24 @@
1
1
  {
2
2
  "name": "@fullcalendar/list",
3
- "version": "6.0.0-beta.3",
3
+ "version": "6.0.0",
4
+ "title": "FullCalendar List View Plugin",
5
+ "description": "Display events on a calendar view that looks like a bulleted list",
4
6
  "keywords": [
5
7
  "calendar",
6
8
  "event",
7
- "full-sized"
9
+ "full-sized",
10
+ "fullcalendar",
11
+ "list-view"
8
12
  ],
9
- "homepage": "https://fullcalendar.io/",
10
- "docs": "https://fullcalendar.io/docs/list-view",
13
+ "homepage": "https://fullcalendar.io/docs/list-view",
14
+ "peerDependencies": {
15
+ "@fullcalendar/core": "~6.0.0"
16
+ },
17
+ "type": "module",
11
18
  "bugs": "https://fullcalendar.io/reporting-bugs",
12
19
  "repository": {
13
20
  "type": "git",
14
21
  "url": "https://github.com/fullcalendar/fullcalendar.git",
15
- "homepage": "https://github.com/fullcalendar/fullcalendar",
16
22
  "directory": "packages/list"
17
23
  },
18
24
  "license": "MIT",
@@ -22,17 +28,11 @@
22
28
  "url": "http://arshaw.com/"
23
29
  },
24
30
  "copyright": "2022 Adam Shaw",
25
- "type": "module",
26
- "title": "FullCalendar List View Plugin",
27
- "description": "View your events as a bulleted list",
28
- "peerDependencies": {
29
- "@fullcalendar/core": "6.0.0-beta.3"
30
- },
31
31
  "main": "./index.cjs",
32
32
  "module": "./index.js",
33
33
  "types": "./index.d.ts",
34
34
  "unpkg": "./index.global.min.js",
35
- "jsdelvr": "./index.global.min.js",
35
+ "jsdelivr": "./index.global.min.js",
36
36
  "exports": {
37
37
  "./package.json": "./package.json",
38
38
  "./index.cjs": "./index.cjs",