Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • komasolver
  • main
  • renovate/django-5.x
  • renovate/django-debug-toolbar-5.x
  • renovate/django_csp-4.x
  • renovate/djangorestframework-3.x
  • renovate/tzdata-2025.x
  • renovate/uwsgi-2.x
8 results

Target

Select target project
  • konstantin/akplanning
  • matedealer/akplanning
  • kif/akplanning
  • mirco/akplanning
  • lordofthevoid/akplanning
  • voidptr/akplanning
  • xayomer/akplanning-fork
  • mollux/akplanning
  • neumantm/akplanning
  • mmarx/akplanning
  • nerf/akplanning
  • felix_bonn/akplanning
  • sebastian.uschmann/akplanning
13 results
Select Git revision
  • ak-import
  • feature/clear-schedule-button
  • feature/json-export-via-rest-framework
  • feature/json-schedule-import-tests
  • feature/preference-polling
  • feature/preference-polling-form
  • feature/preference-polling-form-rebased
  • feature/preference-polling-rebased
  • fix/add-room-import-only-once
  • main
  • merge-to-upstream
  • renovate/django-5.x
  • renovate/django-debug-toolbar-4.x
  • renovate/django-simple-history-3.x
  • renovate/mysqlclient-2.x
15 results
Show changes
Showing
with 0 additions and 3537 deletions
// Generated by dts-bundle v0.7.3-fork.1
// Dependencies for this module:
// ../../../../../@fullcalendar/core
// ../../../../../@fullcalendar/daygrid
// ../../../../../@fullcalendar/resource-common
declare module '@fullcalendar/resource-daygrid' {
import ResourceDayGridView from '@fullcalendar/resource-daygrid/ResourceDayGridView';
export { ResourceDayGridView };
export { default as ResourceDayGrid } from '@fullcalendar/resource-daygrid/ResourceDayGrid';
const _default: import("@fullcalendar/core").PluginDef;
export default _default;
}
declare module '@fullcalendar/resource-daygrid/ResourceDayGridView' {
import { ComponentContext, ViewSpec, DateProfileGenerator } from '@fullcalendar/core';
import { AbstractDayGridView } from '@fullcalendar/daygrid';
import { ResourceDayHeader, ResourceViewProps } from '@fullcalendar/resource-common';
import ResourceDayGrid from '@fullcalendar/resource-daygrid/ResourceDayGrid';
export { ResourceDayGridView as default, ResourceDayGridView };
class ResourceDayGridView extends AbstractDayGridView {
static needsResourceData: boolean;
props: ResourceViewProps;
header: ResourceDayHeader;
resourceDayGrid: ResourceDayGrid;
constructor(context: ComponentContext, viewSpec: ViewSpec, dateProfileGenerator: DateProfileGenerator, parentEl: HTMLElement);
destroy(): void;
render(props: ResourceViewProps): void;
}
}
declare module '@fullcalendar/resource-daygrid/ResourceDayGrid' {
import { Hit, DateSpan, DateComponent, DateProfile, EventStore, EventUiHash, EventInteractionState, ComponentContext, Duration } from '@fullcalendar/core';
import { DayGrid } from '@fullcalendar/daygrid';
import { AbstractResourceDayTable } from '@fullcalendar/resource-common';
export interface ResourceDayGridProps {
dateProfile: DateProfile | null;
resourceDayTable: AbstractResourceDayTable;
businessHours: EventStore;
eventStore: EventStore;
eventUiBases: EventUiHash;
dateSelection: DateSpan | null;
eventSelection: string;
eventDrag: EventInteractionState | null;
eventResize: EventInteractionState | null;
isRigid: boolean;
nextDayThreshold: Duration;
}
export { ResourceDayGrid as default, ResourceDayGrid };
class ResourceDayGrid extends DateComponent<ResourceDayGridProps> {
dayGrid: DayGrid;
constructor(context: ComponentContext, dayGrid: DayGrid);
destroy(): void;
render(props: ResourceDayGridProps): void;
buildPositionCaches(): void;
queryHit(positionLeft: number, positionTop: number): Hit;
}
}
/*!
FullCalendar Resource Day Grid Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
import { mapHash, DateComponent, memoize, parseFieldSpecs, createPlugin } from '@fullcalendar/core';
import ResourceCommonPlugin, { VResourceSplitter, VResourceJoiner, flattenResources, ResourceDayHeader, DayResourceTable, ResourceDayTable } from '@fullcalendar/resource-common';
import DayGridPlugin, { DayGridSlicer, AbstractDayGridView, buildBasicDayTable } from '@fullcalendar/daygrid';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var ResourceDayGrid = /** @class */ (function (_super) {
__extends(ResourceDayGrid, _super);
function ResourceDayGrid(context, dayGrid) {
var _this = _super.call(this, context, dayGrid.el) || this;
_this.splitter = new VResourceSplitter();
_this.slicers = {};
_this.joiner = new ResourceDayGridJoiner();
_this.dayGrid = dayGrid;
context.calendar.registerInteractiveComponent(_this, {
el: _this.dayGrid.el
});
return _this;
}
ResourceDayGrid.prototype.destroy = function () {
_super.prototype.destroy.call(this);
this.calendar.unregisterInteractiveComponent(this);
};
ResourceDayGrid.prototype.render = function (props) {
var _this = this;
var dayGrid = this.dayGrid;
var dateProfile = props.dateProfile, resourceDayTable = props.resourceDayTable, nextDayThreshold = props.nextDayThreshold;
var splitProps = this.splitter.splitProps(props);
this.slicers = mapHash(splitProps, function (split, resourceId) {
return _this.slicers[resourceId] || new DayGridSlicer();
});
var slicedProps = mapHash(this.slicers, function (slicer, resourceId) {
return slicer.sliceProps(splitProps[resourceId], dateProfile, nextDayThreshold, dayGrid, resourceDayTable.dayTable);
});
dayGrid.allowAcrossResources = resourceDayTable.dayTable.colCnt === 1;
dayGrid.receiveProps(__assign({}, this.joiner.joinProps(slicedProps, resourceDayTable), { dateProfile: dateProfile, cells: resourceDayTable.cells, isRigid: props.isRigid }));
};
ResourceDayGrid.prototype.buildPositionCaches = function () {
this.dayGrid.buildPositionCaches();
};
ResourceDayGrid.prototype.queryHit = function (positionLeft, positionTop) {
var rawHit = this.dayGrid.positionToHit(positionLeft, positionTop);
if (rawHit) {
return {
component: this.dayGrid,
dateSpan: {
range: rawHit.dateSpan.range,
allDay: rawHit.dateSpan.allDay,
resourceId: this.props.resourceDayTable.cells[rawHit.row][rawHit.col].resource.id
},
dayEl: rawHit.dayEl,
rect: {
left: rawHit.relativeRect.left,
right: rawHit.relativeRect.right,
top: rawHit.relativeRect.top,
bottom: rawHit.relativeRect.bottom
},
layer: 0
};
}
};
return ResourceDayGrid;
}(DateComponent));
var ResourceDayGridJoiner = /** @class */ (function (_super) {
__extends(ResourceDayGridJoiner, _super);
function ResourceDayGridJoiner() {
return _super !== null && _super.apply(this, arguments) || this;
}
ResourceDayGridJoiner.prototype.transformSeg = function (seg, resourceDayTable, resourceI) {
var colRanges = resourceDayTable.computeColRanges(seg.firstCol, seg.lastCol, resourceI);
return colRanges.map(function (colRange) {
return __assign({}, seg, colRange, { isStart: seg.isStart && colRange.isStart, isEnd: seg.isEnd && colRange.isEnd });
});
};
return ResourceDayGridJoiner;
}(VResourceJoiner));
var ResourceDayGridView = /** @class */ (function (_super) {
__extends(ResourceDayGridView, _super);
function ResourceDayGridView(context, viewSpec, dateProfileGenerator, parentEl) {
var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;
_this.flattenResources = memoize(flattenResources);
_this.buildResourceDayTable = memoize(buildResourceDayTable);
_this.resourceOrderSpecs = parseFieldSpecs(_this.opt('resourceOrder'));
if (_this.opt('columnHeader')) {
_this.header = new ResourceDayHeader(_this.context, _this.el.querySelector('.fc-head-container'));
}
_this.resourceDayGrid = new ResourceDayGrid(context, _this.dayGrid);
return _this;
}
ResourceDayGridView.prototype.destroy = function () {
_super.prototype.destroy.call(this);
if (this.header) {
this.header.destroy();
}
this.resourceDayGrid.destroy();
};
ResourceDayGridView.prototype.render = function (props) {
_super.prototype.render.call(this, props); // for flags for updateSize
var resources = this.flattenResources(props.resourceStore, this.resourceOrderSpecs);
var resourceDayTable = this.buildResourceDayTable(this.props.dateProfile, this.dateProfileGenerator, resources, this.opt('datesAboveResources'));
if (this.header) {
this.header.receiveProps({
resources: resources,
dates: resourceDayTable.dayTable.headerDates,
dateProfile: props.dateProfile,
datesRepDistinctDays: true,
renderIntroHtml: this.renderHeadIntroHtml
});
}
this.resourceDayGrid.receiveProps({
dateProfile: props.dateProfile,
resourceDayTable: resourceDayTable,
businessHours: props.businessHours,
eventStore: props.eventStore,
eventUiBases: props.eventUiBases,
dateSelection: props.dateSelection,
eventSelection: props.eventSelection,
eventDrag: props.eventDrag,
eventResize: props.eventResize,
isRigid: this.hasRigidRows(),
nextDayThreshold: this.nextDayThreshold
});
};
ResourceDayGridView.needsResourceData = true; // for ResourceViewProps
return ResourceDayGridView;
}(AbstractDayGridView));
function buildResourceDayTable(dateProfile, dateProfileGenerator, resources, datesAboveResources) {
var dayTable = buildBasicDayTable(dateProfile, dateProfileGenerator);
return datesAboveResources ?
new DayResourceTable(dayTable, resources) :
new ResourceDayTable(dayTable, resources);
}
var main = createPlugin({
deps: [ResourceCommonPlugin, DayGridPlugin],
defaultView: 'resourceDayGridDay',
views: {
resourceDayGrid: ResourceDayGridView,
resourceDayGridDay: {
type: 'resourceDayGrid',
duration: { days: 1 }
},
resourceDayGridWeek: {
type: 'resourceDayGrid',
duration: { weeks: 1 }
},
resourceDayGridMonth: {
type: 'resourceDayGrid',
duration: { months: 1 },
// TODO: wish we didn't have to C&P from dayGrid's file
monthMode: true,
fixedWeekCount: true
}
}
});
export default main;
export { ResourceDayGrid, ResourceDayGridView };
/*!
FullCalendar Resource Day Grid Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core'), require('@fullcalendar/resource-common'), require('@fullcalendar/daygrid')) :
typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core', '@fullcalendar/resource-common', '@fullcalendar/daygrid'], factory) :
(global = global || self, factory(global.FullCalendarResourceDayGrid = {}, global.FullCalendar, global.FullCalendarResourceCommon, global.FullCalendarDayGrid));
}(this, function (exports, core, ResourceCommonPlugin, DayGridPlugin) { 'use strict';
var ResourceCommonPlugin__default = 'default' in ResourceCommonPlugin ? ResourceCommonPlugin['default'] : ResourceCommonPlugin;
var DayGridPlugin__default = 'default' in DayGridPlugin ? DayGridPlugin['default'] : DayGridPlugin;
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var ResourceDayGrid = /** @class */ (function (_super) {
__extends(ResourceDayGrid, _super);
function ResourceDayGrid(context, dayGrid) {
var _this = _super.call(this, context, dayGrid.el) || this;
_this.splitter = new ResourceCommonPlugin.VResourceSplitter();
_this.slicers = {};
_this.joiner = new ResourceDayGridJoiner();
_this.dayGrid = dayGrid;
context.calendar.registerInteractiveComponent(_this, {
el: _this.dayGrid.el
});
return _this;
}
ResourceDayGrid.prototype.destroy = function () {
_super.prototype.destroy.call(this);
this.calendar.unregisterInteractiveComponent(this);
};
ResourceDayGrid.prototype.render = function (props) {
var _this = this;
var dayGrid = this.dayGrid;
var dateProfile = props.dateProfile, resourceDayTable = props.resourceDayTable, nextDayThreshold = props.nextDayThreshold;
var splitProps = this.splitter.splitProps(props);
this.slicers = core.mapHash(splitProps, function (split, resourceId) {
return _this.slicers[resourceId] || new DayGridPlugin.DayGridSlicer();
});
var slicedProps = core.mapHash(this.slicers, function (slicer, resourceId) {
return slicer.sliceProps(splitProps[resourceId], dateProfile, nextDayThreshold, dayGrid, resourceDayTable.dayTable);
});
dayGrid.allowAcrossResources = resourceDayTable.dayTable.colCnt === 1;
dayGrid.receiveProps(__assign({}, this.joiner.joinProps(slicedProps, resourceDayTable), { dateProfile: dateProfile, cells: resourceDayTable.cells, isRigid: props.isRigid }));
};
ResourceDayGrid.prototype.buildPositionCaches = function () {
this.dayGrid.buildPositionCaches();
};
ResourceDayGrid.prototype.queryHit = function (positionLeft, positionTop) {
var rawHit = this.dayGrid.positionToHit(positionLeft, positionTop);
if (rawHit) {
return {
component: this.dayGrid,
dateSpan: {
range: rawHit.dateSpan.range,
allDay: rawHit.dateSpan.allDay,
resourceId: this.props.resourceDayTable.cells[rawHit.row][rawHit.col].resource.id
},
dayEl: rawHit.dayEl,
rect: {
left: rawHit.relativeRect.left,
right: rawHit.relativeRect.right,
top: rawHit.relativeRect.top,
bottom: rawHit.relativeRect.bottom
},
layer: 0
};
}
};
return ResourceDayGrid;
}(core.DateComponent));
var ResourceDayGridJoiner = /** @class */ (function (_super) {
__extends(ResourceDayGridJoiner, _super);
function ResourceDayGridJoiner() {
return _super !== null && _super.apply(this, arguments) || this;
}
ResourceDayGridJoiner.prototype.transformSeg = function (seg, resourceDayTable, resourceI) {
var colRanges = resourceDayTable.computeColRanges(seg.firstCol, seg.lastCol, resourceI);
return colRanges.map(function (colRange) {
return __assign({}, seg, colRange, { isStart: seg.isStart && colRange.isStart, isEnd: seg.isEnd && colRange.isEnd });
});
};
return ResourceDayGridJoiner;
}(ResourceCommonPlugin.VResourceJoiner));
var ResourceDayGridView = /** @class */ (function (_super) {
__extends(ResourceDayGridView, _super);
function ResourceDayGridView(context, viewSpec, dateProfileGenerator, parentEl) {
var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;
_this.flattenResources = core.memoize(ResourceCommonPlugin.flattenResources);
_this.buildResourceDayTable = core.memoize(buildResourceDayTable);
_this.resourceOrderSpecs = core.parseFieldSpecs(_this.opt('resourceOrder'));
if (_this.opt('columnHeader')) {
_this.header = new ResourceCommonPlugin.ResourceDayHeader(_this.context, _this.el.querySelector('.fc-head-container'));
}
_this.resourceDayGrid = new ResourceDayGrid(context, _this.dayGrid);
return _this;
}
ResourceDayGridView.prototype.destroy = function () {
_super.prototype.destroy.call(this);
if (this.header) {
this.header.destroy();
}
this.resourceDayGrid.destroy();
};
ResourceDayGridView.prototype.render = function (props) {
_super.prototype.render.call(this, props); // for flags for updateSize
var resources = this.flattenResources(props.resourceStore, this.resourceOrderSpecs);
var resourceDayTable = this.buildResourceDayTable(this.props.dateProfile, this.dateProfileGenerator, resources, this.opt('datesAboveResources'));
if (this.header) {
this.header.receiveProps({
resources: resources,
dates: resourceDayTable.dayTable.headerDates,
dateProfile: props.dateProfile,
datesRepDistinctDays: true,
renderIntroHtml: this.renderHeadIntroHtml
});
}
this.resourceDayGrid.receiveProps({
dateProfile: props.dateProfile,
resourceDayTable: resourceDayTable,
businessHours: props.businessHours,
eventStore: props.eventStore,
eventUiBases: props.eventUiBases,
dateSelection: props.dateSelection,
eventSelection: props.eventSelection,
eventDrag: props.eventDrag,
eventResize: props.eventResize,
isRigid: this.hasRigidRows(),
nextDayThreshold: this.nextDayThreshold
});
};
ResourceDayGridView.needsResourceData = true; // for ResourceViewProps
return ResourceDayGridView;
}(DayGridPlugin.AbstractDayGridView));
function buildResourceDayTable(dateProfile, dateProfileGenerator, resources, datesAboveResources) {
var dayTable = DayGridPlugin.buildBasicDayTable(dateProfile, dateProfileGenerator);
return datesAboveResources ?
new ResourceCommonPlugin.DayResourceTable(dayTable, resources) :
new ResourceCommonPlugin.ResourceDayTable(dayTable, resources);
}
var main = core.createPlugin({
deps: [ResourceCommonPlugin__default, DayGridPlugin__default],
defaultView: 'resourceDayGridDay',
views: {
resourceDayGrid: ResourceDayGridView,
resourceDayGridDay: {
type: 'resourceDayGrid',
duration: { days: 1 }
},
resourceDayGridWeek: {
type: 'resourceDayGrid',
duration: { weeks: 1 }
},
resourceDayGridMonth: {
type: 'resourceDayGrid',
duration: { months: 1 },
// TODO: wish we didn't have to C&P from dayGrid's file
monthMode: true,
fixedWeekCount: true
}
}
});
exports.ResourceDayGrid = ResourceDayGrid;
exports.ResourceDayGridView = ResourceDayGridView;
exports.default = main;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/*!
FullCalendar Resource Day Grid Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@fullcalendar/core"),require("@fullcalendar/resource-common"),require("@fullcalendar/daygrid")):"function"==typeof define&&define.amd?define(["exports","@fullcalendar/core","@fullcalendar/resource-common","@fullcalendar/daygrid"],r):r((e=e||self).FullCalendarResourceDayGrid={},e.FullCalendar,e.FullCalendarResourceCommon,e.FullCalendarDayGrid)}(this,function(e,r,t,o){"use strict";var i="default"in t?t.default:t,a="default"in o?o.default:o,s=function(e,r){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)};function n(e,r){function t(){this.constructor=e}s(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}var l=function(){return(l=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e}).apply(this,arguments)},c=function(e){function i(r,o){var i=e.call(this,r,o.el)||this;return i.splitter=new t.VResourceSplitter,i.slicers={},i.joiner=new d,i.dayGrid=o,r.calendar.registerInteractiveComponent(i,{el:i.dayGrid.el}),i}return n(i,e),i.prototype.destroy=function(){e.prototype.destroy.call(this),this.calendar.unregisterInteractiveComponent(this)},i.prototype.render=function(e){var t=this,i=this.dayGrid,a=e.dateProfile,s=e.resourceDayTable,n=e.nextDayThreshold,c=this.splitter.splitProps(e);this.slicers=r.mapHash(c,function(e,r){return t.slicers[r]||new o.DayGridSlicer});var d=r.mapHash(this.slicers,function(e,r){return e.sliceProps(c[r],a,n,i,s.dayTable)});i.allowAcrossResources=1===s.dayTable.colCnt,i.receiveProps(l({},this.joiner.joinProps(d,s),{dateProfile:a,cells:s.cells,isRigid:e.isRigid}))},i.prototype.buildPositionCaches=function(){this.dayGrid.buildPositionCaches()},i.prototype.queryHit=function(e,r){var t=this.dayGrid.positionToHit(e,r);if(t)return{component:this.dayGrid,dateSpan:{range:t.dateSpan.range,allDay:t.dateSpan.allDay,resourceId:this.props.resourceDayTable.cells[t.row][t.col].resource.id},dayEl:t.dayEl,rect:{left:t.relativeRect.left,right:t.relativeRect.right,top:t.relativeRect.top,bottom:t.relativeRect.bottom},layer:0}},i}(r.DateComponent),d=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.transformSeg=function(e,r,t){return r.computeColRanges(e.firstCol,e.lastCol,t).map(function(r){return l({},e,r,{isStart:e.isStart&&r.isStart,isEnd:e.isEnd&&r.isEnd})})},r}(t.VResourceJoiner),u=function(e){function o(o,i,a,s){var n=e.call(this,o,i,a,s)||this;return n.flattenResources=r.memoize(t.flattenResources),n.buildResourceDayTable=r.memoize(y),n.resourceOrderSpecs=r.parseFieldSpecs(n.opt("resourceOrder")),n.opt("columnHeader")&&(n.header=new t.ResourceDayHeader(n.context,n.el.querySelector(".fc-head-container"))),n.resourceDayGrid=new c(o,n.dayGrid),n}return n(o,e),o.prototype.destroy=function(){e.prototype.destroy.call(this),this.header&&this.header.destroy(),this.resourceDayGrid.destroy()},o.prototype.render=function(r){e.prototype.render.call(this,r);var t=this.flattenResources(r.resourceStore,this.resourceOrderSpecs),o=this.buildResourceDayTable(this.props.dateProfile,this.dateProfileGenerator,t,this.opt("datesAboveResources"));this.header&&this.header.receiveProps({resources:t,dates:o.dayTable.headerDates,dateProfile:r.dateProfile,datesRepDistinctDays:!0,renderIntroHtml:this.renderHeadIntroHtml}),this.resourceDayGrid.receiveProps({dateProfile:r.dateProfile,resourceDayTable:o,businessHours:r.businessHours,eventStore:r.eventStore,eventUiBases:r.eventUiBases,dateSelection:r.dateSelection,eventSelection:r.eventSelection,eventDrag:r.eventDrag,eventResize:r.eventResize,isRigid:this.hasRigidRows(),nextDayThreshold:this.nextDayThreshold})},o.needsResourceData=!0,o}(o.AbstractDayGridView);function y(e,r,i,a){var s=o.buildBasicDayTable(e,r);return a?new t.DayResourceTable(s,i):new t.ResourceDayTable(s,i)}var p=r.createPlugin({deps:[i,a],defaultView:"resourceDayGridDay",views:{resourceDayGrid:u,resourceDayGridDay:{type:"resourceDayGrid",duration:{days:1}},resourceDayGridWeek:{type:"resourceDayGrid",duration:{weeks:1}},resourceDayGridMonth:{type:"resourceDayGrid",duration:{months:1},monthMode:!0,fixedWeekCount:!0}}});e.ResourceDayGrid=c,e.ResourceDayGridView=u,e.default=p,Object.defineProperty(e,"__esModule",{value:!0})});
\ No newline at end of file
{
"name": "@fullcalendar/resource-daygrid",
"version": "4.3.0",
"title": "FullCalendar Resource Day Grid Plugin",
"description": "Displays events in individual columns for days and resources",
"keywords": [
"calendar",
"event",
"full-sized"
],
"homepage": "https://fullcalendar.io/scheduler",
"docs": "https://fullcalendar.io/docs/resource-daygrid-view",
"bugs": "https://fullcalendar.io/reporting-bugs",
"repository": {
"type": "git",
"url": "https://github.com/fullcalendar/fullcalendar-scheduler.git",
"homepage": "https://github.com/fullcalendar/fullcalendar-scheduler"
},
"license": "SEE LICENSE IN LICENSE.md",
"author": {
"name": "Adam Shaw",
"email": "arshaw@arshaw.com",
"url": "http://arshaw.com/"
},
"copyright": "2019 Adam Shaw",
"dependencies": {
"@fullcalendar/resource-common": "~4.3.0",
"@fullcalendar/daygrid": "~4.3.0"
},
"peerDependencies": {
"@fullcalendar/core": "~4.3.0"
},
"main": "main.js",
"module": "main.esm.js",
"unpkg": "main.min.js",
"types": "main.d.ts"
}
For complete licensing information, visit:
http://fullcalendar.io/scheduler/license
FullCalendar Scheduler is tri-licensed, meaning you must choose
one of three licenses to use. Here is a summary of those licenses:
- Commercial License
(a paid license, meant for commercial use)
http://fullcalendar.io/scheduler/license-details
- Creative Commons Non-Commercial No-Derivatives
(meant for trial and non-commercial use)
https://creativecommons.org/licenses/by-nc-nd/4.0/
- GPLv3 License
(meant for open-source projects)
http://www.gnu.org/licenses/gpl-3.0.en.html
# FullCalendar Resource Time Grid Plugin
Displays events on a vertical resource view with time slots
[View the docs &raquo;](https://fullcalendar.io/docs/vertical-resource-view)
This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar-scheduler)
// Generated by dts-bundle v0.7.3-fork.1
// Dependencies for this module:
// ../../../../../@fullcalendar/core
// ../../../../../@fullcalendar/timegrid
// ../../../../../@fullcalendar/resource-common
// ../../../../../@fullcalendar/resource-daygrid
declare module '@fullcalendar/resource-timegrid' {
import ResourceTimeGridView from '@fullcalendar/resource-timegrid/ResourceTimeGridView';
export { ResourceTimeGridView };
export { default as ResourceTimeGrid } from '@fullcalendar/resource-timegrid/ResourceTimeGrid';
const _default: import("@fullcalendar/core").PluginDef;
export default _default;
}
declare module '@fullcalendar/resource-timegrid/ResourceTimeGridView' {
import { ComponentContext, ViewSpec, DateProfileGenerator } from '@fullcalendar/core';
import { AbstractTimeGridView } from '@fullcalendar/timegrid';
import { ResourceDayHeader, ResourceViewProps } from '@fullcalendar/resource-common';
import { ResourceDayGrid } from '@fullcalendar/resource-daygrid';
import ResourceTimeGrid from '@fullcalendar/resource-timegrid/ResourceTimeGrid';
export { ResourceTimeGridView as default, ResourceTimeGridView };
class ResourceTimeGridView extends AbstractTimeGridView {
static needsResourceData: boolean;
props: ResourceViewProps;
header: ResourceDayHeader;
resourceTimeGrid: ResourceTimeGrid;
resourceDayGrid: ResourceDayGrid;
constructor(context: ComponentContext, viewSpec: ViewSpec, dateProfileGenerator: DateProfileGenerator, parentEl: HTMLElement);
destroy(): void;
render(props: ResourceViewProps): void;
renderNowIndicator(date: any): void;
}
}
declare module '@fullcalendar/resource-timegrid/ResourceTimeGrid' {
import { DateSpan, DateComponent, DateProfile, EventStore, EventUiHash, EventInteractionState, ComponentContext, DateMarker, Hit } from '@fullcalendar/core';
import { TimeGrid } from '@fullcalendar/timegrid';
import { AbstractResourceDayTable } from '@fullcalendar/resource-common';
export interface ResourceTimeGridProps {
dateProfile: DateProfile | null;
resourceDayTable: AbstractResourceDayTable;
businessHours: EventStore;
eventStore: EventStore;
eventUiBases: EventUiHash;
dateSelection: DateSpan | null;
eventSelection: string;
eventDrag: EventInteractionState | null;
eventResize: EventInteractionState | null;
}
export { ResourceTimeGrid as default, ResourceTimeGrid };
class ResourceTimeGrid extends DateComponent<ResourceTimeGridProps> {
timeGrid: TimeGrid;
constructor(context: ComponentContext, timeGrid: TimeGrid);
destroy(): void;
render(props: ResourceTimeGridProps): void;
renderNowIndicator(date: DateMarker): void;
buildPositionCaches(): void;
queryHit(positionLeft: number, positionTop: number): Hit;
}
}
/*!
FullCalendar Resource Time Grid Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
import { memoize, mapHash, DateComponent, parseFieldSpecs, createPlugin } from '@fullcalendar/core';
import ResourceCommonPlugin, { VResourceSplitter, VResourceJoiner, flattenResources, ResourceDayHeader, DayResourceTable, ResourceDayTable } from '@fullcalendar/resource-common';
import TimeGridPlugin, { buildDayRanges, TimeGridSlicer, AbstractTimeGridView, buildDayTable } from '@fullcalendar/timegrid';
import { ResourceDayGrid } from '@fullcalendar/resource-daygrid';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var ResourceTimeGrid = /** @class */ (function (_super) {
__extends(ResourceTimeGrid, _super);
function ResourceTimeGrid(context, timeGrid) {
var _this = _super.call(this, context, timeGrid.el) || this;
_this.buildDayRanges = memoize(buildDayRanges);
_this.splitter = new VResourceSplitter();
_this.slicers = {};
_this.joiner = new ResourceTimeGridJoiner();
_this.timeGrid = timeGrid;
context.calendar.registerInteractiveComponent(_this, {
el: _this.timeGrid.el
});
return _this;
}
ResourceTimeGrid.prototype.destroy = function () {
this.calendar.unregisterInteractiveComponent(this);
};
ResourceTimeGrid.prototype.render = function (props) {
var _this = this;
var timeGrid = this.timeGrid;
var dateProfile = props.dateProfile, resourceDayTable = props.resourceDayTable;
var dayRanges = this.dayRanges = this.buildDayRanges(resourceDayTable.dayTable, dateProfile, this.dateEnv);
var splitProps = this.splitter.splitProps(props);
this.slicers = mapHash(splitProps, function (split, resourceId) {
return _this.slicers[resourceId] || new TimeGridSlicer();
});
var slicedProps = mapHash(this.slicers, function (slicer, resourceId) {
return slicer.sliceProps(splitProps[resourceId], dateProfile, null, timeGrid, dayRanges);
});
timeGrid.allowAcrossResources = dayRanges.length === 1;
timeGrid.receiveProps(__assign({}, this.joiner.joinProps(slicedProps, resourceDayTable), { dateProfile: dateProfile, cells: resourceDayTable.cells[0] }));
};
ResourceTimeGrid.prototype.renderNowIndicator = function (date) {
var timeGrid = this.timeGrid;
var resourceDayTable = this.props.resourceDayTable;
var nonResourceSegs = this.slicers[''].sliceNowDate(date, timeGrid, this.dayRanges);
var segs = this.joiner.expandSegs(resourceDayTable, nonResourceSegs);
timeGrid.renderNowIndicator(segs, date);
};
ResourceTimeGrid.prototype.buildPositionCaches = function () {
this.timeGrid.buildPositionCaches();
};
ResourceTimeGrid.prototype.queryHit = function (positionLeft, positionTop) {
var rawHit = this.timeGrid.positionToHit(positionLeft, positionTop);
if (rawHit) {
return {
component: this.timeGrid,
dateSpan: {
range: rawHit.dateSpan.range,
allDay: rawHit.dateSpan.allDay,
resourceId: this.props.resourceDayTable.cells[0][rawHit.col].resource.id
},
dayEl: rawHit.dayEl,
rect: {
left: rawHit.relativeRect.left,
right: rawHit.relativeRect.right,
top: rawHit.relativeRect.top,
bottom: rawHit.relativeRect.bottom
},
layer: 0
};
}
};
return ResourceTimeGrid;
}(DateComponent));
var ResourceTimeGridJoiner = /** @class */ (function (_super) {
__extends(ResourceTimeGridJoiner, _super);
function ResourceTimeGridJoiner() {
return _super !== null && _super.apply(this, arguments) || this;
}
ResourceTimeGridJoiner.prototype.transformSeg = function (seg, resourceDayTable, resourceI) {
return [
__assign({}, seg, { col: resourceDayTable.computeCol(seg.col, resourceI) })
];
};
return ResourceTimeGridJoiner;
}(VResourceJoiner));
var ResourceTimeGridView = /** @class */ (function (_super) {
__extends(ResourceTimeGridView, _super);
function ResourceTimeGridView(context, viewSpec, dateProfileGenerator, parentEl) {
var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;
_this.flattenResources = memoize(flattenResources);
_this.buildResourceDayTable = memoize(buildResourceDayTable);
_this.resourceOrderSpecs = parseFieldSpecs(_this.opt('resourceOrder'));
if (_this.opt('columnHeader')) {
_this.header = new ResourceDayHeader(_this.context, _this.el.querySelector('.fc-head-container'));
}
_this.resourceTimeGrid = new ResourceTimeGrid(context, _this.timeGrid);
if (_this.dayGrid) {
_this.resourceDayGrid = new ResourceDayGrid(context, _this.dayGrid);
}
return _this;
}
ResourceTimeGridView.prototype.destroy = function () {
_super.prototype.destroy.call(this);
if (this.header) {
this.header.destroy();
}
this.resourceTimeGrid.destroy();
if (this.resourceDayGrid) {
this.resourceDayGrid.destroy();
}
};
ResourceTimeGridView.prototype.render = function (props) {
_super.prototype.render.call(this, props); // for flags for updateSize
var splitProps = this.splitter.splitProps(props);
var resources = this.flattenResources(props.resourceStore, this.resourceOrderSpecs);
var resourceDayTable = this.buildResourceDayTable(this.props.dateProfile, this.dateProfileGenerator, resources, this.opt('datesAboveResources'));
if (this.header) {
this.header.receiveProps({
resources: resources,
dates: resourceDayTable.dayTable.headerDates,
dateProfile: props.dateProfile,
datesRepDistinctDays: true,
renderIntroHtml: this.renderHeadIntroHtml
});
}
this.resourceTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: props.dateProfile, resourceDayTable: resourceDayTable }));
if (this.resourceDayGrid) {
this.resourceDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: props.dateProfile, resourceDayTable: resourceDayTable, isRigid: false, nextDayThreshold: this.nextDayThreshold }));
}
};
ResourceTimeGridView.prototype.renderNowIndicator = function (date) {
this.resourceTimeGrid.renderNowIndicator(date);
};
ResourceTimeGridView.needsResourceData = true; // for ResourceViewProps
return ResourceTimeGridView;
}(AbstractTimeGridView));
function buildResourceDayTable(dateProfile, dateProfileGenerator, resources, datesAboveResources) {
var dayTable = buildDayTable(dateProfile, dateProfileGenerator);
return datesAboveResources ?
new DayResourceTable(dayTable, resources) :
new ResourceDayTable(dayTable, resources);
}
var main = createPlugin({
deps: [ResourceCommonPlugin, TimeGridPlugin],
defaultView: 'resourceTimeGridDay',
views: {
resourceTimeGrid: {
class: ResourceTimeGridView,
// TODO: wish we didn't have to C&P from timeGrid's file
allDaySlot: true,
slotDuration: '00:30:00',
slotEventOverlap: true // a bad name. confused with overlap/constraint system
},
resourceTimeGridDay: {
type: 'resourceTimeGrid',
duration: { days: 1 }
},
resourceTimeGridWeek: {
type: 'resourceTimeGrid',
duration: { weeks: 1 }
}
}
});
export default main;
export { ResourceTimeGrid, ResourceTimeGridView };
/*!
FullCalendar Resource Time Grid Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core'), require('@fullcalendar/resource-common'), require('@fullcalendar/timegrid'), require('@fullcalendar/resource-daygrid')) :
typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core', '@fullcalendar/resource-common', '@fullcalendar/timegrid', '@fullcalendar/resource-daygrid'], factory) :
(global = global || self, factory(global.FullCalendarResourceTimeGrid = {}, global.FullCalendar, global.FullCalendarResourceCommon, global.FullCalendarTimeGrid, global.FullCalendarResourceDayGrid));
}(this, function (exports, core, ResourceCommonPlugin, TimeGridPlugin, resourceDaygrid) { 'use strict';
var ResourceCommonPlugin__default = 'default' in ResourceCommonPlugin ? ResourceCommonPlugin['default'] : ResourceCommonPlugin;
var TimeGridPlugin__default = 'default' in TimeGridPlugin ? TimeGridPlugin['default'] : TimeGridPlugin;
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var ResourceTimeGrid = /** @class */ (function (_super) {
__extends(ResourceTimeGrid, _super);
function ResourceTimeGrid(context, timeGrid) {
var _this = _super.call(this, context, timeGrid.el) || this;
_this.buildDayRanges = core.memoize(TimeGridPlugin.buildDayRanges);
_this.splitter = new ResourceCommonPlugin.VResourceSplitter();
_this.slicers = {};
_this.joiner = new ResourceTimeGridJoiner();
_this.timeGrid = timeGrid;
context.calendar.registerInteractiveComponent(_this, {
el: _this.timeGrid.el
});
return _this;
}
ResourceTimeGrid.prototype.destroy = function () {
this.calendar.unregisterInteractiveComponent(this);
};
ResourceTimeGrid.prototype.render = function (props) {
var _this = this;
var timeGrid = this.timeGrid;
var dateProfile = props.dateProfile, resourceDayTable = props.resourceDayTable;
var dayRanges = this.dayRanges = this.buildDayRanges(resourceDayTable.dayTable, dateProfile, this.dateEnv);
var splitProps = this.splitter.splitProps(props);
this.slicers = core.mapHash(splitProps, function (split, resourceId) {
return _this.slicers[resourceId] || new TimeGridPlugin.TimeGridSlicer();
});
var slicedProps = core.mapHash(this.slicers, function (slicer, resourceId) {
return slicer.sliceProps(splitProps[resourceId], dateProfile, null, timeGrid, dayRanges);
});
timeGrid.allowAcrossResources = dayRanges.length === 1;
timeGrid.receiveProps(__assign({}, this.joiner.joinProps(slicedProps, resourceDayTable), { dateProfile: dateProfile, cells: resourceDayTable.cells[0] }));
};
ResourceTimeGrid.prototype.renderNowIndicator = function (date) {
var timeGrid = this.timeGrid;
var resourceDayTable = this.props.resourceDayTable;
var nonResourceSegs = this.slicers[''].sliceNowDate(date, timeGrid, this.dayRanges);
var segs = this.joiner.expandSegs(resourceDayTable, nonResourceSegs);
timeGrid.renderNowIndicator(segs, date);
};
ResourceTimeGrid.prototype.buildPositionCaches = function () {
this.timeGrid.buildPositionCaches();
};
ResourceTimeGrid.prototype.queryHit = function (positionLeft, positionTop) {
var rawHit = this.timeGrid.positionToHit(positionLeft, positionTop);
if (rawHit) {
return {
component: this.timeGrid,
dateSpan: {
range: rawHit.dateSpan.range,
allDay: rawHit.dateSpan.allDay,
resourceId: this.props.resourceDayTable.cells[0][rawHit.col].resource.id
},
dayEl: rawHit.dayEl,
rect: {
left: rawHit.relativeRect.left,
right: rawHit.relativeRect.right,
top: rawHit.relativeRect.top,
bottom: rawHit.relativeRect.bottom
},
layer: 0
};
}
};
return ResourceTimeGrid;
}(core.DateComponent));
var ResourceTimeGridJoiner = /** @class */ (function (_super) {
__extends(ResourceTimeGridJoiner, _super);
function ResourceTimeGridJoiner() {
return _super !== null && _super.apply(this, arguments) || this;
}
ResourceTimeGridJoiner.prototype.transformSeg = function (seg, resourceDayTable, resourceI) {
return [
__assign({}, seg, { col: resourceDayTable.computeCol(seg.col, resourceI) })
];
};
return ResourceTimeGridJoiner;
}(ResourceCommonPlugin.VResourceJoiner));
var ResourceTimeGridView = /** @class */ (function (_super) {
__extends(ResourceTimeGridView, _super);
function ResourceTimeGridView(context, viewSpec, dateProfileGenerator, parentEl) {
var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;
_this.flattenResources = core.memoize(ResourceCommonPlugin.flattenResources);
_this.buildResourceDayTable = core.memoize(buildResourceDayTable);
_this.resourceOrderSpecs = core.parseFieldSpecs(_this.opt('resourceOrder'));
if (_this.opt('columnHeader')) {
_this.header = new ResourceCommonPlugin.ResourceDayHeader(_this.context, _this.el.querySelector('.fc-head-container'));
}
_this.resourceTimeGrid = new ResourceTimeGrid(context, _this.timeGrid);
if (_this.dayGrid) {
_this.resourceDayGrid = new resourceDaygrid.ResourceDayGrid(context, _this.dayGrid);
}
return _this;
}
ResourceTimeGridView.prototype.destroy = function () {
_super.prototype.destroy.call(this);
if (this.header) {
this.header.destroy();
}
this.resourceTimeGrid.destroy();
if (this.resourceDayGrid) {
this.resourceDayGrid.destroy();
}
};
ResourceTimeGridView.prototype.render = function (props) {
_super.prototype.render.call(this, props); // for flags for updateSize
var splitProps = this.splitter.splitProps(props);
var resources = this.flattenResources(props.resourceStore, this.resourceOrderSpecs);
var resourceDayTable = this.buildResourceDayTable(this.props.dateProfile, this.dateProfileGenerator, resources, this.opt('datesAboveResources'));
if (this.header) {
this.header.receiveProps({
resources: resources,
dates: resourceDayTable.dayTable.headerDates,
dateProfile: props.dateProfile,
datesRepDistinctDays: true,
renderIntroHtml: this.renderHeadIntroHtml
});
}
this.resourceTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: props.dateProfile, resourceDayTable: resourceDayTable }));
if (this.resourceDayGrid) {
this.resourceDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: props.dateProfile, resourceDayTable: resourceDayTable, isRigid: false, nextDayThreshold: this.nextDayThreshold }));
}
};
ResourceTimeGridView.prototype.renderNowIndicator = function (date) {
this.resourceTimeGrid.renderNowIndicator(date);
};
ResourceTimeGridView.needsResourceData = true; // for ResourceViewProps
return ResourceTimeGridView;
}(TimeGridPlugin.AbstractTimeGridView));
function buildResourceDayTable(dateProfile, dateProfileGenerator, resources, datesAboveResources) {
var dayTable = TimeGridPlugin.buildDayTable(dateProfile, dateProfileGenerator);
return datesAboveResources ?
new ResourceCommonPlugin.DayResourceTable(dayTable, resources) :
new ResourceCommonPlugin.ResourceDayTable(dayTable, resources);
}
var main = core.createPlugin({
deps: [ResourceCommonPlugin__default, TimeGridPlugin__default],
defaultView: 'resourceTimeGridDay',
views: {
resourceTimeGrid: {
class: ResourceTimeGridView,
// TODO: wish we didn't have to C&P from timeGrid's file
allDaySlot: true,
slotDuration: '00:30:00',
slotEventOverlap: true // a bad name. confused with overlap/constraint system
},
resourceTimeGridDay: {
type: 'resourceTimeGrid',
duration: { days: 1 }
},
resourceTimeGridWeek: {
type: 'resourceTimeGrid',
duration: { weeks: 1 }
}
}
});
exports.ResourceTimeGrid = ResourceTimeGrid;
exports.ResourceTimeGridView = ResourceTimeGridView;
exports.default = main;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/*!
FullCalendar Resource Time Grid Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@fullcalendar/core"),require("@fullcalendar/resource-common"),require("@fullcalendar/timegrid"),require("@fullcalendar/resource-daygrid")):"function"==typeof define&&define.amd?define(["exports","@fullcalendar/core","@fullcalendar/resource-common","@fullcalendar/timegrid","@fullcalendar/resource-daygrid"],r):r((e=e||self).FullCalendarResourceTimeGrid={},e.FullCalendar,e.FullCalendarResourceCommon,e.FullCalendarTimeGrid,e.FullCalendarResourceDayGrid)}(this,function(e,r,t,i,o){"use strict";var s="default"in t?t.default:t,a="default"in i?i.default:i,n=function(e,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)};function l(e,r){function t(){this.constructor=e}n(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}var c=function(){return(c=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)},d=function(e){function o(o,s){var a=e.call(this,o,s.el)||this;return a.buildDayRanges=r.memoize(i.buildDayRanges),a.splitter=new t.VResourceSplitter,a.slicers={},a.joiner=new u,a.timeGrid=s,o.calendar.registerInteractiveComponent(a,{el:a.timeGrid.el}),a}return l(o,e),o.prototype.destroy=function(){this.calendar.unregisterInteractiveComponent(this)},o.prototype.render=function(e){var t=this,o=this.timeGrid,s=e.dateProfile,a=e.resourceDayTable,n=this.dayRanges=this.buildDayRanges(a.dayTable,s,this.dateEnv),l=this.splitter.splitProps(e);this.slicers=r.mapHash(l,function(e,r){return t.slicers[r]||new i.TimeGridSlicer});var d=r.mapHash(this.slicers,function(e,r){return e.sliceProps(l[r],s,null,o,n)});o.allowAcrossResources=1===n.length,o.receiveProps(c({},this.joiner.joinProps(d,a),{dateProfile:s,cells:a.cells[0]}))},o.prototype.renderNowIndicator=function(e){var r=this.timeGrid,t=this.props.resourceDayTable,i=this.slicers[""].sliceNowDate(e,r,this.dayRanges),o=this.joiner.expandSegs(t,i);r.renderNowIndicator(o,e)},o.prototype.buildPositionCaches=function(){this.timeGrid.buildPositionCaches()},o.prototype.queryHit=function(e,r){var t=this.timeGrid.positionToHit(e,r);if(t)return{component:this.timeGrid,dateSpan:{range:t.dateSpan.range,allDay:t.dateSpan.allDay,resourceId:this.props.resourceDayTable.cells[0][t.col].resource.id},dayEl:t.dayEl,rect:{left:t.relativeRect.left,right:t.relativeRect.right,top:t.relativeRect.top,bottom:t.relativeRect.bottom},layer:0}},o}(r.DateComponent),u=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return l(r,e),r.prototype.transformSeg=function(e,r,t){return[c({},e,{col:r.computeCol(e.col,t)})]},r}(t.VResourceJoiner),p=function(e){function i(i,s,a,n){var l=e.call(this,i,s,a,n)||this;return l.flattenResources=r.memoize(t.flattenResources),l.buildResourceDayTable=r.memoize(y),l.resourceOrderSpecs=r.parseFieldSpecs(l.opt("resourceOrder")),l.opt("columnHeader")&&(l.header=new t.ResourceDayHeader(l.context,l.el.querySelector(".fc-head-container"))),l.resourceTimeGrid=new d(i,l.timeGrid),l.dayGrid&&(l.resourceDayGrid=new o.ResourceDayGrid(i,l.dayGrid)),l}return l(i,e),i.prototype.destroy=function(){e.prototype.destroy.call(this),this.header&&this.header.destroy(),this.resourceTimeGrid.destroy(),this.resourceDayGrid&&this.resourceDayGrid.destroy()},i.prototype.render=function(r){e.prototype.render.call(this,r);var t=this.splitter.splitProps(r),i=this.flattenResources(r.resourceStore,this.resourceOrderSpecs),o=this.buildResourceDayTable(this.props.dateProfile,this.dateProfileGenerator,i,this.opt("datesAboveResources"));this.header&&this.header.receiveProps({resources:i,dates:o.dayTable.headerDates,dateProfile:r.dateProfile,datesRepDistinctDays:!0,renderIntroHtml:this.renderHeadIntroHtml}),this.resourceTimeGrid.receiveProps(c({},t.timed,{dateProfile:r.dateProfile,resourceDayTable:o})),this.resourceDayGrid&&this.resourceDayGrid.receiveProps(c({},t.allDay,{dateProfile:r.dateProfile,resourceDayTable:o,isRigid:!1,nextDayThreshold:this.nextDayThreshold}))},i.prototype.renderNowIndicator=function(e){this.resourceTimeGrid.renderNowIndicator(e)},i.needsResourceData=!0,i}(i.AbstractTimeGridView);function y(e,r,o,s){var a=i.buildDayTable(e,r);return s?new t.DayResourceTable(a,o):new t.ResourceDayTable(a,o)}var f=r.createPlugin({deps:[s,a],defaultView:"resourceTimeGridDay",views:{resourceTimeGrid:{class:p,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},resourceTimeGridDay:{type:"resourceTimeGrid",duration:{days:1}},resourceTimeGridWeek:{type:"resourceTimeGrid",duration:{weeks:1}}}});e.ResourceTimeGrid=d,e.ResourceTimeGridView=p,e.default=f,Object.defineProperty(e,"__esModule",{value:!0})});
\ No newline at end of file
{
"name": "@fullcalendar/resource-timegrid",
"version": "4.3.0",
"title": "FullCalendar Resource Time Grid Plugin",
"description": "Displays events on a vertical resource view with time slots",
"keywords": [
"calendar",
"event",
"full-sized"
],
"homepage": "https://fullcalendar.io/scheduler",
"docs": "https://fullcalendar.io/docs/vertical-resource-view",
"bugs": "https://fullcalendar.io/reporting-bugs",
"repository": {
"type": "git",
"url": "https://github.com/fullcalendar/fullcalendar-scheduler.git",
"homepage": "https://github.com/fullcalendar/fullcalendar-scheduler"
},
"license": "SEE LICENSE IN LICENSE.md",
"author": {
"name": "Adam Shaw",
"email": "arshaw@arshaw.com",
"url": "http://arshaw.com/"
},
"copyright": "2019 Adam Shaw",
"dependencies": {
"@fullcalendar/resource-common": "~4.3.0",
"@fullcalendar/timegrid": "~4.3.0",
"@fullcalendar/resource-daygrid": "~4.3.0"
},
"peerDependencies": {
"@fullcalendar/core": "~4.3.0"
},
"main": "main.js",
"module": "main.esm.js",
"unpkg": "main.min.js",
"types": "main.d.ts"
}
For complete licensing information, visit:
http://fullcalendar.io/scheduler/license
FullCalendar Scheduler is tri-licensed, meaning you must choose
one of three licenses to use. Here is a summary of those licenses:
- Commercial License
(a paid license, meant for commercial use)
http://fullcalendar.io/scheduler/license-details
- Creative Commons Non-Commercial No-Derivatives
(meant for trial and non-commercial use)
https://creativecommons.org/licenses/by-nc-nd/4.0/
- GPLv3 License
(meant for open-source projects)
http://www.gnu.org/licenses/gpl-3.0.en.html
# FullCalendar Resource Timeline Plugin
Display events and resources on a horizontal time axis
[View the docs &raquo;](https://fullcalendar.io/docs/timeline-view)
This package was created from the [FullCalendar monorepo &raquo;](https://github.com/fullcalendar/fullcalendar-scheduler)
/* Divider between resources and time area
--------------------------------------------------------------------------------------------------*/
.fc-timeline .fc-divider {
width: 3px;
border-style: double;
/* overcome neighboring borders */
}
.fc-timeline .fc-head > tr > .fc-divider {
border-bottom: 0;
}
.fc-timeline .fc-body > tr > .fc-divider {
border-top: 0;
}
/* Resource Area
--------------------------------------------------------------------------------------------------*/
.fc-resource-area {
width: 30%;
}
.fc-resource-area col {
width: 40%;
min-width: 70px;
/* will be read by JS */
}
.fc-resource-area col.fc-main-col {
width: 60%;
/* make the first column in a nested setup bigger */
}
.fc-flat .fc-expander-space {
/* fc-flat is opposite of fc-nested */
display: none;
}
.fc-ltr .fc-resource-area tr > * {
text-align: left;
}
.fc-rtl .fc-resource-area tr > * {
text-align: right;
}
.fc-resource-area .fc-cell-content {
padding-left: 4px;
padding-right: 4px;
}
/* head */
.fc-resource-area .fc-super th {
text-align: center;
}
.fc-resource-area th > div {
position: relative;
}
.fc-resource-area th .fc-cell-content {
position: relative;
z-index: 1;
}
.fc-resource-area th .fc-col-resizer {
position: absolute;
z-index: 2;
top: 0;
bottom: 0;
width: 5px;
}
.fc-timeline .fc-col-resizer {
cursor: col-resize;
}
.fc-ltr .fc-resource-area th .fc-col-resizer {
right: -3px;
}
.fc-rtl .fc-resource-area th .fc-col-resizer {
left: -3px;
}
/* body */
.fc-body .fc-resource-area .fc-cell-content {
/* might BE the cell */
padding-top: 8px;
padding-bottom: 8px;
}
.fc-no-overlap .fc-body .fc-resource-area .fc-cell-content {
/* might BE the cell */
padding-top: 6px;
padding-bottom: 6px;
}
.fc-resource-area .fc-icon {
/* the expander and spacers before the expander */
display: inline-block;
width: 1em;
/* ensure constant width, esp for empty icons */
text-align: center;
}
.fc-resource-area .fc-expander {
cursor: pointer;
opacity: 0.65;
}
/* body resource rows */
.fc-time-area .fc-rows {
position: relative;
z-index: 3;
}
.fc-time-area .fc-rows td > div {
position: relative;
}
.fc-time-area .fc-rows .fc-bgevent-container,
.fc-time-area .fc-rows .fc-highlight-container {
z-index: 1;
}
// Generated by dts-bundle v0.7.3-fork.1
// Dependencies for this module:
// ../../../../../@fullcalendar/core
// ../../../../../@fullcalendar/timeline
// ../../../../../@fullcalendar/resource-common
declare module '@fullcalendar/resource-timeline' {
import ResourceTimelineView from '@fullcalendar/resource-timeline/ResourceTimelineView';
export { ResourceTimelineView };
const _default: import("@fullcalendar/core").PluginDef;
export default _default;
}
declare module '@fullcalendar/resource-timeline/ResourceTimelineView' {
import { ElementDragging, SplittableProps, PositionCache, Hit, View, ViewSpec, ComponentContext, DateProfileGenerator, DateProfile, Duration } from '@fullcalendar/core';
import { ScrollJoiner, TimelineLane, StickyScroller, TimeAxis } from '@fullcalendar/timeline';
import { GroupNode, ResourceNode, ResourceViewProps } from '@fullcalendar/resource-common';
import GroupRow from '@fullcalendar/resource-timeline/GroupRow';
import ResourceRow from '@fullcalendar/resource-timeline/ResourceRow';
import Spreadsheet from '@fullcalendar/resource-timeline/Spreadsheet';
export { ResourceTimelineView as default, ResourceTimelineView };
class ResourceTimelineView extends View {
static needsResourceData: boolean;
props: ResourceViewProps;
spreadsheet: Spreadsheet;
timeAxis: TimeAxis;
lane: TimelineLane;
bodyScrollJoiner: ScrollJoiner;
spreadsheetBodyStickyScroller: StickyScroller;
isStickyScrollDirty: boolean;
timeAxisTbody: HTMLElement;
miscHeight: number;
rowNodes: (GroupNode | ResourceNode)[];
rowComponents: (GroupRow | ResourceRow)[];
rowComponentsById: {
[id: string]: (GroupRow | ResourceRow);
};
resourceAreaHeadEl: HTMLElement;
resourceAreaWidth?: number;
resourceAreaWidthDraggings: ElementDragging[];
superHeaderText: any;
isVGrouping: any;
isHGrouping: any;
groupSpecs: any;
colSpecs: any;
orderSpecs: any;
rowPositions: PositionCache;
constructor(context: ComponentContext, viewSpec: ViewSpec, dateProfileGenerator: DateProfileGenerator, parentEl: HTMLElement);
renderSkeletonHtml(): string;
render(props: ResourceViewProps): void;
updateHasNesting(isNesting: boolean): void;
diffRows(newNodes: any): void;
addRow(index: any, rowNode: any): void;
removeRows(startIndex: any, len: any, oldRowNodes: any): void;
buildChildComponent(node: (GroupNode | ResourceNode), spreadsheetTbody: HTMLElement, spreadsheetNext: HTMLElement, timeAxisTbody: HTMLElement, timeAxisNext: HTMLElement): GroupRow | ResourceRow;
renderRows(dateProfile: DateProfile, fallbackBusinessHours: any, splitProps: {
[resourceId: string]: SplittableProps;
}): void;
updateSize(isResize: any, viewHeight: any, isAuto: any): void;
syncHeadHeights(): void;
updateRowSizes(isResize: boolean): number;
destroy(): void;
getNowIndicatorUnit(dateProfile: DateProfile): string;
renderNowIndicator(date: any): void;
unrenderNowIndicator(): void;
queryScroll(): any;
applyScroll(scroll: any, isResize: any): void;
computeDateScroll(duration: Duration): {
left: number;
};
queryDateScroll(): {
left: number;
};
applyDateScroll(scroll: any): void;
queryResourceScroll(): any;
applyResourceScroll(scroll: any): void;
buildPositionCaches(): void;
queryHit(positionLeft: number, positionTop: number): Hit;
setResourceAreaWidth(widthVal: any): void;
initResourceAreaWidthDragging(): void;
}
}
declare module '@fullcalendar/resource-timeline/GroupRow' {
import { Group } from '@fullcalendar/resource-common';
import Row from '@fullcalendar/resource-timeline/Row';
export interface GroupRowProps {
spreadsheetColCnt: number;
id: string;
isExpanded: boolean;
group: Group;
}
export { GroupRow as default, GroupRow };
class GroupRow extends Row<GroupRowProps> {
spreadsheetHeightEl: HTMLElement;
timeAxisHeightEl: HTMLElement;
expanderIconEl: HTMLElement;
render(props: GroupRowProps): void;
destroy(): void;
renderCells(group: Group, spreadsheetColCnt: number): void;
unrenderCells(): void;
renderSpreadsheetContent(group: Group): HTMLElement;
renderCellText(group: Group): any;
getHeightEls(): HTMLElement[];
updateExpanderIcon(isExpanded: boolean): void;
onExpanderClick: (ev: UIEvent) => void;
}
}
declare module '@fullcalendar/resource-timeline/ResourceRow' {
import { Duration, ComponentContext, EventInteractionState, DateSpan, EventUiHash, EventStore, DateProfile } from '@fullcalendar/core';
import { TimelineLane, TimeAxis } from '@fullcalendar/timeline';
import Row from '@fullcalendar/resource-timeline/Row';
import SpreadsheetRow from '@fullcalendar/resource-timeline/SpreadsheetRow';
import { Resource } from '@fullcalendar/resource-common';
export interface ResourceRowProps {
dateProfile: DateProfile;
nextDayThreshold: Duration;
businessHours: EventStore | null;
eventStore: EventStore | null;
eventUiBases: EventUiHash;
dateSelection: DateSpan | null;
eventSelection: string;
eventDrag: EventInteractionState | null;
eventResize: EventInteractionState | null;
colSpecs: any;
id: string;
rowSpans: number[];
depth: number;
isExpanded: boolean;
hasChildren: boolean;
resource: Resource;
}
export { ResourceRow as default, ResourceRow };
class ResourceRow extends Row<ResourceRowProps> {
innerContainerEl: HTMLElement;
spreadsheetRow: SpreadsheetRow;
lane: TimelineLane;
constructor(context: ComponentContext, a: any, b: any, c: any, d: any, timeAxis: TimeAxis);
destroy(): void;
render(props: ResourceRowProps): void;
updateSize(isResize: boolean): void;
getHeightEls(): HTMLElement[];
}
}
declare module '@fullcalendar/resource-timeline/Spreadsheet' {
import { Component, ComponentContext } from '@fullcalendar/core';
import { HeaderBodyLayout } from '@fullcalendar/timeline';
import SpreadsheetHeader from '@fullcalendar/resource-timeline/SpreadsheetHeader';
export interface SpreadsheetProps {
superHeaderText: string;
colSpecs: any;
}
export { Spreadsheet as default, Spreadsheet };
class Spreadsheet extends Component<SpreadsheetProps> {
header: SpreadsheetHeader;
layout: HeaderBodyLayout;
bodyContainerEl: HTMLElement;
bodyColGroup: HTMLElement;
bodyTbody: HTMLElement;
bodyColEls: HTMLElement[];
constructor(context: ComponentContext, headParentEl: HTMLElement, bodyParentEl: HTMLElement);
destroy(): void;
render(props: SpreadsheetProps): void;
renderCells(superHeaderText: any, colSpecs: any): void;
unrenderCells(): void;
renderColTags(colSpecs: any): string;
updateSize(isResize: any, totalHeight: any, isAuto: any): void;
applyColWidths(colWidths: (number | string)[]): void;
}
}
declare module '@fullcalendar/resource-timeline/Row' {
import { Component, ComponentContext } from '@fullcalendar/core';
export { Row as default, Row };
abstract class Row<PropsType> extends Component<PropsType> {
spreadsheetTr: HTMLElement;
timeAxisTr: HTMLElement;
isSizeDirty: boolean;
constructor(context: ComponentContext, spreadsheetParent: HTMLElement, spreadsheetNextSibling: HTMLElement, timeAxisParent: HTMLElement, timeAxisNextSibling: HTMLElement);
destroy(): void;
abstract getHeightEls(): HTMLElement[];
updateSize(isResize: boolean): void;
}
}
declare module '@fullcalendar/resource-timeline/SpreadsheetRow' {
import { Component, ComponentContext } from '@fullcalendar/core';
import { Resource } from '@fullcalendar/resource-common';
export interface SpreadsheetRowProps {
colSpecs: any;
id: string;
rowSpans: number[];
depth: number;
isExpanded: boolean;
hasChildren: boolean;
resource: Resource;
}
export { SpreadsheetRow as default, SpreadsheetRow };
class SpreadsheetRow extends Component<SpreadsheetRowProps> {
tr: HTMLElement;
heightEl: HTMLElement;
expanderIconEl: HTMLElement;
constructor(context: ComponentContext, tr: HTMLElement);
render(props: SpreadsheetRowProps): void;
destroy(): void;
renderRow(resource: Resource, rowSpans: number[], depth: number, colSpecs: any): void;
unrenderRow(): void;
updateExpanderIcon(hasChildren: boolean, isExpanded: boolean): void;
onExpanderClick: (ev: UIEvent) => void;
}
}
declare module '@fullcalendar/resource-timeline/SpreadsheetHeader' {
import { ElementDragging, Component, ComponentContext, EmitterMixin } from '@fullcalendar/core';
export interface SpreadsheetHeaderProps {
superHeaderText: string;
colSpecs: any;
colTags: string;
}
export { SpreadsheetHeader as default, SpreadsheetHeader };
class SpreadsheetHeader extends Component<SpreadsheetHeaderProps> {
tableEl: HTMLElement;
resizerEls: HTMLElement[];
resizables: ElementDragging[];
thEls: HTMLElement[];
colEls: HTMLElement[];
colWidths: number[];
emitter: EmitterMixin;
constructor(context: ComponentContext, parentEl: HTMLElement);
destroy(): void;
render(props: SpreadsheetHeaderProps): void;
initColResizing(): void;
}
}
/*!
FullCalendar Resource Timeline Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
import { removeElement, Component, memoizeRendering, createElement, htmlToElement, htmlEscape, isArraysEqual, EmitterMixin, memoize, parseFieldSpecs, PositionCache, applyStyleProp, View, createPlugin } from '@fullcalendar/core';
import TimelinePlugin, { TimelineLane, HeaderBodyLayout, TimeAxis, ScrollJoiner, StickyScroller } from '@fullcalendar/timeline';
import ResourceCommonPlugin, { isGroupsEqual, buildResourceFields, buildResourceTextFunc, ResourceApi, ResourceSplitter, buildRowNodes } from '@fullcalendar/resource-common';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var Row = /** @class */ (function (_super) {
__extends(Row, _super);
function Row(context, spreadsheetParent, spreadsheetNextSibling, timeAxisParent, timeAxisNextSibling) {
var _this = _super.call(this, context) || this;
_this.isSizeDirty = false;
spreadsheetParent.insertBefore(_this.spreadsheetTr = document.createElement('tr'), spreadsheetNextSibling);
timeAxisParent.insertBefore(_this.timeAxisTr = document.createElement('tr'), timeAxisNextSibling);
return _this;
}
Row.prototype.destroy = function () {
removeElement(this.spreadsheetTr);
removeElement(this.timeAxisTr);
_super.prototype.destroy.call(this);
};
Row.prototype.updateSize = function (isResize) {
this.isSizeDirty = false;
};
return Row;
}(Component));
function updateExpanderIcon(el, isExpanded) {
var classList = el.classList;
if (isExpanded) {
classList.remove('fc-icon-plus-square');
classList.add('fc-icon-minus-square');
}
else {
classList.remove('fc-icon-minus-square');
classList.add('fc-icon-plus-square');
}
}
function clearExpanderIcon(el) {
var classList = el.classList;
classList.remove('fc-icon-minus-square');
classList.remove('fc-icon-plus-square');
}
function updateTrResourceId(tr, resourceId) {
tr.setAttribute('data-resource-id', resourceId);
}
var GroupRow = /** @class */ (function (_super) {
__extends(GroupRow, _super);
function GroupRow() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._renderCells = memoizeRendering(_this.renderCells, _this.unrenderCells);
_this._updateExpanderIcon = memoizeRendering(_this.updateExpanderIcon, null, [_this._renderCells]);
_this.onExpanderClick = function (ev) {
var props = _this.props;
_this.calendar.dispatch({
type: 'SET_RESOURCE_ENTITY_EXPANDED',
id: props.id,
isExpanded: !props.isExpanded
});
};
return _this;
}
GroupRow.prototype.render = function (props) {
this._renderCells(props.group, props.spreadsheetColCnt);
this._updateExpanderIcon(props.isExpanded);
this.isSizeDirty = true;
};
GroupRow.prototype.destroy = function () {
_super.prototype.destroy.call(this);
this._renderCells.unrender(); // should unrender everything else
};
GroupRow.prototype.renderCells = function (group, spreadsheetColCnt) {
var spreadsheetContentEl = this.renderSpreadsheetContent(group);
this.spreadsheetTr.appendChild(createElement('td', {
className: 'fc-divider',
colSpan: spreadsheetColCnt // span across all columns
}, this.spreadsheetHeightEl = createElement('div', null, spreadsheetContentEl)) // needed by setTrInnerHeight
);
this.expanderIconEl = spreadsheetContentEl.querySelector('.fc-icon');
this.expanderIconEl.parentElement.addEventListener('click', this.onExpanderClick);
// insert a single cell, with a single empty <div>.
// there will be no content
this.timeAxisTr.appendChild(createElement('td', { className: 'fc-divider' }, this.timeAxisHeightEl = document.createElement('div')));
};
GroupRow.prototype.unrenderCells = function () {
this.spreadsheetTr.innerHTML = '';
this.timeAxisTr.innerHTML = '';
};
/*
Renders the content wrapper element that will be inserted into this row's TD cell.
*/
GroupRow.prototype.renderSpreadsheetContent = function (group) {
var text = this.renderCellText(group);
var contentEl = htmlToElement('<div class="fc-cell-content">' +
'<span class="fc-expander">' +
'<span class="fc-icon"></span>' +
'</span>' +
'<span class="fc-cell-text">' +
(text ? htmlEscape(text) : '&nbsp;') +
'</span>' +
'</div>');
var filter = group.spec.render;
if (typeof filter === 'function') {
contentEl = filter(contentEl, group.value) || contentEl;
}
return contentEl;
};
GroupRow.prototype.renderCellText = function (group) {
var text = group.value || ''; // might be null/undefined if an ad-hoc grouping
var filter = group.spec.text;
if (typeof filter === 'function') {
text = filter(text) || text;
}
return text;
};
GroupRow.prototype.getHeightEls = function () {
return [this.spreadsheetHeightEl, this.timeAxisHeightEl];
};
GroupRow.prototype.updateExpanderIcon = function (isExpanded) {
updateExpanderIcon(this.expanderIconEl, isExpanded);
};
return GroupRow;
}(Row));
GroupRow.addEqualityFuncs({
group: isGroupsEqual // HACK for ResourceTimelineView::renderRows
});
var SpreadsheetRow = /** @class */ (function (_super) {
__extends(SpreadsheetRow, _super);
function SpreadsheetRow(context, tr) {
var _this = _super.call(this, context) || this;
_this._renderRow = memoizeRendering(_this.renderRow, _this.unrenderRow);
_this._updateTrResourceId = memoizeRendering(updateTrResourceId, null, [_this._renderRow]);
_this._updateExpanderIcon = memoizeRendering(_this.updateExpanderIcon, null, [_this._renderRow]);
_this.onExpanderClick = function (ev) {
var props = _this.props;
_this.calendar.dispatch({
type: 'SET_RESOURCE_ENTITY_EXPANDED',
id: props.id,
isExpanded: !props.isExpanded
});
};
_this.tr = tr;
return _this;
}
SpreadsheetRow.prototype.render = function (props) {
this._renderRow(props.resource, props.rowSpans, props.depth, props.colSpecs);
this._updateTrResourceId(this.tr, props.resource.id); // TODO: only use public ID?
this._updateExpanderIcon(props.hasChildren, props.isExpanded);
};
SpreadsheetRow.prototype.destroy = function () {
_super.prototype.destroy.call(this);
this._renderRow.unrender(); // should unrender everything else
};
SpreadsheetRow.prototype.renderRow = function (resource, rowSpans, depth, colSpecs) {
var _a = this, tr = _a.tr, theme = _a.theme, calendar = _a.calendar, view = _a.view;
var resourceFields = buildResourceFields(resource); // slightly inefficient. already done up the call stack
var mainTd;
for (var i = 0; i < colSpecs.length; i++) {
var colSpec = colSpecs[i];
var rowSpan = rowSpans[i];
if (rowSpan === 0) { // not responsible for group-based rows. VRowGroup is
continue;
}
else if (rowSpan == null) {
rowSpan = 1;
}
var text = void 0;
if (colSpec.field) {
text = resourceFields[colSpec.field];
}
else {
text = buildResourceTextFunc(colSpec.text, calendar)(resource);
}
var contentEl = htmlToElement('<div class="fc-cell-content">' +
(colSpec.isMain ? renderIconHtml(depth) : '') +
'<span class="fc-cell-text">' +
(text ? htmlEscape(text) : '&nbsp;') +
'</span>' +
'</div>');
if (typeof colSpec.render === 'function') { // a filter function for the element
contentEl = colSpec.render(new ResourceApi(calendar, resource), contentEl) || contentEl;
}
if (rowSpan > 1) {
contentEl.classList.add('fc-sticky');
}
var td = createElement('td', {
className: theme.getClass('widgetContent'),
rowspan: rowSpan
}, contentEl);
// the first cell of the row needs to have an inner div for setTrInnerHeight
if (colSpec.isMain) {
td.appendChild(this.heightEl = createElement('div', null, td.childNodes) // inner wrap
);
mainTd = td;
}
tr.appendChild(td);
}
this.expanderIconEl = tr.querySelector('.fc-expander-space .fc-icon');
// wait until very end
view.publiclyTrigger('resourceRender', [
{
resource: new ResourceApi(calendar, resource),
el: mainTd,
view: view
}
]);
};
SpreadsheetRow.prototype.unrenderRow = function () {
this.tr.innerHTML = '';
};
SpreadsheetRow.prototype.updateExpanderIcon = function (hasChildren, isExpanded) {
var expanderIconEl = this.expanderIconEl;
var expanderEl = expanderIconEl.parentElement;
if (expanderIconEl &&
expanderEl // why would this be null?? was the case in IE11
) {
if (hasChildren) {
expanderEl.addEventListener('click', this.onExpanderClick);
expanderEl.classList.add('fc-expander');
updateExpanderIcon(expanderIconEl, isExpanded);
}
else {
expanderEl.removeEventListener('click', this.onExpanderClick);
expanderEl.classList.remove('fc-expander');
clearExpanderIcon(expanderIconEl);
}
}
};
return SpreadsheetRow;
}(Component));
/*
Renders the HTML responsible for the subrow expander area,
as well as the space before it (used to align expanders of similar depths)
*/
function renderIconHtml(depth) {
var html = '';
for (var i = 0; i < depth; i++) {
html += '<span class="fc-icon"></span>';
}
html +=
'<span class="fc-expander-space">' +
'<span class="fc-icon"></span>' +
'</span>';
return html;
}
var ResourceRow = /** @class */ (function (_super) {
__extends(ResourceRow, _super);
function ResourceRow(context, a, b, c, d, timeAxis) {
var _this = _super.call(this, context, a, b, c, d) || this;
_this._updateTrResourceId = memoizeRendering(updateTrResourceId);
_this.spreadsheetRow = new SpreadsheetRow(context, _this.spreadsheetTr);
_this.timeAxisTr.appendChild(createElement('td', { className: _this.theme.getClass('widgetContent') }, _this.innerContainerEl = document.createElement('div')));
_this.lane = new TimelineLane(context, _this.innerContainerEl, _this.innerContainerEl, timeAxis);
return _this;
}
ResourceRow.prototype.destroy = function () {
this.spreadsheetRow.destroy();
this.lane.destroy();
_super.prototype.destroy.call(this);
};
ResourceRow.prototype.render = function (props) {
// spreadsheetRow handles calling updateTrResourceId for spreadsheetTr
this.spreadsheetRow.receiveProps({
colSpecs: props.colSpecs,
id: props.id,
rowSpans: props.rowSpans,
depth: props.depth,
isExpanded: props.isExpanded,
hasChildren: props.hasChildren,
resource: props.resource
});
this._updateTrResourceId(this.timeAxisTr, props.resource.id);
this.lane.receiveProps({
dateProfile: props.dateProfile,
nextDayThreshold: props.nextDayThreshold,
businessHours: props.businessHours,
eventStore: props.eventStore,
eventUiBases: props.eventUiBases,
dateSelection: props.dateSelection,
eventSelection: props.eventSelection,
eventDrag: props.eventDrag,
eventResize: props.eventResize
});
this.isSizeDirty = true;
};
ResourceRow.prototype.updateSize = function (isResize) {
_super.prototype.updateSize.call(this, isResize);
this.lane.updateSize(isResize);
};
ResourceRow.prototype.getHeightEls = function () {
return [this.spreadsheetRow.heightEl, this.innerContainerEl];
};
return ResourceRow;
}(Row));
ResourceRow.addEqualityFuncs({
rowSpans: isArraysEqual // HACK for isSizeDirty, ResourceTimelineView::renderRows
});
var COL_MIN_WIDTH = 30;
var SpreadsheetHeader = /** @class */ (function (_super) {
__extends(SpreadsheetHeader, _super);
function SpreadsheetHeader(context, parentEl) {
var _this = _super.call(this, context) || this;
_this.resizables = [];
_this.colWidths = [];
_this.emitter = new EmitterMixin();
parentEl.appendChild(_this.tableEl = createElement('table', {
className: _this.theme.getClass('tableGrid')
}));
return _this;
}
SpreadsheetHeader.prototype.destroy = function () {
for (var _i = 0, _a = this.resizables; _i < _a.length; _i++) {
var resizable = _a[_i];
resizable.destroy();
}
removeElement(this.tableEl);
_super.prototype.destroy.call(this);
};
SpreadsheetHeader.prototype.render = function (props) {
var theme = this.theme;
var colSpecs = props.colSpecs;
var html = '<colgroup>' + props.colTags + '</colgroup>' +
'<tbody>';
if (props.superHeaderText) {
html +=
'<tr class="fc-super">' +
'<th class="' + theme.getClass('widgetHeader') + '" colspan="' + colSpecs.length + '">' +
'<div class="fc-cell-content">' +
'<span class="fc-cell-text">' +
htmlEscape(props.superHeaderText) +
'</span>' +
'</div>' +
'</th>' +
'</tr>';
}
html += '<tr>';
for (var i = 0; i < colSpecs.length; i++) {
var o = colSpecs[i];
var isLast = i === (colSpecs.length - 1);
html +=
"<th class=\"" + theme.getClass('widgetHeader') + "\">" +
'<div>' +
'<div class="fc-cell-content">' +
(o.isMain ?
'<span class="fc-expander-space">' +
'<span class="fc-icon"></span>' +
'</span>' :
'') +
'<span class="fc-cell-text">' +
htmlEscape(o.labelText || '') + // what about normalizing this value ahead of time?
'</span>' +
'</div>' +
(!isLast ? '<div class="fc-col-resizer"></div>' : '') +
'</div>' +
'</th>';
}
html += '</tr>';
html += '</tbody>';
this.tableEl.innerHTML = html;
this.thEls = Array.prototype.slice.call(this.tableEl.querySelectorAll('th'));
this.colEls = Array.prototype.slice.call(this.tableEl.querySelectorAll('col'));
this.resizerEls = Array.prototype.slice.call(this.tableEl.querySelectorAll('.fc-col-resizer'));
this.initColResizing();
};
SpreadsheetHeader.prototype.initColResizing = function () {
var _this = this;
var ElementDraggingImpl = this.calendar.pluginSystem.hooks.elementDraggingImpl;
if (ElementDraggingImpl) {
this.resizables = this.resizerEls.map(function (handleEl, colIndex) {
var dragging = new ElementDraggingImpl(handleEl);
var startWidth;
dragging.emitter.on('dragstart', function () {
startWidth = _this.colWidths[colIndex];
if (typeof startWidth !== 'number') {
startWidth = _this.thEls[colIndex].getBoundingClientRect().width;
}
});
dragging.emitter.on('dragmove', function (pev) {
_this.colWidths[colIndex] = Math.max(startWidth + pev.deltaX * (_this.isRtl ? -1 : 1), COL_MIN_WIDTH);
_this.emitter.trigger('colwidthchange', _this.colWidths);
});
dragging.setAutoScrollEnabled(false); // because gets weird with auto-scrolling time area
return dragging;
});
}
};
return SpreadsheetHeader;
}(Component));
var Spreadsheet = /** @class */ (function (_super) {
__extends(Spreadsheet, _super);
function Spreadsheet(context, headParentEl, bodyParentEl) {
var _this = _super.call(this, context) || this;
_this._renderCells = memoizeRendering(_this.renderCells, _this.unrenderCells);
_this.layout = new HeaderBodyLayout(headParentEl, bodyParentEl, 'clipped-scroll');
var headerEnhancedScroller = _this.layout.headerScroller.enhancedScroll;
var bodyEnhancedScroller = _this.layout.bodyScroller.enhancedScroll;
_this.header = new SpreadsheetHeader(context, headerEnhancedScroller.canvas.contentEl);
_this.header.emitter.on('colwidthchange', function (colWidths) {
_this.applyColWidths(colWidths);
});
bodyEnhancedScroller.canvas.contentEl
.appendChild(_this.bodyContainerEl = createElement('div', { className: 'fc-rows' }, '<table>' +
'<colgroup />' +
'<tbody />' +
'</table>'));
_this.bodyColGroup = _this.bodyContainerEl.querySelector('colgroup');
_this.bodyTbody = _this.bodyContainerEl.querySelector('tbody');
return _this;
}
Spreadsheet.prototype.destroy = function () {
this.header.destroy();
this.layout.destroy();
this._renderCells.unrender();
_super.prototype.destroy.call(this);
};
Spreadsheet.prototype.render = function (props) {
this._renderCells(props.superHeaderText, props.colSpecs);
};
Spreadsheet.prototype.renderCells = function (superHeaderText, colSpecs) {
var colTags = this.renderColTags(colSpecs);
this.header.receiveProps({
superHeaderText: superHeaderText,
colSpecs: colSpecs,
colTags: colTags
});
this.bodyColGroup.innerHTML = colTags;
this.bodyColEls = Array.prototype.slice.call(this.bodyColGroup.querySelectorAll('col'));
this.applyColWidths(colSpecs.map(function (colSpec) { return colSpec.width; }));
};
Spreadsheet.prototype.unrenderCells = function () {
this.bodyColGroup.innerHTML = '';
};
Spreadsheet.prototype.renderColTags = function (colSpecs) {
var html = '';
for (var _i = 0, colSpecs_1 = colSpecs; _i < colSpecs_1.length; _i++) {
var o = colSpecs_1[_i];
if (o.isMain) {
html += '<col class="fc-main-col"/>';
}
else {
html += '<col/>';
}
}
return html;
};
Spreadsheet.prototype.updateSize = function (isResize, totalHeight, isAuto) {
this.layout.setHeight(totalHeight, isAuto);
};
Spreadsheet.prototype.applyColWidths = function (colWidths) {
var _this = this;
colWidths.forEach(function (colWidth, colIndex) {
var headEl = _this.header.colEls[colIndex]; // bad to access child
var bodyEl = _this.bodyColEls[colIndex];
var styleVal;
if (typeof colWidth === 'number') {
styleVal = colWidth + 'px';
}
else if (typeof colWidth == null) {
styleVal = '';
}
headEl.style.width = bodyEl.style.width = styleVal;
});
};
return Spreadsheet;
}(Component));
var MIN_RESOURCE_AREA_WIDTH = 30; // definitely bigger than scrollbars
var ResourceTimelineView = /** @class */ (function (_super) {
__extends(ResourceTimelineView, _super);
function ResourceTimelineView(context, viewSpec, dateProfileGenerator, parentEl) {
var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;
_this.isStickyScrollDirty = false;
_this.rowNodes = [];
_this.rowComponents = [];
_this.rowComponentsById = {};
_this.resourceAreaWidthDraggings = [];
_this.splitter = new ResourceSplitter(); // doesn't let it do businessHours tho
_this.hasResourceBusinessHours = memoize(hasResourceBusinessHours);
_this.buildRowNodes = memoize(buildRowNodes);
_this.hasNesting = memoize(hasNesting);
_this._updateHasNesting = memoizeRendering(_this.updateHasNesting);
var allColSpecs = _this.opt('resourceColumns') || [];
var labelText = _this.opt('resourceLabelText'); // TODO: view.override
var defaultLabelText = 'Resources'; // TODO: view.defaults
var superHeaderText = null;
if (!allColSpecs.length) {
allColSpecs.push({
labelText: labelText || defaultLabelText,
text: buildResourceTextFunc(_this.opt('resourceText'), _this.calendar)
});
}
else {
superHeaderText = labelText;
}
var plainColSpecs = [];
var groupColSpecs = [];
var groupSpecs = [];
var isVGrouping = false;
var isHGrouping = false;
for (var _i = 0, allColSpecs_1 = allColSpecs; _i < allColSpecs_1.length; _i++) {
var colSpec = allColSpecs_1[_i];
if (colSpec.group) {
groupColSpecs.push(colSpec);
}
else {
plainColSpecs.push(colSpec);
}
}
plainColSpecs[0].isMain = true;
if (groupColSpecs.length) {
groupSpecs = groupColSpecs;
isVGrouping = true;
}
else {
var hGroupField = _this.opt('resourceGroupField');
if (hGroupField) {
isHGrouping = true;
groupSpecs.push({
field: hGroupField,
text: _this.opt('resourceGroupText'),
render: _this.opt('resourceGroupRender')
});
}
}
var allOrderSpecs = parseFieldSpecs(_this.opt('resourceOrder'));
var plainOrderSpecs = [];
for (var _a = 0, allOrderSpecs_1 = allOrderSpecs; _a < allOrderSpecs_1.length; _a++) {
var orderSpec = allOrderSpecs_1[_a];
var isGroup = false;
for (var _b = 0, groupSpecs_1 = groupSpecs; _b < groupSpecs_1.length; _b++) {
var groupSpec = groupSpecs_1[_b];
if (groupSpec.field === orderSpec.field) {
groupSpec.order = orderSpec.order; // -1, 0, 1
isGroup = true;
break;
}
}
if (!isGroup) {
plainOrderSpecs.push(orderSpec);
}
}
_this.superHeaderText = superHeaderText;
_this.isVGrouping = isVGrouping;
_this.isHGrouping = isHGrouping;
_this.groupSpecs = groupSpecs;
_this.colSpecs = groupColSpecs.concat(plainColSpecs);
_this.orderSpecs = plainOrderSpecs;
// START RENDERING...
_this.el.classList.add('fc-timeline');
if (_this.opt('eventOverlap') === false) {
_this.el.classList.add('fc-no-overlap');
}
_this.el.innerHTML = _this.renderSkeletonHtml();
_this.resourceAreaHeadEl = _this.el.querySelector('thead .fc-resource-area');
_this.setResourceAreaWidth(_this.opt('resourceAreaWidth'));
_this.initResourceAreaWidthDragging();
_this.miscHeight = _this.el.getBoundingClientRect().height;
_this.spreadsheet = new Spreadsheet(_this.context, _this.resourceAreaHeadEl, _this.el.querySelector('tbody .fc-resource-area'));
_this.timeAxis = new TimeAxis(_this.context, _this.el.querySelector('thead .fc-time-area'), _this.el.querySelector('tbody .fc-time-area'));
var timeAxisRowContainer = createElement('div', { className: 'fc-rows' }, '<table><tbody /></table>');
_this.timeAxis.layout.bodyScroller.enhancedScroll.canvas.contentEl.appendChild(timeAxisRowContainer);
_this.timeAxisTbody = timeAxisRowContainer.querySelector('tbody');
_this.lane = new TimelineLane(_this.context, null, _this.timeAxis.layout.bodyScroller.enhancedScroll.canvas.bgEl, _this.timeAxis);
_this.bodyScrollJoiner = new ScrollJoiner('vertical', [
_this.spreadsheet.layout.bodyScroller,
_this.timeAxis.layout.bodyScroller
]);
// after scrolljoiner
_this.spreadsheetBodyStickyScroller = new StickyScroller(_this.spreadsheet.layout.bodyScroller.enhancedScroll, _this.isRtl, true // isVertical
);
_this.spreadsheet.receiveProps({
superHeaderText: _this.superHeaderText,
colSpecs: _this.colSpecs
});
// Component...
context.calendar.registerInteractiveComponent(_this, {
el: _this.timeAxis.slats.el
});
return _this;
}
ResourceTimelineView.prototype.renderSkeletonHtml = function () {
var theme = this.theme;
return "<table class=\"" + theme.getClass('tableGrid') + "\"> <thead class=\"fc-head\"> <tr> <td class=\"fc-resource-area " + theme.getClass('widgetHeader') + "\"></td> <td class=\"fc-divider fc-col-resizer " + theme.getClass('widgetHeader') + "\"></td> <td class=\"fc-time-area " + theme.getClass('widgetHeader') + "\"></td> </tr> </thead> <tbody class=\"fc-body\"> <tr> <td class=\"fc-resource-area " + theme.getClass('widgetContent') + "\"></td> <td class=\"fc-divider fc-col-resizer " + theme.getClass('widgetHeader') + "\"></td> <td class=\"fc-time-area " + theme.getClass('widgetContent') + "\"></td> </tr> </tbody> </table>";
};
ResourceTimelineView.prototype.render = function (props) {
_super.prototype.render.call(this, props);
var splitProps = this.splitter.splitProps(props);
var hasResourceBusinessHours = this.hasResourceBusinessHours(props.resourceStore);
this.timeAxis.receiveProps({
dateProfile: props.dateProfile
});
// for all-resource bg events / selections / business-hours
this.lane.receiveProps(__assign({}, splitProps[''], { dateProfile: props.dateProfile, nextDayThreshold: this.nextDayThreshold, businessHours: hasResourceBusinessHours ? null : props.businessHours }));
var newRowNodes = this.buildRowNodes(props.resourceStore, this.groupSpecs, this.orderSpecs, this.isVGrouping, props.resourceEntityExpansions, this.opt('resourcesInitiallyExpanded'));
this._updateHasNesting(this.hasNesting(newRowNodes));
this.diffRows(newRowNodes);
this.renderRows(props.dateProfile, hasResourceBusinessHours ? props.businessHours : null, // CONFUSING, comment
splitProps);
};
ResourceTimelineView.prototype.updateHasNesting = function (isNesting) {
var classList = this.el.classList;
if (isNesting) {
classList.remove('fc-flat');
}
else {
classList.add('fc-flat');
}
};
ResourceTimelineView.prototype.diffRows = function (newNodes) {
var oldNodes = this.rowNodes;
var oldLen = oldNodes.length;
var oldIndexHash = {}; // id -> index
var oldI = 0;
var newI = 0;
for (oldI = 0; oldI < oldLen; oldI++) {
oldIndexHash[oldNodes[oldI].id] = oldI;
}
// iterate new nodes
for (oldI = 0, newI = 0; newI < newNodes.length; newI++) {
var newNode = newNodes[newI];
var oldIFound = oldIndexHash[newNode.id];
if (oldIFound != null && oldIFound >= oldI) {
this.removeRows(newI, oldIFound - oldI, oldNodes); // won't do anything if same index
oldI = oldIFound + 1;
}
else {
this.addRow(newI, newNode);
}
}
// old rows that weren't found need to be removed
this.removeRows(newI, oldLen - oldI, oldNodes); // won't do anything if same index
this.rowNodes = newNodes;
};
/*
rowComponents is the in-progress result
*/
ResourceTimelineView.prototype.addRow = function (index, rowNode) {
var _a = this, rowComponents = _a.rowComponents, rowComponentsById = _a.rowComponentsById;
var nextComponent = rowComponents[index];
var newComponent = this.buildChildComponent(rowNode, this.spreadsheet.bodyTbody, nextComponent ? nextComponent.spreadsheetTr : null, this.timeAxisTbody, nextComponent ? nextComponent.timeAxisTr : null);
rowComponents.splice(index, 0, newComponent);
rowComponentsById[rowNode.id] = newComponent;
};
ResourceTimelineView.prototype.removeRows = function (startIndex, len, oldRowNodes) {
if (len) {
var _a = this, rowComponents = _a.rowComponents, rowComponentsById = _a.rowComponentsById;
for (var i = 0; i < len; i++) {
var rowComponent = rowComponents[startIndex + i];
rowComponent.destroy();
delete rowComponentsById[oldRowNodes[i].id];
}
rowComponents.splice(startIndex, len);
}
};
ResourceTimelineView.prototype.buildChildComponent = function (node, spreadsheetTbody, spreadsheetNext, timeAxisTbody, timeAxisNext) {
if (node.group) {
return new GroupRow(this.context, spreadsheetTbody, spreadsheetNext, timeAxisTbody, timeAxisNext);
}
else if (node.resource) {
return new ResourceRow(this.context, spreadsheetTbody, spreadsheetNext, timeAxisTbody, timeAxisNext, this.timeAxis);
}
};
ResourceTimelineView.prototype.renderRows = function (dateProfile, fallbackBusinessHours, splitProps) {
var _a = this, rowNodes = _a.rowNodes, rowComponents = _a.rowComponents;
for (var i = 0; i < rowNodes.length; i++) {
var rowNode = rowNodes[i];
var rowComponent = rowComponents[i];
if (rowNode.group) {
rowComponent.receiveProps({
spreadsheetColCnt: this.colSpecs.length,
id: rowNode.id,
isExpanded: rowNode.isExpanded,
group: rowNode.group
});
}
else {
var resource = rowNode.resource;
rowComponent.receiveProps(__assign({}, splitProps[resource.id], { dateProfile: dateProfile, nextDayThreshold: this.nextDayThreshold, businessHours: resource.businessHours || fallbackBusinessHours, colSpecs: this.colSpecs, id: rowNode.id, rowSpans: rowNode.rowSpans, depth: rowNode.depth, isExpanded: rowNode.isExpanded, hasChildren: rowNode.hasChildren, resource: rowNode.resource }));
}
}
};
ResourceTimelineView.prototype.updateSize = function (isResize, viewHeight, isAuto) {
// FYI: this ordering is really important
var calendar = this.calendar;
var isBaseSizing = isResize || calendar.isViewUpdated || calendar.isDatesUpdated || calendar.isEventsUpdated;
if (isBaseSizing) {
this.syncHeadHeights();
this.timeAxis.updateSize(isResize, viewHeight - this.miscHeight, isAuto);
this.spreadsheet.updateSize(isResize, viewHeight - this.miscHeight, isAuto);
}
var rowSizingCnt = this.updateRowSizes(isResize);
this.lane.updateSize(isResize); // is efficient. uses flags
if (isBaseSizing || rowSizingCnt) {
this.bodyScrollJoiner.update();
this.timeAxis.layout.scrollJoiner.update(); // hack
this.rowPositions = new PositionCache(this.timeAxis.slats.el, this.rowComponents.map(function (rowComponent) {
return rowComponent.timeAxisTr;
}), false, // isHorizontal
true // isVertical
);
this.rowPositions.build();
this.isStickyScrollDirty = true;
}
};
ResourceTimelineView.prototype.syncHeadHeights = function () {
var spreadsheetHeadEl = this.spreadsheet.header.tableEl;
var timeAxisHeadEl = this.timeAxis.header.tableEl;
spreadsheetHeadEl.style.height = '';
timeAxisHeadEl.style.height = '';
var max = Math.max(spreadsheetHeadEl.getBoundingClientRect().height, timeAxisHeadEl.getBoundingClientRect().height);
spreadsheetHeadEl.style.height =
timeAxisHeadEl.style.height = max + 'px';
};
ResourceTimelineView.prototype.updateRowSizes = function (isResize) {
var dirtyRowComponents = this.rowComponents;
if (!isResize) {
dirtyRowComponents = dirtyRowComponents.filter(function (rowComponent) {
return rowComponent.isSizeDirty;
});
}
var elArrays = dirtyRowComponents.map(function (rowComponent) {
return rowComponent.getHeightEls();
});
// reset to natural heights
for (var _i = 0, elArrays_1 = elArrays; _i < elArrays_1.length; _i++) {
var elArray = elArrays_1[_i];
for (var _a = 0, elArray_1 = elArray; _a < elArray_1.length; _a++) {
var el = elArray_1[_a];
el.style.height = '';
}
}
// let rows update their contents' heights
for (var _b = 0, dirtyRowComponents_1 = dirtyRowComponents; _b < dirtyRowComponents_1.length; _b++) {
var rowComponent = dirtyRowComponents_1[_b];
rowComponent.updateSize(isResize); // will reset isSizeDirty
}
var maxHeights = elArrays.map(function (elArray) {
var maxHeight = null;
for (var _i = 0, elArray_2 = elArray; _i < elArray_2.length; _i++) {
var el = elArray_2[_i];
var height = el.getBoundingClientRect().height;
if (maxHeight === null || height > maxHeight) {
maxHeight = height;
}
}
return maxHeight;
});
for (var i = 0; i < elArrays.length; i++) {
for (var _c = 0, _d = elArrays[i]; _c < _d.length; _c++) {
var el = _d[_c];
el.style.height = maxHeights[i] + 'px';
}
}
return dirtyRowComponents.length;
};
ResourceTimelineView.prototype.destroy = function () {
for (var _i = 0, _a = this.rowComponents; _i < _a.length; _i++) {
var rowComponent = _a[_i];
rowComponent.destroy();
}
this.rowNodes = [];
this.rowComponents = [];
this.spreadsheet.destroy();
this.timeAxis.destroy();
for (var _b = 0, _c = this.resourceAreaWidthDraggings; _b < _c.length; _b++) {
var resourceAreaWidthDragging = _c[_b];
resourceAreaWidthDragging.destroy();
}
this.spreadsheetBodyStickyScroller.destroy();
_super.prototype.destroy.call(this);
this.calendar.unregisterInteractiveComponent(this);
};
// Now Indicator
// ------------------------------------------------------------------------------------------
ResourceTimelineView.prototype.getNowIndicatorUnit = function (dateProfile) {
return this.timeAxis.getNowIndicatorUnit(dateProfile);
};
ResourceTimelineView.prototype.renderNowIndicator = function (date) {
this.timeAxis.renderNowIndicator(date);
};
ResourceTimelineView.prototype.unrenderNowIndicator = function () {
this.timeAxis.unrenderNowIndicator();
};
// Scrolling
// ------------------------------------------------------------------------------------------------------------------
// this is useful for scrolling prev/next dates while resource is scrolled down
ResourceTimelineView.prototype.queryScroll = function () {
var scroll = _super.prototype.queryScroll.call(this);
if (this.props.resourceStore) {
__assign(scroll, this.queryResourceScroll());
}
return scroll;
};
ResourceTimelineView.prototype.applyScroll = function (scroll, isResize) {
_super.prototype.applyScroll.call(this, scroll, isResize);
if (this.props.resourceStore) {
this.applyResourceScroll(scroll);
}
// avoid updating stickyscroll too often
if (isResize || this.isStickyScrollDirty) {
this.isStickyScrollDirty = false;
this.spreadsheetBodyStickyScroller.updateSize();
this.timeAxis.updateStickyScrollers();
}
};
ResourceTimelineView.prototype.computeDateScroll = function (duration) {
return this.timeAxis.computeDateScroll(duration);
};
ResourceTimelineView.prototype.queryDateScroll = function () {
return this.timeAxis.queryDateScroll();
};
ResourceTimelineView.prototype.applyDateScroll = function (scroll) {
this.timeAxis.applyDateScroll(scroll);
};
ResourceTimelineView.prototype.queryResourceScroll = function () {
var _a = this, rowComponents = _a.rowComponents, rowNodes = _a.rowNodes;
var scroll = {};
var scrollerTop = this.timeAxis.layout.bodyScroller.el.getBoundingClientRect().top; // fixed position
for (var i = 0; i < rowComponents.length; i++) {
var rowComponent = rowComponents[i];
var rowNode = rowNodes[i];
var el = rowComponent.timeAxisTr;
var elBottom = el.getBoundingClientRect().bottom; // fixed position
if (elBottom > scrollerTop) {
scroll.rowId = rowNode.id;
scroll.bottom = elBottom - scrollerTop;
break;
}
}
// TODO: what about left scroll state for spreadsheet area?
return scroll;
};
ResourceTimelineView.prototype.applyResourceScroll = function (scroll) {
var rowId = scroll.forcedRowId || scroll.rowId;
if (rowId) {
var rowComponent = this.rowComponentsById[rowId];
if (rowComponent) {
var el = rowComponent.timeAxisTr;
if (el) {
var innerTop = this.timeAxis.layout.bodyScroller.enhancedScroll.canvas.el.getBoundingClientRect().top;
var rowRect = el.getBoundingClientRect();
var scrollTop = (scroll.forcedRowId ?
rowRect.top : // just use top edge
rowRect.bottom - scroll.bottom) - // pixels from bottom edge
innerTop;
this.timeAxis.layout.bodyScroller.enhancedScroll.setScrollTop(scrollTop);
this.spreadsheet.layout.bodyScroller.enhancedScroll.setScrollTop(scrollTop);
}
}
}
};
// TODO: scrollToResource
// Hit System
// ------------------------------------------------------------------------------------------
ResourceTimelineView.prototype.buildPositionCaches = function () {
this.timeAxis.slats.updateSize();
this.rowPositions.build();
};
ResourceTimelineView.prototype.queryHit = function (positionLeft, positionTop) {
var rowPositions = this.rowPositions;
var slats = this.timeAxis.slats;
var rowIndex = rowPositions.topToIndex(positionTop);
if (rowIndex != null) {
var resource = this.rowNodes[rowIndex].resource;
if (resource) { // not a group
var slatHit = slats.positionToHit(positionLeft);
if (slatHit) {
return {
component: this,
dateSpan: {
range: slatHit.dateSpan.range,
allDay: slatHit.dateSpan.allDay,
resourceId: resource.id
},
rect: {
left: slatHit.left,
right: slatHit.right,
top: rowPositions.tops[rowIndex],
bottom: rowPositions.bottoms[rowIndex]
},
dayEl: slatHit.dayEl,
layer: 0
};
}
}
}
};
// Resource Area
// ------------------------------------------------------------------------------------------------------------------
ResourceTimelineView.prototype.setResourceAreaWidth = function (widthVal) {
this.resourceAreaWidth = widthVal;
applyStyleProp(this.resourceAreaHeadEl, 'width', widthVal || '');
};
ResourceTimelineView.prototype.initResourceAreaWidthDragging = function () {
var _this = this;
var resourceAreaDividerEls = Array.prototype.slice.call(this.el.querySelectorAll('.fc-col-resizer'));
var ElementDraggingImpl = this.calendar.pluginSystem.hooks.elementDraggingImpl;
if (ElementDraggingImpl) {
this.resourceAreaWidthDraggings = resourceAreaDividerEls.map(function (el) {
var dragging = new ElementDraggingImpl(el);
var dragStartWidth;
var viewWidth;
dragging.emitter.on('dragstart', function () {
dragStartWidth = _this.resourceAreaWidth;
if (typeof dragStartWidth !== 'number') {
dragStartWidth = _this.resourceAreaHeadEl.getBoundingClientRect().width;
}
viewWidth = _this.el.getBoundingClientRect().width;
});
dragging.emitter.on('dragmove', function (pev) {
var newWidth = dragStartWidth + pev.deltaX * (_this.isRtl ? -1 : 1);
newWidth = Math.max(newWidth, MIN_RESOURCE_AREA_WIDTH);
newWidth = Math.min(newWidth, viewWidth - MIN_RESOURCE_AREA_WIDTH);
_this.setResourceAreaWidth(newWidth);
});
dragging.setAutoScrollEnabled(false); // because gets weird with auto-scrolling time area
return dragging;
});
}
};
ResourceTimelineView.needsResourceData = true; // for ResourceViewProps
return ResourceTimelineView;
}(View));
function hasResourceBusinessHours(resourceStore) {
for (var resourceId in resourceStore) {
var resource = resourceStore[resourceId];
if (resource.businessHours) {
return true;
}
}
return false;
}
function hasNesting(nodes) {
for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
var node = nodes_1[_i];
if (node.group) {
return true;
}
else if (node.resource) {
if (node.hasChildren) {
return true;
}
}
}
return false;
}
var main = createPlugin({
deps: [ResourceCommonPlugin, TimelinePlugin],
defaultView: 'resourceTimelineDay',
views: {
resourceTimeline: {
class: ResourceTimelineView,
resourceAreaWidth: '30%',
resourcesInitiallyExpanded: true,
eventResizableFromStart: true // TODO: not DRY with this same setting in the main timeline config
},
resourceTimelineDay: {
type: 'resourceTimeline',
duration: { days: 1 }
},
resourceTimelineWeek: {
type: 'resourceTimeline',
duration: { weeks: 1 }
},
resourceTimelineMonth: {
type: 'resourceTimeline',
duration: { months: 1 }
},
resourceTimelineYear: {
type: 'resourceTimeline',
duration: { years: 1 }
}
}
});
export default main;
export { ResourceTimelineView };
/*!
FullCalendar Resource Timeline Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core'), require('@fullcalendar/timeline'), require('@fullcalendar/resource-common')) :
typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core', '@fullcalendar/timeline', '@fullcalendar/resource-common'], factory) :
(global = global || self, factory(global.FullCalendarResourceTimeline = {}, global.FullCalendar, global.FullCalendarTimeline, global.FullCalendarResourceCommon));
}(this, function (exports, core, TimelinePlugin, ResourceCommonPlugin) { 'use strict';
var TimelinePlugin__default = 'default' in TimelinePlugin ? TimelinePlugin['default'] : TimelinePlugin;
var ResourceCommonPlugin__default = 'default' in ResourceCommonPlugin ? ResourceCommonPlugin['default'] : ResourceCommonPlugin;
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var Row = /** @class */ (function (_super) {
__extends(Row, _super);
function Row(context, spreadsheetParent, spreadsheetNextSibling, timeAxisParent, timeAxisNextSibling) {
var _this = _super.call(this, context) || this;
_this.isSizeDirty = false;
spreadsheetParent.insertBefore(_this.spreadsheetTr = document.createElement('tr'), spreadsheetNextSibling);
timeAxisParent.insertBefore(_this.timeAxisTr = document.createElement('tr'), timeAxisNextSibling);
return _this;
}
Row.prototype.destroy = function () {
core.removeElement(this.spreadsheetTr);
core.removeElement(this.timeAxisTr);
_super.prototype.destroy.call(this);
};
Row.prototype.updateSize = function (isResize) {
this.isSizeDirty = false;
};
return Row;
}(core.Component));
function updateExpanderIcon(el, isExpanded) {
var classList = el.classList;
if (isExpanded) {
classList.remove('fc-icon-plus-square');
classList.add('fc-icon-minus-square');
}
else {
classList.remove('fc-icon-minus-square');
classList.add('fc-icon-plus-square');
}
}
function clearExpanderIcon(el) {
var classList = el.classList;
classList.remove('fc-icon-minus-square');
classList.remove('fc-icon-plus-square');
}
function updateTrResourceId(tr, resourceId) {
tr.setAttribute('data-resource-id', resourceId);
}
var GroupRow = /** @class */ (function (_super) {
__extends(GroupRow, _super);
function GroupRow() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._renderCells = core.memoizeRendering(_this.renderCells, _this.unrenderCells);
_this._updateExpanderIcon = core.memoizeRendering(_this.updateExpanderIcon, null, [_this._renderCells]);
_this.onExpanderClick = function (ev) {
var props = _this.props;
_this.calendar.dispatch({
type: 'SET_RESOURCE_ENTITY_EXPANDED',
id: props.id,
isExpanded: !props.isExpanded
});
};
return _this;
}
GroupRow.prototype.render = function (props) {
this._renderCells(props.group, props.spreadsheetColCnt);
this._updateExpanderIcon(props.isExpanded);
this.isSizeDirty = true;
};
GroupRow.prototype.destroy = function () {
_super.prototype.destroy.call(this);
this._renderCells.unrender(); // should unrender everything else
};
GroupRow.prototype.renderCells = function (group, spreadsheetColCnt) {
var spreadsheetContentEl = this.renderSpreadsheetContent(group);
this.spreadsheetTr.appendChild(core.createElement('td', {
className: 'fc-divider',
colSpan: spreadsheetColCnt // span across all columns
}, this.spreadsheetHeightEl = core.createElement('div', null, spreadsheetContentEl)) // needed by setTrInnerHeight
);
this.expanderIconEl = spreadsheetContentEl.querySelector('.fc-icon');
this.expanderIconEl.parentElement.addEventListener('click', this.onExpanderClick);
// insert a single cell, with a single empty <div>.
// there will be no content
this.timeAxisTr.appendChild(core.createElement('td', { className: 'fc-divider' }, this.timeAxisHeightEl = document.createElement('div')));
};
GroupRow.prototype.unrenderCells = function () {
this.spreadsheetTr.innerHTML = '';
this.timeAxisTr.innerHTML = '';
};
/*
Renders the content wrapper element that will be inserted into this row's TD cell.
*/
GroupRow.prototype.renderSpreadsheetContent = function (group) {
var text = this.renderCellText(group);
var contentEl = core.htmlToElement('<div class="fc-cell-content">' +
'<span class="fc-expander">' +
'<span class="fc-icon"></span>' +
'</span>' +
'<span class="fc-cell-text">' +
(text ? core.htmlEscape(text) : '&nbsp;') +
'</span>' +
'</div>');
var filter = group.spec.render;
if (typeof filter === 'function') {
contentEl = filter(contentEl, group.value) || contentEl;
}
return contentEl;
};
GroupRow.prototype.renderCellText = function (group) {
var text = group.value || ''; // might be null/undefined if an ad-hoc grouping
var filter = group.spec.text;
if (typeof filter === 'function') {
text = filter(text) || text;
}
return text;
};
GroupRow.prototype.getHeightEls = function () {
return [this.spreadsheetHeightEl, this.timeAxisHeightEl];
};
GroupRow.prototype.updateExpanderIcon = function (isExpanded) {
updateExpanderIcon(this.expanderIconEl, isExpanded);
};
return GroupRow;
}(Row));
GroupRow.addEqualityFuncs({
group: ResourceCommonPlugin.isGroupsEqual // HACK for ResourceTimelineView::renderRows
});
var SpreadsheetRow = /** @class */ (function (_super) {
__extends(SpreadsheetRow, _super);
function SpreadsheetRow(context, tr) {
var _this = _super.call(this, context) || this;
_this._renderRow = core.memoizeRendering(_this.renderRow, _this.unrenderRow);
_this._updateTrResourceId = core.memoizeRendering(updateTrResourceId, null, [_this._renderRow]);
_this._updateExpanderIcon = core.memoizeRendering(_this.updateExpanderIcon, null, [_this._renderRow]);
_this.onExpanderClick = function (ev) {
var props = _this.props;
_this.calendar.dispatch({
type: 'SET_RESOURCE_ENTITY_EXPANDED',
id: props.id,
isExpanded: !props.isExpanded
});
};
_this.tr = tr;
return _this;
}
SpreadsheetRow.prototype.render = function (props) {
this._renderRow(props.resource, props.rowSpans, props.depth, props.colSpecs);
this._updateTrResourceId(this.tr, props.resource.id); // TODO: only use public ID?
this._updateExpanderIcon(props.hasChildren, props.isExpanded);
};
SpreadsheetRow.prototype.destroy = function () {
_super.prototype.destroy.call(this);
this._renderRow.unrender(); // should unrender everything else
};
SpreadsheetRow.prototype.renderRow = function (resource, rowSpans, depth, colSpecs) {
var _a = this, tr = _a.tr, theme = _a.theme, calendar = _a.calendar, view = _a.view;
var resourceFields = ResourceCommonPlugin.buildResourceFields(resource); // slightly inefficient. already done up the call stack
var mainTd;
for (var i = 0; i < colSpecs.length; i++) {
var colSpec = colSpecs[i];
var rowSpan = rowSpans[i];
if (rowSpan === 0) { // not responsible for group-based rows. VRowGroup is
continue;
}
else if (rowSpan == null) {
rowSpan = 1;
}
var text = void 0;
if (colSpec.field) {
text = resourceFields[colSpec.field];
}
else {
text = ResourceCommonPlugin.buildResourceTextFunc(colSpec.text, calendar)(resource);
}
var contentEl = core.htmlToElement('<div class="fc-cell-content">' +
(colSpec.isMain ? renderIconHtml(depth) : '') +
'<span class="fc-cell-text">' +
(text ? core.htmlEscape(text) : '&nbsp;') +
'</span>' +
'</div>');
if (typeof colSpec.render === 'function') { // a filter function for the element
contentEl = colSpec.render(new ResourceCommonPlugin.ResourceApi(calendar, resource), contentEl) || contentEl;
}
if (rowSpan > 1) {
contentEl.classList.add('fc-sticky');
}
var td = core.createElement('td', {
className: theme.getClass('widgetContent'),
rowspan: rowSpan
}, contentEl);
// the first cell of the row needs to have an inner div for setTrInnerHeight
if (colSpec.isMain) {
td.appendChild(this.heightEl = core.createElement('div', null, td.childNodes) // inner wrap
);
mainTd = td;
}
tr.appendChild(td);
}
this.expanderIconEl = tr.querySelector('.fc-expander-space .fc-icon');
// wait until very end
view.publiclyTrigger('resourceRender', [
{
resource: new ResourceCommonPlugin.ResourceApi(calendar, resource),
el: mainTd,
view: view
}
]);
};
SpreadsheetRow.prototype.unrenderRow = function () {
this.tr.innerHTML = '';
};
SpreadsheetRow.prototype.updateExpanderIcon = function (hasChildren, isExpanded) {
var expanderIconEl = this.expanderIconEl;
var expanderEl = expanderIconEl.parentElement;
if (expanderIconEl &&
expanderEl // why would this be null?? was the case in IE11
) {
if (hasChildren) {
expanderEl.addEventListener('click', this.onExpanderClick);
expanderEl.classList.add('fc-expander');
updateExpanderIcon(expanderIconEl, isExpanded);
}
else {
expanderEl.removeEventListener('click', this.onExpanderClick);
expanderEl.classList.remove('fc-expander');
clearExpanderIcon(expanderIconEl);
}
}
};
return SpreadsheetRow;
}(core.Component));
/*
Renders the HTML responsible for the subrow expander area,
as well as the space before it (used to align expanders of similar depths)
*/
function renderIconHtml(depth) {
var html = '';
for (var i = 0; i < depth; i++) {
html += '<span class="fc-icon"></span>';
}
html +=
'<span class="fc-expander-space">' +
'<span class="fc-icon"></span>' +
'</span>';
return html;
}
var ResourceRow = /** @class */ (function (_super) {
__extends(ResourceRow, _super);
function ResourceRow(context, a, b, c, d, timeAxis) {
var _this = _super.call(this, context, a, b, c, d) || this;
_this._updateTrResourceId = core.memoizeRendering(updateTrResourceId);
_this.spreadsheetRow = new SpreadsheetRow(context, _this.spreadsheetTr);
_this.timeAxisTr.appendChild(core.createElement('td', { className: _this.theme.getClass('widgetContent') }, _this.innerContainerEl = document.createElement('div')));
_this.lane = new TimelinePlugin.TimelineLane(context, _this.innerContainerEl, _this.innerContainerEl, timeAxis);
return _this;
}
ResourceRow.prototype.destroy = function () {
this.spreadsheetRow.destroy();
this.lane.destroy();
_super.prototype.destroy.call(this);
};
ResourceRow.prototype.render = function (props) {
// spreadsheetRow handles calling updateTrResourceId for spreadsheetTr
this.spreadsheetRow.receiveProps({
colSpecs: props.colSpecs,
id: props.id,
rowSpans: props.rowSpans,
depth: props.depth,
isExpanded: props.isExpanded,
hasChildren: props.hasChildren,
resource: props.resource
});
this._updateTrResourceId(this.timeAxisTr, props.resource.id);
this.lane.receiveProps({
dateProfile: props.dateProfile,
nextDayThreshold: props.nextDayThreshold,
businessHours: props.businessHours,
eventStore: props.eventStore,
eventUiBases: props.eventUiBases,
dateSelection: props.dateSelection,
eventSelection: props.eventSelection,
eventDrag: props.eventDrag,
eventResize: props.eventResize
});
this.isSizeDirty = true;
};
ResourceRow.prototype.updateSize = function (isResize) {
_super.prototype.updateSize.call(this, isResize);
this.lane.updateSize(isResize);
};
ResourceRow.prototype.getHeightEls = function () {
return [this.spreadsheetRow.heightEl, this.innerContainerEl];
};
return ResourceRow;
}(Row));
ResourceRow.addEqualityFuncs({
rowSpans: core.isArraysEqual // HACK for isSizeDirty, ResourceTimelineView::renderRows
});
var COL_MIN_WIDTH = 30;
var SpreadsheetHeader = /** @class */ (function (_super) {
__extends(SpreadsheetHeader, _super);
function SpreadsheetHeader(context, parentEl) {
var _this = _super.call(this, context) || this;
_this.resizables = [];
_this.colWidths = [];
_this.emitter = new core.EmitterMixin();
parentEl.appendChild(_this.tableEl = core.createElement('table', {
className: _this.theme.getClass('tableGrid')
}));
return _this;
}
SpreadsheetHeader.prototype.destroy = function () {
for (var _i = 0, _a = this.resizables; _i < _a.length; _i++) {
var resizable = _a[_i];
resizable.destroy();
}
core.removeElement(this.tableEl);
_super.prototype.destroy.call(this);
};
SpreadsheetHeader.prototype.render = function (props) {
var theme = this.theme;
var colSpecs = props.colSpecs;
var html = '<colgroup>' + props.colTags + '</colgroup>' +
'<tbody>';
if (props.superHeaderText) {
html +=
'<tr class="fc-super">' +
'<th class="' + theme.getClass('widgetHeader') + '" colspan="' + colSpecs.length + '">' +
'<div class="fc-cell-content">' +
'<span class="fc-cell-text">' +
core.htmlEscape(props.superHeaderText) +
'</span>' +
'</div>' +
'</th>' +
'</tr>';
}
html += '<tr>';
for (var i = 0; i < colSpecs.length; i++) {
var o = colSpecs[i];
var isLast = i === (colSpecs.length - 1);
html +=
"<th class=\"" + theme.getClass('widgetHeader') + "\">" +
'<div>' +
'<div class="fc-cell-content">' +
(o.isMain ?
'<span class="fc-expander-space">' +
'<span class="fc-icon"></span>' +
'</span>' :
'') +
'<span class="fc-cell-text">' +
core.htmlEscape(o.labelText || '') + // what about normalizing this value ahead of time?
'</span>' +
'</div>' +
(!isLast ? '<div class="fc-col-resizer"></div>' : '') +
'</div>' +
'</th>';
}
html += '</tr>';
html += '</tbody>';
this.tableEl.innerHTML = html;
this.thEls = Array.prototype.slice.call(this.tableEl.querySelectorAll('th'));
this.colEls = Array.prototype.slice.call(this.tableEl.querySelectorAll('col'));
this.resizerEls = Array.prototype.slice.call(this.tableEl.querySelectorAll('.fc-col-resizer'));
this.initColResizing();
};
SpreadsheetHeader.prototype.initColResizing = function () {
var _this = this;
var ElementDraggingImpl = this.calendar.pluginSystem.hooks.elementDraggingImpl;
if (ElementDraggingImpl) {
this.resizables = this.resizerEls.map(function (handleEl, colIndex) {
var dragging = new ElementDraggingImpl(handleEl);
var startWidth;
dragging.emitter.on('dragstart', function () {
startWidth = _this.colWidths[colIndex];
if (typeof startWidth !== 'number') {
startWidth = _this.thEls[colIndex].getBoundingClientRect().width;
}
});
dragging.emitter.on('dragmove', function (pev) {
_this.colWidths[colIndex] = Math.max(startWidth + pev.deltaX * (_this.isRtl ? -1 : 1), COL_MIN_WIDTH);
_this.emitter.trigger('colwidthchange', _this.colWidths);
});
dragging.setAutoScrollEnabled(false); // because gets weird with auto-scrolling time area
return dragging;
});
}
};
return SpreadsheetHeader;
}(core.Component));
var Spreadsheet = /** @class */ (function (_super) {
__extends(Spreadsheet, _super);
function Spreadsheet(context, headParentEl, bodyParentEl) {
var _this = _super.call(this, context) || this;
_this._renderCells = core.memoizeRendering(_this.renderCells, _this.unrenderCells);
_this.layout = new TimelinePlugin.HeaderBodyLayout(headParentEl, bodyParentEl, 'clipped-scroll');
var headerEnhancedScroller = _this.layout.headerScroller.enhancedScroll;
var bodyEnhancedScroller = _this.layout.bodyScroller.enhancedScroll;
_this.header = new SpreadsheetHeader(context, headerEnhancedScroller.canvas.contentEl);
_this.header.emitter.on('colwidthchange', function (colWidths) {
_this.applyColWidths(colWidths);
});
bodyEnhancedScroller.canvas.contentEl
.appendChild(_this.bodyContainerEl = core.createElement('div', { className: 'fc-rows' }, '<table>' +
'<colgroup />' +
'<tbody />' +
'</table>'));
_this.bodyColGroup = _this.bodyContainerEl.querySelector('colgroup');
_this.bodyTbody = _this.bodyContainerEl.querySelector('tbody');
return _this;
}
Spreadsheet.prototype.destroy = function () {
this.header.destroy();
this.layout.destroy();
this._renderCells.unrender();
_super.prototype.destroy.call(this);
};
Spreadsheet.prototype.render = function (props) {
this._renderCells(props.superHeaderText, props.colSpecs);
};
Spreadsheet.prototype.renderCells = function (superHeaderText, colSpecs) {
var colTags = this.renderColTags(colSpecs);
this.header.receiveProps({
superHeaderText: superHeaderText,
colSpecs: colSpecs,
colTags: colTags
});
this.bodyColGroup.innerHTML = colTags;
this.bodyColEls = Array.prototype.slice.call(this.bodyColGroup.querySelectorAll('col'));
this.applyColWidths(colSpecs.map(function (colSpec) { return colSpec.width; }));
};
Spreadsheet.prototype.unrenderCells = function () {
this.bodyColGroup.innerHTML = '';
};
Spreadsheet.prototype.renderColTags = function (colSpecs) {
var html = '';
for (var _i = 0, colSpecs_1 = colSpecs; _i < colSpecs_1.length; _i++) {
var o = colSpecs_1[_i];
if (o.isMain) {
html += '<col class="fc-main-col"/>';
}
else {
html += '<col/>';
}
}
return html;
};
Spreadsheet.prototype.updateSize = function (isResize, totalHeight, isAuto) {
this.layout.setHeight(totalHeight, isAuto);
};
Spreadsheet.prototype.applyColWidths = function (colWidths) {
var _this = this;
colWidths.forEach(function (colWidth, colIndex) {
var headEl = _this.header.colEls[colIndex]; // bad to access child
var bodyEl = _this.bodyColEls[colIndex];
var styleVal;
if (typeof colWidth === 'number') {
styleVal = colWidth + 'px';
}
else if (typeof colWidth == null) {
styleVal = '';
}
headEl.style.width = bodyEl.style.width = styleVal;
});
};
return Spreadsheet;
}(core.Component));
var MIN_RESOURCE_AREA_WIDTH = 30; // definitely bigger than scrollbars
var ResourceTimelineView = /** @class */ (function (_super) {
__extends(ResourceTimelineView, _super);
function ResourceTimelineView(context, viewSpec, dateProfileGenerator, parentEl) {
var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;
_this.isStickyScrollDirty = false;
_this.rowNodes = [];
_this.rowComponents = [];
_this.rowComponentsById = {};
_this.resourceAreaWidthDraggings = [];
_this.splitter = new ResourceCommonPlugin.ResourceSplitter(); // doesn't let it do businessHours tho
_this.hasResourceBusinessHours = core.memoize(hasResourceBusinessHours);
_this.buildRowNodes = core.memoize(ResourceCommonPlugin.buildRowNodes);
_this.hasNesting = core.memoize(hasNesting);
_this._updateHasNesting = core.memoizeRendering(_this.updateHasNesting);
var allColSpecs = _this.opt('resourceColumns') || [];
var labelText = _this.opt('resourceLabelText'); // TODO: view.override
var defaultLabelText = 'Resources'; // TODO: view.defaults
var superHeaderText = null;
if (!allColSpecs.length) {
allColSpecs.push({
labelText: labelText || defaultLabelText,
text: ResourceCommonPlugin.buildResourceTextFunc(_this.opt('resourceText'), _this.calendar)
});
}
else {
superHeaderText = labelText;
}
var plainColSpecs = [];
var groupColSpecs = [];
var groupSpecs = [];
var isVGrouping = false;
var isHGrouping = false;
for (var _i = 0, allColSpecs_1 = allColSpecs; _i < allColSpecs_1.length; _i++) {
var colSpec = allColSpecs_1[_i];
if (colSpec.group) {
groupColSpecs.push(colSpec);
}
else {
plainColSpecs.push(colSpec);
}
}
plainColSpecs[0].isMain = true;
if (groupColSpecs.length) {
groupSpecs = groupColSpecs;
isVGrouping = true;
}
else {
var hGroupField = _this.opt('resourceGroupField');
if (hGroupField) {
isHGrouping = true;
groupSpecs.push({
field: hGroupField,
text: _this.opt('resourceGroupText'),
render: _this.opt('resourceGroupRender')
});
}
}
var allOrderSpecs = core.parseFieldSpecs(_this.opt('resourceOrder'));
var plainOrderSpecs = [];
for (var _a = 0, allOrderSpecs_1 = allOrderSpecs; _a < allOrderSpecs_1.length; _a++) {
var orderSpec = allOrderSpecs_1[_a];
var isGroup = false;
for (var _b = 0, groupSpecs_1 = groupSpecs; _b < groupSpecs_1.length; _b++) {
var groupSpec = groupSpecs_1[_b];
if (groupSpec.field === orderSpec.field) {
groupSpec.order = orderSpec.order; // -1, 0, 1
isGroup = true;
break;
}
}
if (!isGroup) {
plainOrderSpecs.push(orderSpec);
}
}
_this.superHeaderText = superHeaderText;
_this.isVGrouping = isVGrouping;
_this.isHGrouping = isHGrouping;
_this.groupSpecs = groupSpecs;
_this.colSpecs = groupColSpecs.concat(plainColSpecs);
_this.orderSpecs = plainOrderSpecs;
// START RENDERING...
_this.el.classList.add('fc-timeline');
if (_this.opt('eventOverlap') === false) {
_this.el.classList.add('fc-no-overlap');
}
_this.el.innerHTML = _this.renderSkeletonHtml();
_this.resourceAreaHeadEl = _this.el.querySelector('thead .fc-resource-area');
_this.setResourceAreaWidth(_this.opt('resourceAreaWidth'));
_this.initResourceAreaWidthDragging();
_this.miscHeight = _this.el.getBoundingClientRect().height;
_this.spreadsheet = new Spreadsheet(_this.context, _this.resourceAreaHeadEl, _this.el.querySelector('tbody .fc-resource-area'));
_this.timeAxis = new TimelinePlugin.TimeAxis(_this.context, _this.el.querySelector('thead .fc-time-area'), _this.el.querySelector('tbody .fc-time-area'));
var timeAxisRowContainer = core.createElement('div', { className: 'fc-rows' }, '<table><tbody /></table>');
_this.timeAxis.layout.bodyScroller.enhancedScroll.canvas.contentEl.appendChild(timeAxisRowContainer);
_this.timeAxisTbody = timeAxisRowContainer.querySelector('tbody');
_this.lane = new TimelinePlugin.TimelineLane(_this.context, null, _this.timeAxis.layout.bodyScroller.enhancedScroll.canvas.bgEl, _this.timeAxis);
_this.bodyScrollJoiner = new TimelinePlugin.ScrollJoiner('vertical', [
_this.spreadsheet.layout.bodyScroller,
_this.timeAxis.layout.bodyScroller
]);
// after scrolljoiner
_this.spreadsheetBodyStickyScroller = new TimelinePlugin.StickyScroller(_this.spreadsheet.layout.bodyScroller.enhancedScroll, _this.isRtl, true // isVertical
);
_this.spreadsheet.receiveProps({
superHeaderText: _this.superHeaderText,
colSpecs: _this.colSpecs
});
// Component...
context.calendar.registerInteractiveComponent(_this, {
el: _this.timeAxis.slats.el
});
return _this;
}
ResourceTimelineView.prototype.renderSkeletonHtml = function () {
var theme = this.theme;
return "<table class=\"" + theme.getClass('tableGrid') + "\"> <thead class=\"fc-head\"> <tr> <td class=\"fc-resource-area " + theme.getClass('widgetHeader') + "\"></td> <td class=\"fc-divider fc-col-resizer " + theme.getClass('widgetHeader') + "\"></td> <td class=\"fc-time-area " + theme.getClass('widgetHeader') + "\"></td> </tr> </thead> <tbody class=\"fc-body\"> <tr> <td class=\"fc-resource-area " + theme.getClass('widgetContent') + "\"></td> <td class=\"fc-divider fc-col-resizer " + theme.getClass('widgetHeader') + "\"></td> <td class=\"fc-time-area " + theme.getClass('widgetContent') + "\"></td> </tr> </tbody> </table>";
};
ResourceTimelineView.prototype.render = function (props) {
_super.prototype.render.call(this, props);
var splitProps = this.splitter.splitProps(props);
var hasResourceBusinessHours = this.hasResourceBusinessHours(props.resourceStore);
this.timeAxis.receiveProps({
dateProfile: props.dateProfile
});
// for all-resource bg events / selections / business-hours
this.lane.receiveProps(__assign({}, splitProps[''], { dateProfile: props.dateProfile, nextDayThreshold: this.nextDayThreshold, businessHours: hasResourceBusinessHours ? null : props.businessHours }));
var newRowNodes = this.buildRowNodes(props.resourceStore, this.groupSpecs, this.orderSpecs, this.isVGrouping, props.resourceEntityExpansions, this.opt('resourcesInitiallyExpanded'));
this._updateHasNesting(this.hasNesting(newRowNodes));
this.diffRows(newRowNodes);
this.renderRows(props.dateProfile, hasResourceBusinessHours ? props.businessHours : null, // CONFUSING, comment
splitProps);
};
ResourceTimelineView.prototype.updateHasNesting = function (isNesting) {
var classList = this.el.classList;
if (isNesting) {
classList.remove('fc-flat');
}
else {
classList.add('fc-flat');
}
};
ResourceTimelineView.prototype.diffRows = function (newNodes) {
var oldNodes = this.rowNodes;
var oldLen = oldNodes.length;
var oldIndexHash = {}; // id -> index
var oldI = 0;
var newI = 0;
for (oldI = 0; oldI < oldLen; oldI++) {
oldIndexHash[oldNodes[oldI].id] = oldI;
}
// iterate new nodes
for (oldI = 0, newI = 0; newI < newNodes.length; newI++) {
var newNode = newNodes[newI];
var oldIFound = oldIndexHash[newNode.id];
if (oldIFound != null && oldIFound >= oldI) {
this.removeRows(newI, oldIFound - oldI, oldNodes); // won't do anything if same index
oldI = oldIFound + 1;
}
else {
this.addRow(newI, newNode);
}
}
// old rows that weren't found need to be removed
this.removeRows(newI, oldLen - oldI, oldNodes); // won't do anything if same index
this.rowNodes = newNodes;
};
/*
rowComponents is the in-progress result
*/
ResourceTimelineView.prototype.addRow = function (index, rowNode) {
var _a = this, rowComponents = _a.rowComponents, rowComponentsById = _a.rowComponentsById;
var nextComponent = rowComponents[index];
var newComponent = this.buildChildComponent(rowNode, this.spreadsheet.bodyTbody, nextComponent ? nextComponent.spreadsheetTr : null, this.timeAxisTbody, nextComponent ? nextComponent.timeAxisTr : null);
rowComponents.splice(index, 0, newComponent);
rowComponentsById[rowNode.id] = newComponent;
};
ResourceTimelineView.prototype.removeRows = function (startIndex, len, oldRowNodes) {
if (len) {
var _a = this, rowComponents = _a.rowComponents, rowComponentsById = _a.rowComponentsById;
for (var i = 0; i < len; i++) {
var rowComponent = rowComponents[startIndex + i];
rowComponent.destroy();
delete rowComponentsById[oldRowNodes[i].id];
}
rowComponents.splice(startIndex, len);
}
};
ResourceTimelineView.prototype.buildChildComponent = function (node, spreadsheetTbody, spreadsheetNext, timeAxisTbody, timeAxisNext) {
if (node.group) {
return new GroupRow(this.context, spreadsheetTbody, spreadsheetNext, timeAxisTbody, timeAxisNext);
}
else if (node.resource) {
return new ResourceRow(this.context, spreadsheetTbody, spreadsheetNext, timeAxisTbody, timeAxisNext, this.timeAxis);
}
};
ResourceTimelineView.prototype.renderRows = function (dateProfile, fallbackBusinessHours, splitProps) {
var _a = this, rowNodes = _a.rowNodes, rowComponents = _a.rowComponents;
for (var i = 0; i < rowNodes.length; i++) {
var rowNode = rowNodes[i];
var rowComponent = rowComponents[i];
if (rowNode.group) {
rowComponent.receiveProps({
spreadsheetColCnt: this.colSpecs.length,
id: rowNode.id,
isExpanded: rowNode.isExpanded,
group: rowNode.group
});
}
else {
var resource = rowNode.resource;
rowComponent.receiveProps(__assign({}, splitProps[resource.id], { dateProfile: dateProfile, nextDayThreshold: this.nextDayThreshold, businessHours: resource.businessHours || fallbackBusinessHours, colSpecs: this.colSpecs, id: rowNode.id, rowSpans: rowNode.rowSpans, depth: rowNode.depth, isExpanded: rowNode.isExpanded, hasChildren: rowNode.hasChildren, resource: rowNode.resource }));
}
}
};
ResourceTimelineView.prototype.updateSize = function (isResize, viewHeight, isAuto) {
// FYI: this ordering is really important
var calendar = this.calendar;
var isBaseSizing = isResize || calendar.isViewUpdated || calendar.isDatesUpdated || calendar.isEventsUpdated;
if (isBaseSizing) {
this.syncHeadHeights();
this.timeAxis.updateSize(isResize, viewHeight - this.miscHeight, isAuto);
this.spreadsheet.updateSize(isResize, viewHeight - this.miscHeight, isAuto);
}
var rowSizingCnt = this.updateRowSizes(isResize);
this.lane.updateSize(isResize); // is efficient. uses flags
if (isBaseSizing || rowSizingCnt) {
this.bodyScrollJoiner.update();
this.timeAxis.layout.scrollJoiner.update(); // hack
this.rowPositions = new core.PositionCache(this.timeAxis.slats.el, this.rowComponents.map(function (rowComponent) {
return rowComponent.timeAxisTr;
}), false, // isHorizontal
true // isVertical
);
this.rowPositions.build();
this.isStickyScrollDirty = true;
}
};
ResourceTimelineView.prototype.syncHeadHeights = function () {
var spreadsheetHeadEl = this.spreadsheet.header.tableEl;
var timeAxisHeadEl = this.timeAxis.header.tableEl;
spreadsheetHeadEl.style.height = '';
timeAxisHeadEl.style.height = '';
var max = Math.max(spreadsheetHeadEl.getBoundingClientRect().height, timeAxisHeadEl.getBoundingClientRect().height);
spreadsheetHeadEl.style.height =
timeAxisHeadEl.style.height = max + 'px';
};
ResourceTimelineView.prototype.updateRowSizes = function (isResize) {
var dirtyRowComponents = this.rowComponents;
if (!isResize) {
dirtyRowComponents = dirtyRowComponents.filter(function (rowComponent) {
return rowComponent.isSizeDirty;
});
}
var elArrays = dirtyRowComponents.map(function (rowComponent) {
return rowComponent.getHeightEls();
});
// reset to natural heights
for (var _i = 0, elArrays_1 = elArrays; _i < elArrays_1.length; _i++) {
var elArray = elArrays_1[_i];
for (var _a = 0, elArray_1 = elArray; _a < elArray_1.length; _a++) {
var el = elArray_1[_a];
el.style.height = '';
}
}
// let rows update their contents' heights
for (var _b = 0, dirtyRowComponents_1 = dirtyRowComponents; _b < dirtyRowComponents_1.length; _b++) {
var rowComponent = dirtyRowComponents_1[_b];
rowComponent.updateSize(isResize); // will reset isSizeDirty
}
var maxHeights = elArrays.map(function (elArray) {
var maxHeight = null;
for (var _i = 0, elArray_2 = elArray; _i < elArray_2.length; _i++) {
var el = elArray_2[_i];
var height = el.getBoundingClientRect().height;
if (maxHeight === null || height > maxHeight) {
maxHeight = height;
}
}
return maxHeight;
});
for (var i = 0; i < elArrays.length; i++) {
for (var _c = 0, _d = elArrays[i]; _c < _d.length; _c++) {
var el = _d[_c];
el.style.height = maxHeights[i] + 'px';
}
}
return dirtyRowComponents.length;
};
ResourceTimelineView.prototype.destroy = function () {
for (var _i = 0, _a = this.rowComponents; _i < _a.length; _i++) {
var rowComponent = _a[_i];
rowComponent.destroy();
}
this.rowNodes = [];
this.rowComponents = [];
this.spreadsheet.destroy();
this.timeAxis.destroy();
for (var _b = 0, _c = this.resourceAreaWidthDraggings; _b < _c.length; _b++) {
var resourceAreaWidthDragging = _c[_b];
resourceAreaWidthDragging.destroy();
}
this.spreadsheetBodyStickyScroller.destroy();
_super.prototype.destroy.call(this);
this.calendar.unregisterInteractiveComponent(this);
};
// Now Indicator
// ------------------------------------------------------------------------------------------
ResourceTimelineView.prototype.getNowIndicatorUnit = function (dateProfile) {
return this.timeAxis.getNowIndicatorUnit(dateProfile);
};
ResourceTimelineView.prototype.renderNowIndicator = function (date) {
this.timeAxis.renderNowIndicator(date);
};
ResourceTimelineView.prototype.unrenderNowIndicator = function () {
this.timeAxis.unrenderNowIndicator();
};
// Scrolling
// ------------------------------------------------------------------------------------------------------------------
// this is useful for scrolling prev/next dates while resource is scrolled down
ResourceTimelineView.prototype.queryScroll = function () {
var scroll = _super.prototype.queryScroll.call(this);
if (this.props.resourceStore) {
__assign(scroll, this.queryResourceScroll());
}
return scroll;
};
ResourceTimelineView.prototype.applyScroll = function (scroll, isResize) {
_super.prototype.applyScroll.call(this, scroll, isResize);
if (this.props.resourceStore) {
this.applyResourceScroll(scroll);
}
// avoid updating stickyscroll too often
if (isResize || this.isStickyScrollDirty) {
this.isStickyScrollDirty = false;
this.spreadsheetBodyStickyScroller.updateSize();
this.timeAxis.updateStickyScrollers();
}
};
ResourceTimelineView.prototype.computeDateScroll = function (duration) {
return this.timeAxis.computeDateScroll(duration);
};
ResourceTimelineView.prototype.queryDateScroll = function () {
return this.timeAxis.queryDateScroll();
};
ResourceTimelineView.prototype.applyDateScroll = function (scroll) {
this.timeAxis.applyDateScroll(scroll);
};
ResourceTimelineView.prototype.queryResourceScroll = function () {
var _a = this, rowComponents = _a.rowComponents, rowNodes = _a.rowNodes;
var scroll = {};
var scrollerTop = this.timeAxis.layout.bodyScroller.el.getBoundingClientRect().top; // fixed position
for (var i = 0; i < rowComponents.length; i++) {
var rowComponent = rowComponents[i];
var rowNode = rowNodes[i];
var el = rowComponent.timeAxisTr;
var elBottom = el.getBoundingClientRect().bottom; // fixed position
if (elBottom > scrollerTop) {
scroll.rowId = rowNode.id;
scroll.bottom = elBottom - scrollerTop;
break;
}
}
// TODO: what about left scroll state for spreadsheet area?
return scroll;
};
ResourceTimelineView.prototype.applyResourceScroll = function (scroll) {
var rowId = scroll.forcedRowId || scroll.rowId;
if (rowId) {
var rowComponent = this.rowComponentsById[rowId];
if (rowComponent) {
var el = rowComponent.timeAxisTr;
if (el) {
var innerTop = this.timeAxis.layout.bodyScroller.enhancedScroll.canvas.el.getBoundingClientRect().top;
var rowRect = el.getBoundingClientRect();
var scrollTop = (scroll.forcedRowId ?
rowRect.top : // just use top edge
rowRect.bottom - scroll.bottom) - // pixels from bottom edge
innerTop;
this.timeAxis.layout.bodyScroller.enhancedScroll.setScrollTop(scrollTop);
this.spreadsheet.layout.bodyScroller.enhancedScroll.setScrollTop(scrollTop);
}
}
}
};
// TODO: scrollToResource
// Hit System
// ------------------------------------------------------------------------------------------
ResourceTimelineView.prototype.buildPositionCaches = function () {
this.timeAxis.slats.updateSize();
this.rowPositions.build();
};
ResourceTimelineView.prototype.queryHit = function (positionLeft, positionTop) {
var rowPositions = this.rowPositions;
var slats = this.timeAxis.slats;
var rowIndex = rowPositions.topToIndex(positionTop);
if (rowIndex != null) {
var resource = this.rowNodes[rowIndex].resource;
if (resource) { // not a group
var slatHit = slats.positionToHit(positionLeft);
if (slatHit) {
return {
component: this,
dateSpan: {
range: slatHit.dateSpan.range,
allDay: slatHit.dateSpan.allDay,
resourceId: resource.id
},
rect: {
left: slatHit.left,
right: slatHit.right,
top: rowPositions.tops[rowIndex],
bottom: rowPositions.bottoms[rowIndex]
},
dayEl: slatHit.dayEl,
layer: 0
};
}
}
}
};
// Resource Area
// ------------------------------------------------------------------------------------------------------------------
ResourceTimelineView.prototype.setResourceAreaWidth = function (widthVal) {
this.resourceAreaWidth = widthVal;
core.applyStyleProp(this.resourceAreaHeadEl, 'width', widthVal || '');
};
ResourceTimelineView.prototype.initResourceAreaWidthDragging = function () {
var _this = this;
var resourceAreaDividerEls = Array.prototype.slice.call(this.el.querySelectorAll('.fc-col-resizer'));
var ElementDraggingImpl = this.calendar.pluginSystem.hooks.elementDraggingImpl;
if (ElementDraggingImpl) {
this.resourceAreaWidthDraggings = resourceAreaDividerEls.map(function (el) {
var dragging = new ElementDraggingImpl(el);
var dragStartWidth;
var viewWidth;
dragging.emitter.on('dragstart', function () {
dragStartWidth = _this.resourceAreaWidth;
if (typeof dragStartWidth !== 'number') {
dragStartWidth = _this.resourceAreaHeadEl.getBoundingClientRect().width;
}
viewWidth = _this.el.getBoundingClientRect().width;
});
dragging.emitter.on('dragmove', function (pev) {
var newWidth = dragStartWidth + pev.deltaX * (_this.isRtl ? -1 : 1);
newWidth = Math.max(newWidth, MIN_RESOURCE_AREA_WIDTH);
newWidth = Math.min(newWidth, viewWidth - MIN_RESOURCE_AREA_WIDTH);
_this.setResourceAreaWidth(newWidth);
});
dragging.setAutoScrollEnabled(false); // because gets weird with auto-scrolling time area
return dragging;
});
}
};
ResourceTimelineView.needsResourceData = true; // for ResourceViewProps
return ResourceTimelineView;
}(core.View));
function hasResourceBusinessHours(resourceStore) {
for (var resourceId in resourceStore) {
var resource = resourceStore[resourceId];
if (resource.businessHours) {
return true;
}
}
return false;
}
function hasNesting(nodes) {
for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
var node = nodes_1[_i];
if (node.group) {
return true;
}
else if (node.resource) {
if (node.hasChildren) {
return true;
}
}
}
return false;
}
var main = core.createPlugin({
deps: [ResourceCommonPlugin__default, TimelinePlugin__default],
defaultView: 'resourceTimelineDay',
views: {
resourceTimeline: {
class: ResourceTimelineView,
resourceAreaWidth: '30%',
resourcesInitiallyExpanded: true,
eventResizableFromStart: true // TODO: not DRY with this same setting in the main timeline config
},
resourceTimelineDay: {
type: 'resourceTimeline',
duration: { days: 1 }
},
resourceTimelineWeek: {
type: 'resourceTimeline',
duration: { weeks: 1 }
},
resourceTimelineMonth: {
type: 'resourceTimeline',
duration: { months: 1 }
},
resourceTimelineYear: {
type: 'resourceTimeline',
duration: { years: 1 }
}
}
});
exports.ResourceTimelineView = ResourceTimelineView;
exports.default = main;
Object.defineProperty(exports, '__esModule', { value: true });
}));
.fc-timeline .fc-divider{width:3px;border-style:double}.fc-timeline .fc-head>tr>.fc-divider{border-bottom:0}.fc-timeline .fc-body>tr>.fc-divider{border-top:0}.fc-resource-area{width:30%}.fc-resource-area col{width:40%;min-width:70px}.fc-resource-area col.fc-main-col{width:60%}.fc-flat .fc-expander-space{display:none}.fc-ltr .fc-resource-area tr>*{text-align:left}.fc-rtl .fc-resource-area tr>*{text-align:right}.fc-resource-area .fc-cell-content{padding-left:4px;padding-right:4px}.fc-resource-area .fc-super th{text-align:center}.fc-resource-area th>div{position:relative}.fc-resource-area th .fc-cell-content{position:relative;z-index:1}.fc-resource-area th .fc-col-resizer{position:absolute;z-index:2;top:0;bottom:0;width:5px}.fc-timeline .fc-col-resizer{cursor:col-resize}.fc-ltr .fc-resource-area th .fc-col-resizer{right:-3px}.fc-rtl .fc-resource-area th .fc-col-resizer{left:-3px}.fc-body .fc-resource-area .fc-cell-content{padding-top:8px;padding-bottom:8px}.fc-no-overlap .fc-body .fc-resource-area .fc-cell-content{padding-top:6px;padding-bottom:6px}.fc-resource-area .fc-icon{display:inline-block;width:1em;text-align:center}.fc-resource-area .fc-expander{cursor:pointer;opacity:.65}.fc-time-area .fc-rows{position:relative;z-index:3}.fc-time-area .fc-rows td>div{position:relative}.fc-time-area .fc-rows .fc-bgevent-container,.fc-time-area .fc-rows .fc-highlight-container{z-index:1}
\ No newline at end of file
/*!
FullCalendar Resource Timeline Plugin v4.3.0
Docs & License: https://fullcalendar.io/scheduler
(c) 2019 Adam Shaw
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@fullcalendar/core"),require("@fullcalendar/timeline"),require("@fullcalendar/resource-common")):"function"==typeof define&&define.amd?define(["exports","@fullcalendar/core","@fullcalendar/timeline","@fullcalendar/resource-common"],t):t((e=e||self).FullCalendarResourceTimeline={},e.FullCalendar,e.FullCalendarTimeline,e.FullCalendarResourceCommon)}(this,function(e,t,r,o){"use strict";var i="default"in r?r.default:r,s="default"in o?o.default:o,n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function l(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},c=function(e){function r(t,r,o,i,s){var n=e.call(this,t)||this;return n.isSizeDirty=!1,r.insertBefore(n.spreadsheetTr=document.createElement("tr"),o),i.insertBefore(n.timeAxisTr=document.createElement("tr"),s),n}return l(r,e),r.prototype.destroy=function(){t.removeElement(this.spreadsheetTr),t.removeElement(this.timeAxisTr),e.prototype.destroy.call(this)},r.prototype.updateSize=function(e){this.isSizeDirty=!1},r}(t.Component);function d(e,t){var r=e.classList;t?(r.remove("fc-icon-plus-square"),r.add("fc-icon-minus-square")):(r.remove("fc-icon-minus-square"),r.add("fc-icon-plus-square"))}function p(e,t){e.setAttribute("data-resource-id",t)}var u=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r._renderCells=t.memoizeRendering(r.renderCells,r.unrenderCells),r._updateExpanderIcon=t.memoizeRendering(r.updateExpanderIcon,null,[r._renderCells]),r.onExpanderClick=function(e){var t=r.props;r.calendar.dispatch({type:"SET_RESOURCE_ENTITY_EXPANDED",id:t.id,isExpanded:!t.isExpanded})},r}return l(r,e),r.prototype.render=function(e){this._renderCells(e.group,e.spreadsheetColCnt),this._updateExpanderIcon(e.isExpanded),this.isSizeDirty=!0},r.prototype.destroy=function(){e.prototype.destroy.call(this),this._renderCells.unrender()},r.prototype.renderCells=function(e,r){var o=this.renderSpreadsheetContent(e);this.spreadsheetTr.appendChild(t.createElement("td",{className:"fc-divider",colSpan:r},this.spreadsheetHeightEl=t.createElement("div",null,o))),this.expanderIconEl=o.querySelector(".fc-icon"),this.expanderIconEl.parentElement.addEventListener("click",this.onExpanderClick),this.timeAxisTr.appendChild(t.createElement("td",{className:"fc-divider"},this.timeAxisHeightEl=document.createElement("div")))},r.prototype.unrenderCells=function(){this.spreadsheetTr.innerHTML="",this.timeAxisTr.innerHTML=""},r.prototype.renderSpreadsheetContent=function(e){var r=this.renderCellText(e),o=t.htmlToElement('<div class="fc-cell-content"><span class="fc-expander"><span class="fc-icon"></span></span><span class="fc-cell-text">'+(r?t.htmlEscape(r):"&nbsp;")+"</span></div>"),i=e.spec.render;return"function"==typeof i&&(o=i(o,e.value)||o),o},r.prototype.renderCellText=function(e){var t=e.value||"",r=e.spec.text;return"function"==typeof r&&(t=r(t)||t),t},r.prototype.getHeightEls=function(){return[this.spreadsheetHeightEl,this.timeAxisHeightEl]},r.prototype.updateExpanderIcon=function(e){d(this.expanderIconEl,e)},r}(c);u.addEqualityFuncs({group:o.isGroupsEqual});var h=function(e){function r(r,o){var i=e.call(this,r)||this;return i._renderRow=t.memoizeRendering(i.renderRow,i.unrenderRow),i._updateTrResourceId=t.memoizeRendering(p,null,[i._renderRow]),i._updateExpanderIcon=t.memoizeRendering(i.updateExpanderIcon,null,[i._renderRow]),i.onExpanderClick=function(e){var t=i.props;i.calendar.dispatch({type:"SET_RESOURCE_ENTITY_EXPANDED",id:t.id,isExpanded:!t.isExpanded})},i.tr=o,i}return l(r,e),r.prototype.render=function(e){this._renderRow(e.resource,e.rowSpans,e.depth,e.colSpecs),this._updateTrResourceId(this.tr,e.resource.id),this._updateExpanderIcon(e.hasChildren,e.isExpanded)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this._renderRow.unrender()},r.prototype.renderRow=function(e,r,i,s){for(var n,l=this.tr,a=this.theme,c=this.calendar,d=this.view,p=o.buildResourceFields(e),u=0;u<s.length;u++){var h=s[u],f=r[u];if(0!==f){null==f&&(f=1);var m=void 0;m=h.field?p[h.field]:o.buildResourceTextFunc(h.text,c)(e);var g=t.htmlToElement('<div class="fc-cell-content">'+(h.isMain?y(i):"")+'<span class="fc-cell-text">'+(m?t.htmlEscape(m):"&nbsp;")+"</span></div>");"function"==typeof h.render&&(g=h.render(new o.ResourceApi(c,e),g)||g),f>1&&g.classList.add("fc-sticky");var v=t.createElement("td",{className:a.getClass("widgetContent"),rowspan:f},g);h.isMain&&(v.appendChild(this.heightEl=t.createElement("div",null,v.childNodes)),n=v),l.appendChild(v)}}this.expanderIconEl=l.querySelector(".fc-expander-space .fc-icon"),d.publiclyTrigger("resourceRender",[{resource:new o.ResourceApi(c,e),el:n,view:d}])},r.prototype.unrenderRow=function(){this.tr.innerHTML=""},r.prototype.updateExpanderIcon=function(e,t){var r,o=this.expanderIconEl,i=o.parentElement;o&&i&&(e?(i.addEventListener("click",this.onExpanderClick),i.classList.add("fc-expander"),d(o,t)):(i.removeEventListener("click",this.onExpanderClick),i.classList.remove("fc-expander"),(r=o.classList).remove("fc-icon-minus-square"),r.remove("fc-icon-plus-square")))},r}(t.Component);function y(e){for(var t="",r=0;r<e;r++)t+='<span class="fc-icon"></span>';return t+='<span class="fc-expander-space"><span class="fc-icon"></span></span>'}var f=function(e){function o(o,i,s,n,l,a){var c=e.call(this,o,i,s,n,l)||this;return c._updateTrResourceId=t.memoizeRendering(p),c.spreadsheetRow=new h(o,c.spreadsheetTr),c.timeAxisTr.appendChild(t.createElement("td",{className:c.theme.getClass("widgetContent")},c.innerContainerEl=document.createElement("div"))),c.lane=new r.TimelineLane(o,c.innerContainerEl,c.innerContainerEl,a),c}return l(o,e),o.prototype.destroy=function(){this.spreadsheetRow.destroy(),this.lane.destroy(),e.prototype.destroy.call(this)},o.prototype.render=function(e){this.spreadsheetRow.receiveProps({colSpecs:e.colSpecs,id:e.id,rowSpans:e.rowSpans,depth:e.depth,isExpanded:e.isExpanded,hasChildren:e.hasChildren,resource:e.resource}),this._updateTrResourceId(this.timeAxisTr,e.resource.id),this.lane.receiveProps({dateProfile:e.dateProfile,nextDayThreshold:e.nextDayThreshold,businessHours:e.businessHours,eventStore:e.eventStore,eventUiBases:e.eventUiBases,dateSelection:e.dateSelection,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize}),this.isSizeDirty=!0},o.prototype.updateSize=function(t){e.prototype.updateSize.call(this,t),this.lane.updateSize(t)},o.prototype.getHeightEls=function(){return[this.spreadsheetRow.heightEl,this.innerContainerEl]},o}(c);f.addEqualityFuncs({rowSpans:t.isArraysEqual});var m=function(e){function r(r,o){var i=e.call(this,r)||this;return i.resizables=[],i.colWidths=[],i.emitter=new t.EmitterMixin,o.appendChild(i.tableEl=t.createElement("table",{className:i.theme.getClass("tableGrid")})),i}return l(r,e),r.prototype.destroy=function(){for(var r=0,o=this.resizables;r<o.length;r++){o[r].destroy()}t.removeElement(this.tableEl),e.prototype.destroy.call(this)},r.prototype.render=function(e){var r=this.theme,o=e.colSpecs,i="<colgroup>"+e.colTags+"</colgroup><tbody>";e.superHeaderText&&(i+='<tr class="fc-super"><th class="'+r.getClass("widgetHeader")+'" colspan="'+o.length+'"><div class="fc-cell-content"><span class="fc-cell-text">'+t.htmlEscape(e.superHeaderText)+"</span></div></th></tr>"),i+="<tr>";for(var s=0;s<o.length;s++){var n=o[s],l=s===o.length-1;i+='<th class="'+r.getClass("widgetHeader")+'"><div><div class="fc-cell-content">'+(n.isMain?'<span class="fc-expander-space"><span class="fc-icon"></span></span>':"")+'<span class="fc-cell-text">'+t.htmlEscape(n.labelText||"")+"</span></div>"+(l?"":'<div class="fc-col-resizer"></div>')+"</div></th>"}i+="</tr>",i+="</tbody>",this.tableEl.innerHTML=i,this.thEls=Array.prototype.slice.call(this.tableEl.querySelectorAll("th")),this.colEls=Array.prototype.slice.call(this.tableEl.querySelectorAll("col")),this.resizerEls=Array.prototype.slice.call(this.tableEl.querySelectorAll(".fc-col-resizer")),this.initColResizing()},r.prototype.initColResizing=function(){var e=this,t=this.calendar.pluginSystem.hooks.elementDraggingImpl;t&&(this.resizables=this.resizerEls.map(function(r,o){var i,s=new t(r);return s.emitter.on("dragstart",function(){"number"!=typeof(i=e.colWidths[o])&&(i=e.thEls[o].getBoundingClientRect().width)}),s.emitter.on("dragmove",function(t){e.colWidths[o]=Math.max(i+t.deltaX*(e.isRtl?-1:1),30),e.emitter.trigger("colwidthchange",e.colWidths)}),s.setAutoScrollEnabled(!1),s}))},r}(t.Component),g=function(e){function o(o,i,s){var n=e.call(this,o)||this;n._renderCells=t.memoizeRendering(n.renderCells,n.unrenderCells),n.layout=new r.HeaderBodyLayout(i,s,"clipped-scroll");var l=n.layout.headerScroller.enhancedScroll,a=n.layout.bodyScroller.enhancedScroll;return n.header=new m(o,l.canvas.contentEl),n.header.emitter.on("colwidthchange",function(e){n.applyColWidths(e)}),a.canvas.contentEl.appendChild(n.bodyContainerEl=t.createElement("div",{className:"fc-rows"},"<table><colgroup /><tbody /></table>")),n.bodyColGroup=n.bodyContainerEl.querySelector("colgroup"),n.bodyTbody=n.bodyContainerEl.querySelector("tbody"),n}return l(o,e),o.prototype.destroy=function(){this.header.destroy(),this.layout.destroy(),this._renderCells.unrender(),e.prototype.destroy.call(this)},o.prototype.render=function(e){this._renderCells(e.superHeaderText,e.colSpecs)},o.prototype.renderCells=function(e,t){var r=this.renderColTags(t);this.header.receiveProps({superHeaderText:e,colSpecs:t,colTags:r}),this.bodyColGroup.innerHTML=r,this.bodyColEls=Array.prototype.slice.call(this.bodyColGroup.querySelectorAll("col")),this.applyColWidths(t.map(function(e){return e.width}))},o.prototype.unrenderCells=function(){this.bodyColGroup.innerHTML=""},o.prototype.renderColTags=function(e){for(var t="",r=0,o=e;r<o.length;r++){o[r].isMain?t+='<col class="fc-main-col"/>':t+="<col/>"}return t},o.prototype.updateSize=function(e,t,r){this.layout.setHeight(t,r)},o.prototype.applyColWidths=function(e){var t=this;e.forEach(function(e,r){var o,i=t.header.colEls[r],s=t.bodyColEls[r];"number"==typeof e?o=e+"px":null==typeof e&&(o=""),i.style.width=s.style.width=o})},o}(t.Component),v=function(e){function i(i,s,n,l){var a=e.call(this,i,s,n,l)||this;a.isStickyScrollDirty=!1,a.rowNodes=[],a.rowComponents=[],a.rowComponentsById={},a.resourceAreaWidthDraggings=[],a.splitter=new o.ResourceSplitter,a.hasResourceBusinessHours=t.memoize(S),a.buildRowNodes=t.memoize(o.buildRowNodes),a.hasNesting=t.memoize(x),a._updateHasNesting=t.memoizeRendering(a.updateHasNesting);var c=a.opt("resourceColumns")||[],d=a.opt("resourceLabelText"),p=null;c.length?p=d:c.push({labelText:d||"Resources",text:o.buildResourceTextFunc(a.opt("resourceText"),a.calendar)});for(var u=[],h=[],y=[],f=!1,m=!1,v=0,E=c;v<E.length;v++){var C=E[v];C.group?h.push(C):u.push(C)}if(u[0].isMain=!0,h.length)y=h,f=!0;else{var w=a.opt("resourceGroupField");w&&(m=!0,y.push({field:w,text:a.opt("resourceGroupText"),render:a.opt("resourceGroupRender")}))}for(var b=[],R=0,T=t.parseFieldSpecs(a.opt("resourceOrder"));R<T.length;R++){for(var A=T[R],H=!1,z=0,I=y;z<I.length;z++){var D=I[z];if(D.field===A.field){D.order=A.order,H=!0;break}}H||b.push(A)}a.superHeaderText=p,a.isVGrouping=f,a.isHGrouping=m,a.groupSpecs=y,a.colSpecs=h.concat(u),a.orderSpecs=b,a.el.classList.add("fc-timeline"),!1===a.opt("eventOverlap")&&a.el.classList.add("fc-no-overlap"),a.el.innerHTML=a.renderSkeletonHtml(),a.resourceAreaHeadEl=a.el.querySelector("thead .fc-resource-area"),a.setResourceAreaWidth(a.opt("resourceAreaWidth")),a.initResourceAreaWidthDragging(),a.miscHeight=a.el.getBoundingClientRect().height,a.spreadsheet=new g(a.context,a.resourceAreaHeadEl,a.el.querySelector("tbody .fc-resource-area")),a.timeAxis=new r.TimeAxis(a.context,a.el.querySelector("thead .fc-time-area"),a.el.querySelector("tbody .fc-time-area"));var _=t.createElement("div",{className:"fc-rows"},"<table><tbody /></table>");return a.timeAxis.layout.bodyScroller.enhancedScroll.canvas.contentEl.appendChild(_),a.timeAxisTbody=_.querySelector("tbody"),a.lane=new r.TimelineLane(a.context,null,a.timeAxis.layout.bodyScroller.enhancedScroll.canvas.bgEl,a.timeAxis),a.bodyScrollJoiner=new r.ScrollJoiner("vertical",[a.spreadsheet.layout.bodyScroller,a.timeAxis.layout.bodyScroller]),a.spreadsheetBodyStickyScroller=new r.StickyScroller(a.spreadsheet.layout.bodyScroller.enhancedScroll,a.isRtl,!0),a.spreadsheet.receiveProps({superHeaderText:a.superHeaderText,colSpecs:a.colSpecs}),i.calendar.registerInteractiveComponent(a,{el:a.timeAxis.slats.el}),a}return l(i,e),i.prototype.renderSkeletonHtml=function(){var e=this.theme;return'<table class="'+e.getClass("tableGrid")+'"> <thead class="fc-head"> <tr> <td class="fc-resource-area '+e.getClass("widgetHeader")+'"></td> <td class="fc-divider fc-col-resizer '+e.getClass("widgetHeader")+'"></td> <td class="fc-time-area '+e.getClass("widgetHeader")+'"></td> </tr> </thead> <tbody class="fc-body"> <tr> <td class="fc-resource-area '+e.getClass("widgetContent")+'"></td> <td class="fc-divider fc-col-resizer '+e.getClass("widgetHeader")+'"></td> <td class="fc-time-area '+e.getClass("widgetContent")+'"></td> </tr> </tbody> </table>'},i.prototype.render=function(t){e.prototype.render.call(this,t);var r=this.splitter.splitProps(t),o=this.hasResourceBusinessHours(t.resourceStore);this.timeAxis.receiveProps({dateProfile:t.dateProfile}),this.lane.receiveProps(a({},r[""],{dateProfile:t.dateProfile,nextDayThreshold:this.nextDayThreshold,businessHours:o?null:t.businessHours}));var i=this.buildRowNodes(t.resourceStore,this.groupSpecs,this.orderSpecs,this.isVGrouping,t.resourceEntityExpansions,this.opt("resourcesInitiallyExpanded"));this._updateHasNesting(this.hasNesting(i)),this.diffRows(i),this.renderRows(t.dateProfile,o?t.businessHours:null,r)},i.prototype.updateHasNesting=function(e){var t=this.el.classList;e?t.remove("fc-flat"):t.add("fc-flat")},i.prototype.diffRows=function(e){var t=this.rowNodes,r=t.length,o={},i=0,s=0;for(i=0;i<r;i++)o[t[i].id]=i;for(i=0,s=0;s<e.length;s++){var n=e[s],l=o[n.id];null!=l&&l>=i?(this.removeRows(s,l-i,t),i=l+1):this.addRow(s,n)}this.removeRows(s,r-i,t),this.rowNodes=e},i.prototype.addRow=function(e,t){var r=this.rowComponents,o=this.rowComponentsById,i=r[e],s=this.buildChildComponent(t,this.spreadsheet.bodyTbody,i?i.spreadsheetTr:null,this.timeAxisTbody,i?i.timeAxisTr:null);r.splice(e,0,s),o[t.id]=s},i.prototype.removeRows=function(e,t,r){if(t){for(var o=this.rowComponents,i=this.rowComponentsById,s=0;s<t;s++){o[e+s].destroy(),delete i[r[s].id]}o.splice(e,t)}},i.prototype.buildChildComponent=function(e,t,r,o,i){return e.group?new u(this.context,t,r,o,i):e.resource?new f(this.context,t,r,o,i,this.timeAxis):void 0},i.prototype.renderRows=function(e,t,r){for(var o=this.rowNodes,i=this.rowComponents,s=0;s<o.length;s++){var n=o[s],l=i[s];if(n.group)l.receiveProps({spreadsheetColCnt:this.colSpecs.length,id:n.id,isExpanded:n.isExpanded,group:n.group});else{var c=n.resource;l.receiveProps(a({},r[c.id],{dateProfile:e,nextDayThreshold:this.nextDayThreshold,businessHours:c.businessHours||t,colSpecs:this.colSpecs,id:n.id,rowSpans:n.rowSpans,depth:n.depth,isExpanded:n.isExpanded,hasChildren:n.hasChildren,resource:n.resource}))}}},i.prototype.updateSize=function(e,r,o){var i=this.calendar,s=e||i.isViewUpdated||i.isDatesUpdated||i.isEventsUpdated;s&&(this.syncHeadHeights(),this.timeAxis.updateSize(e,r-this.miscHeight,o),this.spreadsheet.updateSize(e,r-this.miscHeight,o));var n=this.updateRowSizes(e);this.lane.updateSize(e),(s||n)&&(this.bodyScrollJoiner.update(),this.timeAxis.layout.scrollJoiner.update(),this.rowPositions=new t.PositionCache(this.timeAxis.slats.el,this.rowComponents.map(function(e){return e.timeAxisTr}),!1,!0),this.rowPositions.build(),this.isStickyScrollDirty=!0)},i.prototype.syncHeadHeights=function(){var e=this.spreadsheet.header.tableEl,t=this.timeAxis.header.tableEl;e.style.height="",t.style.height="";var r=Math.max(e.getBoundingClientRect().height,t.getBoundingClientRect().height);e.style.height=t.style.height=r+"px"},i.prototype.updateRowSizes=function(e){var t=this.rowComponents;e||(t=t.filter(function(e){return e.isSizeDirty}));for(var r=t.map(function(e){return e.getHeightEls()}),o=0,i=r;o<i.length;o++)for(var s=0,n=i[o];s<n.length;s++){n[s].style.height=""}for(var l=0,a=t;l<a.length;l++){a[l].updateSize(e)}for(var c=r.map(function(e){for(var t=null,r=0,o=e;r<o.length;r++){var i=o[r].getBoundingClientRect().height;(null===t||i>t)&&(t=i)}return t}),d=0;d<r.length;d++)for(var p=0,u=r[d];p<u.length;p++){u[p].style.height=c[d]+"px"}return t.length},i.prototype.destroy=function(){for(var t=0,r=this.rowComponents;t<r.length;t++){r[t].destroy()}this.rowNodes=[],this.rowComponents=[],this.spreadsheet.destroy(),this.timeAxis.destroy();for(var o=0,i=this.resourceAreaWidthDraggings;o<i.length;o++){i[o].destroy()}this.spreadsheetBodyStickyScroller.destroy(),e.prototype.destroy.call(this),this.calendar.unregisterInteractiveComponent(this)},i.prototype.getNowIndicatorUnit=function(e){return this.timeAxis.getNowIndicatorUnit(e)},i.prototype.renderNowIndicator=function(e){this.timeAxis.renderNowIndicator(e)},i.prototype.unrenderNowIndicator=function(){this.timeAxis.unrenderNowIndicator()},i.prototype.queryScroll=function(){var t=e.prototype.queryScroll.call(this);return this.props.resourceStore&&a(t,this.queryResourceScroll()),t},i.prototype.applyScroll=function(t,r){e.prototype.applyScroll.call(this,t,r),this.props.resourceStore&&this.applyResourceScroll(t),(r||this.isStickyScrollDirty)&&(this.isStickyScrollDirty=!1,this.spreadsheetBodyStickyScroller.updateSize(),this.timeAxis.updateStickyScrollers())},i.prototype.computeDateScroll=function(e){return this.timeAxis.computeDateScroll(e)},i.prototype.queryDateScroll=function(){return this.timeAxis.queryDateScroll()},i.prototype.applyDateScroll=function(e){this.timeAxis.applyDateScroll(e)},i.prototype.queryResourceScroll=function(){for(var e=this.rowComponents,t=this.rowNodes,r={},o=this.timeAxis.layout.bodyScroller.el.getBoundingClientRect().top,i=0;i<e.length;i++){var s=e[i],n=t[i],l=s.timeAxisTr.getBoundingClientRect().bottom;if(l>o){r.rowId=n.id,r.bottom=l-o;break}}return r},i.prototype.applyResourceScroll=function(e){var t=e.forcedRowId||e.rowId;if(t){var r=this.rowComponentsById[t];if(r){var o=r.timeAxisTr;if(o){var i=this.timeAxis.layout.bodyScroller.enhancedScroll.canvas.el.getBoundingClientRect().top,s=o.getBoundingClientRect(),n=(e.forcedRowId?s.top:s.bottom-e.bottom)-i;this.timeAxis.layout.bodyScroller.enhancedScroll.setScrollTop(n),this.spreadsheet.layout.bodyScroller.enhancedScroll.setScrollTop(n)}}}},i.prototype.buildPositionCaches=function(){this.timeAxis.slats.updateSize(),this.rowPositions.build()},i.prototype.queryHit=function(e,t){var r=this.rowPositions,o=this.timeAxis.slats,i=r.topToIndex(t);if(null!=i){var s=this.rowNodes[i].resource;if(s){var n=o.positionToHit(e);if(n)return{component:this,dateSpan:{range:n.dateSpan.range,allDay:n.dateSpan.allDay,resourceId:s.id},rect:{left:n.left,right:n.right,top:r.tops[i],bottom:r.bottoms[i]},dayEl:n.dayEl,layer:0}}}},i.prototype.setResourceAreaWidth=function(e){this.resourceAreaWidth=e,t.applyStyleProp(this.resourceAreaHeadEl,"width",e||"")},i.prototype.initResourceAreaWidthDragging=function(){var e=this,t=Array.prototype.slice.call(this.el.querySelectorAll(".fc-col-resizer")),r=this.calendar.pluginSystem.hooks.elementDraggingImpl;r&&(this.resourceAreaWidthDraggings=t.map(function(t){var o,i,s=new r(t);return s.emitter.on("dragstart",function(){"number"!=typeof(o=e.resourceAreaWidth)&&(o=e.resourceAreaHeadEl.getBoundingClientRect().width),i=e.el.getBoundingClientRect().width}),s.emitter.on("dragmove",function(t){var r=o+t.deltaX*(e.isRtl?-1:1);r=Math.max(r,30),r=Math.min(r,i-30),e.setResourceAreaWidth(r)}),s.setAutoScrollEnabled(!1),s}))},i.needsResourceData=!0,i}(t.View);function S(e){for(var t in e){if(e[t].businessHours)return!0}return!1}function x(e){for(var t=0,r=e;t<r.length;t++){var o=r[t];if(o.group)return!0;if(o.resource&&o.hasChildren)return!0}return!1}var E=t.createPlugin({deps:[s,i],defaultView:"resourceTimelineDay",views:{resourceTimeline:{class:v,resourceAreaWidth:"30%",resourcesInitiallyExpanded:!0,eventResizableFromStart:!0},resourceTimelineDay:{type:"resourceTimeline",duration:{days:1}},resourceTimelineWeek:{type:"resourceTimeline",duration:{weeks:1}},resourceTimelineMonth:{type:"resourceTimeline",duration:{months:1}},resourceTimelineYear:{type:"resourceTimeline",duration:{years:1}}}});e.ResourceTimelineView=v,e.default=E,Object.defineProperty(e,"__esModule",{value:!0})});
\ No newline at end of file