@fullcalendar/resource-timegrid 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,18 @@
1
+
2
+ For complete licensing information, visit:
3
+ http://fullcalendar.io/scheduler/license
4
+
5
+ FullCalendar Scheduler is tri-licensed, meaning you must choose
6
+ one of three licenses to use. Here is a summary of those licenses:
7
+
8
+ - Commercial License
9
+ (a paid license, meant for commercial use)
10
+ http://fullcalendar.io/scheduler/license-details
11
+
12
+ - Creative Commons Non-Commercial No-Derivatives
13
+ (meant for trial and non-commercial use)
14
+ https://creativecommons.org/licenses/by-nc-nd/4.0/
15
+
16
+ - GPLv3 License
17
+ (meant for open-source projects)
18
+ http://www.gnu.org/licenses/gpl-3.0.en.html
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+
2
+ # FullCalendar Resource Time Grid Plugin
3
+
4
+ Displays events on a vertical resource view with time slots
5
+
6
+ [View the docs »](https://fullcalendar.io/docs/vertical-resource-view)
7
+
8
+ This package was created from the [FullCalendar monorepo »](https://github.com/fullcalendar/fullcalendar-scheduler)
package/main.cjs.js ADDED
@@ -0,0 +1,134 @@
1
+ /*!
2
+ FullCalendar Scheduler v5.10.0
3
+ Docs & License: https://fullcalendar.io/scheduler
4
+ (c) 2021 Adam Shaw
5
+ */
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ var common = require('@fullcalendar/common');
11
+ var premiumCommonPlugin = require('@fullcalendar/premium-common');
12
+ var resourceCommonPlugin = require('@fullcalendar/resource-common');
13
+ var timeGridPlugin = require('@fullcalendar/timegrid');
14
+ var tslib = require('tslib');
15
+ var resourceDaygrid = require('@fullcalendar/resource-daygrid');
16
+
17
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
+
19
+ var premiumCommonPlugin__default = /*#__PURE__*/_interopDefaultLegacy(premiumCommonPlugin);
20
+ var resourceCommonPlugin__default = /*#__PURE__*/_interopDefaultLegacy(resourceCommonPlugin);
21
+ var timeGridPlugin__default = /*#__PURE__*/_interopDefaultLegacy(timeGridPlugin);
22
+
23
+ var ResourceDayTimeColsJoiner = /** @class */ (function (_super) {
24
+ tslib.__extends(ResourceDayTimeColsJoiner, _super);
25
+ function ResourceDayTimeColsJoiner() {
26
+ return _super !== null && _super.apply(this, arguments) || this;
27
+ }
28
+ ResourceDayTimeColsJoiner.prototype.transformSeg = function (seg, resourceDayTable, resourceI) {
29
+ return [
30
+ tslib.__assign(tslib.__assign({}, seg), { col: resourceDayTable.computeCol(seg.col, resourceI) }),
31
+ ];
32
+ };
33
+ return ResourceDayTimeColsJoiner;
34
+ }(resourceCommonPlugin.VResourceJoiner));
35
+
36
+ var ResourceDayTimeCols = /** @class */ (function (_super) {
37
+ tslib.__extends(ResourceDayTimeCols, _super);
38
+ function ResourceDayTimeCols() {
39
+ var _this = _super !== null && _super.apply(this, arguments) || this;
40
+ _this.buildDayRanges = common.memoize(timeGridPlugin.buildDayRanges);
41
+ _this.splitter = new resourceCommonPlugin.VResourceSplitter();
42
+ _this.slicers = {};
43
+ _this.joiner = new ResourceDayTimeColsJoiner();
44
+ _this.timeColsRef = common.createRef();
45
+ _this.isHitComboAllowed = function (hit0, hit1) {
46
+ var allowAcrossResources = _this.dayRanges.length === 1;
47
+ return allowAcrossResources || hit0.dateSpan.resourceId === hit1.dateSpan.resourceId;
48
+ };
49
+ return _this;
50
+ }
51
+ ResourceDayTimeCols.prototype.render = function () {
52
+ var _this = this;
53
+ var _a = this, props = _a.props, context = _a.context;
54
+ var dateEnv = context.dateEnv, options = context.options;
55
+ var dateProfile = props.dateProfile, resourceDayTableModel = props.resourceDayTableModel;
56
+ var dayRanges = this.dayRanges = this.buildDayRanges(resourceDayTableModel.dayTableModel, dateProfile, dateEnv);
57
+ var splitProps = this.splitter.splitProps(props);
58
+ this.slicers = common.mapHash(splitProps, function (split, resourceId) { return _this.slicers[resourceId] || new timeGridPlugin.DayTimeColsSlicer(); });
59
+ var slicedProps = common.mapHash(this.slicers, function (slicer, resourceId) { return slicer.sliceProps(splitProps[resourceId], dateProfile, null, context, dayRanges); });
60
+ return ( // TODO: would move this further down hierarchy, but sliceNowDate needs it
61
+ common.createElement(common.NowTimer, { unit: options.nowIndicator ? 'minute' : 'day' }, function (nowDate, todayRange) { return (common.createElement(timeGridPlugin.TimeCols, tslib.__assign({ ref: _this.timeColsRef }, _this.joiner.joinProps(slicedProps, resourceDayTableModel), { dateProfile: dateProfile, axis: props.axis, slotDuration: props.slotDuration, slatMetas: props.slatMetas, cells: resourceDayTableModel.cells[0], tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, clientWidth: props.clientWidth, clientHeight: props.clientHeight, expandRows: props.expandRows, nowDate: nowDate, nowIndicatorSegs: options.nowIndicator && _this.buildNowIndicatorSegs(nowDate), todayRange: todayRange, onScrollTopRequest: props.onScrollTopRequest, forPrint: props.forPrint, onSlatCoords: props.onSlatCoords, isHitComboAllowed: _this.isHitComboAllowed }))); }));
62
+ };
63
+ ResourceDayTimeCols.prototype.buildNowIndicatorSegs = function (date) {
64
+ var nonResourceSegs = this.slicers[''].sliceNowDate(date, this.context, this.dayRanges);
65
+ return this.joiner.expandSegs(this.props.resourceDayTableModel, nonResourceSegs);
66
+ };
67
+ return ResourceDayTimeCols;
68
+ }(common.DateComponent));
69
+
70
+ var ResourceDayTimeColsView = /** @class */ (function (_super) {
71
+ tslib.__extends(ResourceDayTimeColsView, _super);
72
+ function ResourceDayTimeColsView() {
73
+ var _this = _super !== null && _super.apply(this, arguments) || this;
74
+ _this.flattenResources = common.memoize(resourceCommonPlugin.flattenResources);
75
+ _this.buildResourceTimeColsModel = common.memoize(buildResourceTimeColsModel);
76
+ _this.buildSlatMetas = common.memoize(timeGridPlugin.buildSlatMetas);
77
+ return _this;
78
+ }
79
+ ResourceDayTimeColsView.prototype.render = function () {
80
+ var _this = this;
81
+ var _a = this, props = _a.props, context = _a.context;
82
+ var options = context.options, dateEnv = context.dateEnv;
83
+ var dateProfile = props.dateProfile;
84
+ var splitProps = this.allDaySplitter.splitProps(props);
85
+ var resourceOrderSpecs = options.resourceOrder || resourceCommonPlugin.DEFAULT_RESOURCE_ORDER;
86
+ var resources = this.flattenResources(props.resourceStore, resourceOrderSpecs);
87
+ var resourceDayTableModel = this.buildResourceTimeColsModel(dateProfile, context.dateProfileGenerator, resources, options.datesAboveResources, context);
88
+ var slatMetas = this.buildSlatMetas(dateProfile.slotMinTime, dateProfile.slotMaxTime, options.slotLabelInterval, options.slotDuration, dateEnv);
89
+ var dayMinWidth = options.dayMinWidth;
90
+ var hasAttachedAxis = !dayMinWidth;
91
+ var hasDetachedAxis = dayMinWidth;
92
+ var headerContent = options.dayHeaders && (common.createElement(resourceCommonPlugin.ResourceDayHeader, { resources: resources, dates: resourceDayTableModel.dayTableModel.headerDates, dateProfile: dateProfile, datesRepDistinctDays: true, renderIntro: hasAttachedAxis ? this.renderHeadAxis : null }));
93
+ var allDayContent = (options.allDaySlot !== false) && (function (contentArg) { return (common.createElement(resourceDaygrid.ResourceDayTable, tslib.__assign({}, splitProps.allDay, { dateProfile: dateProfile, resourceDayTableModel: resourceDayTableModel, nextDayThreshold: options.nextDayThreshold, tableMinWidth: contentArg.tableMinWidth, colGroupNode: contentArg.tableColGroupNode, renderRowIntro: hasAttachedAxis ? _this.renderTableRowAxis : null, showWeekNumbers: false, expandRows: false, headerAlignElRef: _this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }, _this.getAllDayMaxEventProps()))); });
94
+ var timeGridContent = function (contentArg) { return (common.createElement(ResourceDayTimeCols, tslib.__assign({}, splitProps.timed, { dateProfile: dateProfile, axis: hasAttachedAxis, slotDuration: options.slotDuration, slatMetas: slatMetas, resourceDayTableModel: resourceDayTableModel, tableColGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, onSlatCoords: _this.handleSlatCoords, expandRows: contentArg.expandRows, forPrint: props.forPrint, onScrollTopRequest: _this.handleScrollTopRequest }))); };
95
+ return hasDetachedAxis
96
+ ? this.renderHScrollLayout(headerContent, allDayContent, timeGridContent, resourceDayTableModel.colCnt, dayMinWidth, slatMetas, this.state.slatCoords)
97
+ : this.renderSimpleLayout(headerContent, allDayContent, timeGridContent);
98
+ };
99
+ return ResourceDayTimeColsView;
100
+ }(timeGridPlugin.TimeColsView));
101
+ function buildResourceTimeColsModel(dateProfile, dateProfileGenerator, resources, datesAboveResources, context) {
102
+ var dayTable = timeGridPlugin.buildTimeColsModel(dateProfile, dateProfileGenerator);
103
+ return datesAboveResources ?
104
+ new resourceCommonPlugin.DayResourceTableModel(dayTable, resources, context) :
105
+ new resourceCommonPlugin.ResourceDayTableModel(dayTable, resources, context);
106
+ }
107
+
108
+ var main = common.createPlugin({
109
+ deps: [
110
+ premiumCommonPlugin__default['default'],
111
+ resourceCommonPlugin__default['default'],
112
+ timeGridPlugin__default['default'],
113
+ ],
114
+ initialView: 'resourceTimeGridDay',
115
+ views: {
116
+ resourceTimeGrid: {
117
+ type: 'timeGrid',
118
+ component: ResourceDayTimeColsView,
119
+ needsResourceData: true,
120
+ },
121
+ resourceTimeGridDay: {
122
+ type: 'resourceTimeGrid',
123
+ duration: { days: 1 },
124
+ },
125
+ resourceTimeGridWeek: {
126
+ type: 'resourceTimeGrid',
127
+ duration: { weeks: 1 },
128
+ },
129
+ },
130
+ });
131
+
132
+ exports.ResourceDayTimeCols = ResourceDayTimeCols;
133
+ exports.ResourceDayTimeColsView = ResourceDayTimeColsView;
134
+ exports.default = main;
package/main.d.ts ADDED
@@ -0,0 +1,54 @@
1
+
2
+ import * as _fullcalendar_common from '@fullcalendar/common';
3
+ import { createElement, DateComponent, Hit, DateMarker, DateProfile, Duration, EventStore, EventUiHash, DateSpan, EventInteractionState, VNode, CssDimValue } from '@fullcalendar/common';
4
+ import '@fullcalendar/premium-common';
5
+ import { TimeColsView, TimeSlatMeta, TimeColsSlatsCoords } from '@fullcalendar/timegrid';
6
+ import { ResourceViewProps, AbstractResourceDayTableModel } from '@fullcalendar/resource-common';
7
+
8
+ declare class ResourceDayTimeColsView extends TimeColsView {
9
+ props: ResourceViewProps;
10
+ private flattenResources;
11
+ private buildResourceTimeColsModel;
12
+ private buildSlatMetas;
13
+ render(): createElement.JSX.Element;
14
+ }
15
+
16
+ interface ResourceDayTimeColsProps {
17
+ dateProfile: DateProfile;
18
+ resourceDayTableModel: AbstractResourceDayTableModel;
19
+ axis: boolean;
20
+ slotDuration: Duration;
21
+ slatMetas: TimeSlatMeta[];
22
+ businessHours: EventStore;
23
+ eventStore: EventStore;
24
+ eventUiBases: EventUiHash;
25
+ dateSelection: DateSpan | null;
26
+ eventSelection: string;
27
+ eventDrag: EventInteractionState | null;
28
+ eventResize: EventInteractionState | null;
29
+ tableColGroupNode: VNode;
30
+ tableMinWidth: CssDimValue;
31
+ clientWidth: number | null;
32
+ clientHeight: number | null;
33
+ expandRows: boolean;
34
+ onScrollTopRequest?: (scrollTop: number) => void;
35
+ forPrint: boolean;
36
+ onSlatCoords?: (slatCoords: TimeColsSlatsCoords) => void;
37
+ }
38
+ declare class ResourceDayTimeCols extends DateComponent<ResourceDayTimeColsProps> {
39
+ private buildDayRanges;
40
+ private dayRanges;
41
+ private splitter;
42
+ private slicers;
43
+ private joiner;
44
+ private timeColsRef;
45
+ render(): createElement.JSX.Element;
46
+ isHitComboAllowed: (hit0: Hit, hit1: Hit) => boolean;
47
+ buildNowIndicatorSegs(date: DateMarker): any[];
48
+ }
49
+
50
+ declare const _default: _fullcalendar_common.PluginDef;
51
+
52
+
53
+ export default _default;
54
+ export { ResourceDayTimeCols, ResourceDayTimeColsView };
package/main.global.js ADDED
@@ -0,0 +1,176 @@
1
+ /*!
2
+ FullCalendar Scheduler v5.10.0
3
+ Docs & License: https://fullcalendar.io/scheduler
4
+ (c) 2021 Adam Shaw
5
+ */
6
+ var FullCalendarResourceTimeGrid = (function (exports, common, premiumCommonPlugin, resourceCommonPlugin, timeGridPlugin, resourceDaygrid) {
7
+ 'use strict';
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var premiumCommonPlugin__default = /*#__PURE__*/_interopDefaultLegacy(premiumCommonPlugin);
12
+ var resourceCommonPlugin__default = /*#__PURE__*/_interopDefaultLegacy(resourceCommonPlugin);
13
+ var timeGridPlugin__default = /*#__PURE__*/_interopDefaultLegacy(timeGridPlugin);
14
+
15
+ /*! *****************************************************************************
16
+ Copyright (c) Microsoft Corporation.
17
+
18
+ Permission to use, copy, modify, and/or distribute this software for any
19
+ purpose with or without fee is hereby granted.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
22
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
23
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
24
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
+ PERFORMANCE OF THIS SOFTWARE.
28
+ ***************************************************************************** */
29
+ /* global Reflect, Promise */
30
+
31
+ var extendStatics = function(d, b) {
32
+ extendStatics = Object.setPrototypeOf ||
33
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
34
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
35
+ return extendStatics(d, b);
36
+ };
37
+
38
+ function __extends(d, b) {
39
+ if (typeof b !== "function" && b !== null)
40
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
41
+ extendStatics(d, b);
42
+ function __() { this.constructor = d; }
43
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
44
+ }
45
+
46
+ var __assign = function() {
47
+ __assign = Object.assign || function __assign(t) {
48
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
49
+ s = arguments[i];
50
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
51
+ }
52
+ return t;
53
+ };
54
+ return __assign.apply(this, arguments);
55
+ };
56
+
57
+ var ResourceDayTimeColsJoiner = /** @class */ (function (_super) {
58
+ __extends(ResourceDayTimeColsJoiner, _super);
59
+ function ResourceDayTimeColsJoiner() {
60
+ return _super !== null && _super.apply(this, arguments) || this;
61
+ }
62
+ ResourceDayTimeColsJoiner.prototype.transformSeg = function (seg, resourceDayTable, resourceI) {
63
+ return [
64
+ __assign(__assign({}, seg), { col: resourceDayTable.computeCol(seg.col, resourceI) }),
65
+ ];
66
+ };
67
+ return ResourceDayTimeColsJoiner;
68
+ }(resourceCommonPlugin.VResourceJoiner));
69
+
70
+ var ResourceDayTimeCols = /** @class */ (function (_super) {
71
+ __extends(ResourceDayTimeCols, _super);
72
+ function ResourceDayTimeCols() {
73
+ var _this = _super !== null && _super.apply(this, arguments) || this;
74
+ _this.buildDayRanges = common.memoize(timeGridPlugin.buildDayRanges);
75
+ _this.splitter = new resourceCommonPlugin.VResourceSplitter();
76
+ _this.slicers = {};
77
+ _this.joiner = new ResourceDayTimeColsJoiner();
78
+ _this.timeColsRef = common.createRef();
79
+ _this.isHitComboAllowed = function (hit0, hit1) {
80
+ var allowAcrossResources = _this.dayRanges.length === 1;
81
+ return allowAcrossResources || hit0.dateSpan.resourceId === hit1.dateSpan.resourceId;
82
+ };
83
+ return _this;
84
+ }
85
+ ResourceDayTimeCols.prototype.render = function () {
86
+ var _this = this;
87
+ var _a = this, props = _a.props, context = _a.context;
88
+ var dateEnv = context.dateEnv, options = context.options;
89
+ var dateProfile = props.dateProfile, resourceDayTableModel = props.resourceDayTableModel;
90
+ var dayRanges = this.dayRanges = this.buildDayRanges(resourceDayTableModel.dayTableModel, dateProfile, dateEnv);
91
+ var splitProps = this.splitter.splitProps(props);
92
+ this.slicers = common.mapHash(splitProps, function (split, resourceId) { return _this.slicers[resourceId] || new timeGridPlugin.DayTimeColsSlicer(); });
93
+ var slicedProps = common.mapHash(this.slicers, function (slicer, resourceId) { return slicer.sliceProps(splitProps[resourceId], dateProfile, null, context, dayRanges); });
94
+ return ( // TODO: would move this further down hierarchy, but sliceNowDate needs it
95
+ common.createElement(common.NowTimer, { unit: options.nowIndicator ? 'minute' : 'day' }, function (nowDate, todayRange) { return (common.createElement(timeGridPlugin.TimeCols, __assign({ ref: _this.timeColsRef }, _this.joiner.joinProps(slicedProps, resourceDayTableModel), { dateProfile: dateProfile, axis: props.axis, slotDuration: props.slotDuration, slatMetas: props.slatMetas, cells: resourceDayTableModel.cells[0], tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, clientWidth: props.clientWidth, clientHeight: props.clientHeight, expandRows: props.expandRows, nowDate: nowDate, nowIndicatorSegs: options.nowIndicator && _this.buildNowIndicatorSegs(nowDate), todayRange: todayRange, onScrollTopRequest: props.onScrollTopRequest, forPrint: props.forPrint, onSlatCoords: props.onSlatCoords, isHitComboAllowed: _this.isHitComboAllowed }))); }));
96
+ };
97
+ ResourceDayTimeCols.prototype.buildNowIndicatorSegs = function (date) {
98
+ var nonResourceSegs = this.slicers[''].sliceNowDate(date, this.context, this.dayRanges);
99
+ return this.joiner.expandSegs(this.props.resourceDayTableModel, nonResourceSegs);
100
+ };
101
+ return ResourceDayTimeCols;
102
+ }(common.DateComponent));
103
+
104
+ var ResourceDayTimeColsView = /** @class */ (function (_super) {
105
+ __extends(ResourceDayTimeColsView, _super);
106
+ function ResourceDayTimeColsView() {
107
+ var _this = _super !== null && _super.apply(this, arguments) || this;
108
+ _this.flattenResources = common.memoize(resourceCommonPlugin.flattenResources);
109
+ _this.buildResourceTimeColsModel = common.memoize(buildResourceTimeColsModel);
110
+ _this.buildSlatMetas = common.memoize(timeGridPlugin.buildSlatMetas);
111
+ return _this;
112
+ }
113
+ ResourceDayTimeColsView.prototype.render = function () {
114
+ var _this = this;
115
+ var _a = this, props = _a.props, context = _a.context;
116
+ var options = context.options, dateEnv = context.dateEnv;
117
+ var dateProfile = props.dateProfile;
118
+ var splitProps = this.allDaySplitter.splitProps(props);
119
+ var resourceOrderSpecs = options.resourceOrder || resourceCommonPlugin.DEFAULT_RESOURCE_ORDER;
120
+ var resources = this.flattenResources(props.resourceStore, resourceOrderSpecs);
121
+ var resourceDayTableModel = this.buildResourceTimeColsModel(dateProfile, context.dateProfileGenerator, resources, options.datesAboveResources, context);
122
+ var slatMetas = this.buildSlatMetas(dateProfile.slotMinTime, dateProfile.slotMaxTime, options.slotLabelInterval, options.slotDuration, dateEnv);
123
+ var dayMinWidth = options.dayMinWidth;
124
+ var hasAttachedAxis = !dayMinWidth;
125
+ var hasDetachedAxis = dayMinWidth;
126
+ var headerContent = options.dayHeaders && (common.createElement(resourceCommonPlugin.ResourceDayHeader, { resources: resources, dates: resourceDayTableModel.dayTableModel.headerDates, dateProfile: dateProfile, datesRepDistinctDays: true, renderIntro: hasAttachedAxis ? this.renderHeadAxis : null }));
127
+ var allDayContent = (options.allDaySlot !== false) && (function (contentArg) { return (common.createElement(resourceDaygrid.ResourceDayTable, __assign({}, splitProps.allDay, { dateProfile: dateProfile, resourceDayTableModel: resourceDayTableModel, nextDayThreshold: options.nextDayThreshold, tableMinWidth: contentArg.tableMinWidth, colGroupNode: contentArg.tableColGroupNode, renderRowIntro: hasAttachedAxis ? _this.renderTableRowAxis : null, showWeekNumbers: false, expandRows: false, headerAlignElRef: _this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }, _this.getAllDayMaxEventProps()))); });
128
+ var timeGridContent = function (contentArg) { return (common.createElement(ResourceDayTimeCols, __assign({}, splitProps.timed, { dateProfile: dateProfile, axis: hasAttachedAxis, slotDuration: options.slotDuration, slatMetas: slatMetas, resourceDayTableModel: resourceDayTableModel, tableColGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, onSlatCoords: _this.handleSlatCoords, expandRows: contentArg.expandRows, forPrint: props.forPrint, onScrollTopRequest: _this.handleScrollTopRequest }))); };
129
+ return hasDetachedAxis
130
+ ? this.renderHScrollLayout(headerContent, allDayContent, timeGridContent, resourceDayTableModel.colCnt, dayMinWidth, slatMetas, this.state.slatCoords)
131
+ : this.renderSimpleLayout(headerContent, allDayContent, timeGridContent);
132
+ };
133
+ return ResourceDayTimeColsView;
134
+ }(timeGridPlugin.TimeColsView));
135
+ function buildResourceTimeColsModel(dateProfile, dateProfileGenerator, resources, datesAboveResources, context) {
136
+ var dayTable = timeGridPlugin.buildTimeColsModel(dateProfile, dateProfileGenerator);
137
+ return datesAboveResources ?
138
+ new resourceCommonPlugin.DayResourceTableModel(dayTable, resources, context) :
139
+ new resourceCommonPlugin.ResourceDayTableModel(dayTable, resources, context);
140
+ }
141
+
142
+ var plugin = common.createPlugin({
143
+ deps: [
144
+ premiumCommonPlugin__default['default'],
145
+ resourceCommonPlugin__default['default'],
146
+ timeGridPlugin__default['default'],
147
+ ],
148
+ initialView: 'resourceTimeGridDay',
149
+ views: {
150
+ resourceTimeGrid: {
151
+ type: 'timeGrid',
152
+ component: ResourceDayTimeColsView,
153
+ needsResourceData: true,
154
+ },
155
+ resourceTimeGridDay: {
156
+ type: 'resourceTimeGrid',
157
+ duration: { days: 1 },
158
+ },
159
+ resourceTimeGridWeek: {
160
+ type: 'resourceTimeGrid',
161
+ duration: { weeks: 1 },
162
+ },
163
+ },
164
+ });
165
+
166
+ common.globalPlugins.push(plugin);
167
+
168
+ exports.ResourceDayTimeCols = ResourceDayTimeCols;
169
+ exports.ResourceDayTimeColsView = ResourceDayTimeColsView;
170
+ exports.default = plugin;
171
+
172
+ Object.defineProperty(exports, '__esModule', { value: true });
173
+
174
+ return exports;
175
+
176
+ }({}, FullCalendar, FullCalendarPremiumCommon, FullCalendarResourceCommon, FullCalendarTimeGrid, FullCalendarResourceDayGrid));
@@ -0,0 +1,6 @@
1
+ /*!
2
+ FullCalendar Scheduler v5.10.0
3
+ Docs & License: https://fullcalendar.io/scheduler
4
+ (c) 2021 Adam Shaw
5
+ */
6
+ var FullCalendarResourceTimeGrid=function(e,t,o,r,n,i){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(o),s=l(r),u=l(n),d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var p=function(){return(p=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.transformSeg=function(e,t,o){return[p(p({},e),{col:t.computeCol(e.col,o)})]},t}(r.VResourceJoiner),f=function(e){function o(){var o=null!==e&&e.apply(this,arguments)||this;return o.buildDayRanges=t.memoize(n.buildDayRanges),o.splitter=new r.VResourceSplitter,o.slicers={},o.joiner=new h,o.timeColsRef=t.createRef(),o.isHitComboAllowed=function(e,t){return 1===o.dayRanges.length||e.dateSpan.resourceId===t.dateSpan.resourceId},o}return c(o,e),o.prototype.render=function(){var e=this,o=this.props,r=this.context,i=r.dateEnv,l=r.options,a=o.dateProfile,s=o.resourceDayTableModel,u=this.dayRanges=this.buildDayRanges(s.dayTableModel,a,i),d=this.splitter.splitProps(o);this.slicers=t.mapHash(d,(function(t,o){return e.slicers[o]||new n.DayTimeColsSlicer}));var c=t.mapHash(this.slicers,(function(e,t){return e.sliceProps(d[t],a,null,r,u)}));return t.createElement(t.NowTimer,{unit:l.nowIndicator?"minute":"day"},(function(r,i){return t.createElement(n.TimeCols,p({ref:e.timeColsRef},e.joiner.joinProps(c,s),{dateProfile:a,axis:o.axis,slotDuration:o.slotDuration,slatMetas:o.slatMetas,cells:s.cells[0],tableColGroupNode:o.tableColGroupNode,tableMinWidth:o.tableMinWidth,clientWidth:o.clientWidth,clientHeight:o.clientHeight,expandRows:o.expandRows,nowDate:r,nowIndicatorSegs:l.nowIndicator&&e.buildNowIndicatorSegs(r),todayRange:i,onScrollTopRequest:o.onScrollTopRequest,forPrint:o.forPrint,onSlatCoords:o.onSlatCoords,isHitComboAllowed:e.isHitComboAllowed}))}))},o.prototype.buildNowIndicatorSegs=function(e){var t=this.slicers[""].sliceNowDate(e,this.context,this.dayRanges);return this.joiner.expandSegs(this.props.resourceDayTableModel,t)},o}(t.DateComponent),y=function(e){function o(){var o=null!==e&&e.apply(this,arguments)||this;return o.flattenResources=t.memoize(r.flattenResources),o.buildResourceTimeColsModel=t.memoize(m),o.buildSlatMetas=t.memoize(n.buildSlatMetas),o}return c(o,e),o.prototype.render=function(){var e=this,o=this.props,n=this.context,l=n.options,a=n.dateEnv,s=o.dateProfile,u=this.allDaySplitter.splitProps(o),d=l.resourceOrder||r.DEFAULT_RESOURCE_ORDER,c=this.flattenResources(o.resourceStore,d),h=this.buildResourceTimeColsModel(s,n.dateProfileGenerator,c,l.datesAboveResources,n),y=this.buildSlatMetas(s.slotMinTime,s.slotMaxTime,l.slotLabelInterval,l.slotDuration,a),m=l.dayMinWidth,b=!m,R=m,D=l.dayHeaders&&t.createElement(r.ResourceDayHeader,{resources:c,dates:h.dayTableModel.headerDates,dateProfile:s,datesRepDistinctDays:!0,renderIntro:b?this.renderHeadAxis:null}),T=!1!==l.allDaySlot&&function(r){return t.createElement(i.ResourceDayTable,p({},u.allDay,{dateProfile:s,resourceDayTableModel:h,nextDayThreshold:l.nextDayThreshold,tableMinWidth:r.tableMinWidth,colGroupNode:r.tableColGroupNode,renderRowIntro:b?e.renderTableRowAxis:null,showWeekNumbers:!1,expandRows:!1,headerAlignElRef:e.headerElRef,clientWidth:r.clientWidth,clientHeight:r.clientHeight,forPrint:o.forPrint},e.getAllDayMaxEventProps()))},C=function(r){return t.createElement(f,p({},u.timed,{dateProfile:s,axis:b,slotDuration:l.slotDuration,slatMetas:y,resourceDayTableModel:h,tableColGroupNode:r.tableColGroupNode,tableMinWidth:r.tableMinWidth,clientWidth:r.clientWidth,clientHeight:r.clientHeight,onSlatCoords:e.handleSlatCoords,expandRows:r.expandRows,forPrint:o.forPrint,onScrollTopRequest:e.handleScrollTopRequest}))};return R?this.renderHScrollLayout(D,T,C,h.colCnt,m,y,this.state.slatCoords):this.renderSimpleLayout(D,T,C)},o}(n.TimeColsView);function m(e,t,o,i,l){var a=n.buildTimeColsModel(e,t);return i?new r.DayResourceTableModel(a,o,l):new r.ResourceDayTableModel(a,o,l)}var b=t.createPlugin({deps:[a.default,s.default,u.default],initialView:"resourceTimeGridDay",views:{resourceTimeGrid:{type:"timeGrid",component:y,needsResourceData:!0},resourceTimeGridDay:{type:"resourceTimeGrid",duration:{days:1}},resourceTimeGridWeek:{type:"resourceTimeGrid",duration:{weeks:1}}}});return t.globalPlugins.push(b),e.ResourceDayTimeCols=f,e.ResourceDayTimeColsView=y,e.default=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendarPremiumCommon,FullCalendarResourceCommon,FullCalendarTimeGrid,FullCalendarResourceDayGrid);
package/main.js ADDED
@@ -0,0 +1,124 @@
1
+ /*!
2
+ FullCalendar Scheduler v5.10.0
3
+ Docs & License: https://fullcalendar.io/scheduler
4
+ (c) 2021 Adam Shaw
5
+ */
6
+ import { memoize, createRef, mapHash, createElement, NowTimer, DateComponent, createPlugin } from '@fullcalendar/common';
7
+ import premiumCommonPlugin from '@fullcalendar/premium-common';
8
+ import resourceCommonPlugin, { VResourceJoiner, VResourceSplitter, flattenResources, DEFAULT_RESOURCE_ORDER, ResourceDayHeader, DayResourceTableModel, ResourceDayTableModel } from '@fullcalendar/resource-common';
9
+ import timeGridPlugin, { buildDayRanges, DayTimeColsSlicer, TimeCols, buildSlatMetas, TimeColsView, buildTimeColsModel } from '@fullcalendar/timegrid';
10
+ import { __extends, __assign } from 'tslib';
11
+ import { ResourceDayTable } from '@fullcalendar/resource-daygrid';
12
+
13
+ var ResourceDayTimeColsJoiner = /** @class */ (function (_super) {
14
+ __extends(ResourceDayTimeColsJoiner, _super);
15
+ function ResourceDayTimeColsJoiner() {
16
+ return _super !== null && _super.apply(this, arguments) || this;
17
+ }
18
+ ResourceDayTimeColsJoiner.prototype.transformSeg = function (seg, resourceDayTable, resourceI) {
19
+ return [
20
+ __assign(__assign({}, seg), { col: resourceDayTable.computeCol(seg.col, resourceI) }),
21
+ ];
22
+ };
23
+ return ResourceDayTimeColsJoiner;
24
+ }(VResourceJoiner));
25
+
26
+ var ResourceDayTimeCols = /** @class */ (function (_super) {
27
+ __extends(ResourceDayTimeCols, _super);
28
+ function ResourceDayTimeCols() {
29
+ var _this = _super !== null && _super.apply(this, arguments) || this;
30
+ _this.buildDayRanges = memoize(buildDayRanges);
31
+ _this.splitter = new VResourceSplitter();
32
+ _this.slicers = {};
33
+ _this.joiner = new ResourceDayTimeColsJoiner();
34
+ _this.timeColsRef = createRef();
35
+ _this.isHitComboAllowed = function (hit0, hit1) {
36
+ var allowAcrossResources = _this.dayRanges.length === 1;
37
+ return allowAcrossResources || hit0.dateSpan.resourceId === hit1.dateSpan.resourceId;
38
+ };
39
+ return _this;
40
+ }
41
+ ResourceDayTimeCols.prototype.render = function () {
42
+ var _this = this;
43
+ var _a = this, props = _a.props, context = _a.context;
44
+ var dateEnv = context.dateEnv, options = context.options;
45
+ var dateProfile = props.dateProfile, resourceDayTableModel = props.resourceDayTableModel;
46
+ var dayRanges = this.dayRanges = this.buildDayRanges(resourceDayTableModel.dayTableModel, dateProfile, dateEnv);
47
+ var splitProps = this.splitter.splitProps(props);
48
+ this.slicers = mapHash(splitProps, function (split, resourceId) { return _this.slicers[resourceId] || new DayTimeColsSlicer(); });
49
+ var slicedProps = mapHash(this.slicers, function (slicer, resourceId) { return slicer.sliceProps(splitProps[resourceId], dateProfile, null, context, dayRanges); });
50
+ return ( // TODO: would move this further down hierarchy, but sliceNowDate needs it
51
+ createElement(NowTimer, { unit: options.nowIndicator ? 'minute' : 'day' }, function (nowDate, todayRange) { return (createElement(TimeCols, __assign({ ref: _this.timeColsRef }, _this.joiner.joinProps(slicedProps, resourceDayTableModel), { dateProfile: dateProfile, axis: props.axis, slotDuration: props.slotDuration, slatMetas: props.slatMetas, cells: resourceDayTableModel.cells[0], tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, clientWidth: props.clientWidth, clientHeight: props.clientHeight, expandRows: props.expandRows, nowDate: nowDate, nowIndicatorSegs: options.nowIndicator && _this.buildNowIndicatorSegs(nowDate), todayRange: todayRange, onScrollTopRequest: props.onScrollTopRequest, forPrint: props.forPrint, onSlatCoords: props.onSlatCoords, isHitComboAllowed: _this.isHitComboAllowed }))); }));
52
+ };
53
+ ResourceDayTimeCols.prototype.buildNowIndicatorSegs = function (date) {
54
+ var nonResourceSegs = this.slicers[''].sliceNowDate(date, this.context, this.dayRanges);
55
+ return this.joiner.expandSegs(this.props.resourceDayTableModel, nonResourceSegs);
56
+ };
57
+ return ResourceDayTimeCols;
58
+ }(DateComponent));
59
+
60
+ var ResourceDayTimeColsView = /** @class */ (function (_super) {
61
+ __extends(ResourceDayTimeColsView, _super);
62
+ function ResourceDayTimeColsView() {
63
+ var _this = _super !== null && _super.apply(this, arguments) || this;
64
+ _this.flattenResources = memoize(flattenResources);
65
+ _this.buildResourceTimeColsModel = memoize(buildResourceTimeColsModel);
66
+ _this.buildSlatMetas = memoize(buildSlatMetas);
67
+ return _this;
68
+ }
69
+ ResourceDayTimeColsView.prototype.render = function () {
70
+ var _this = this;
71
+ var _a = this, props = _a.props, context = _a.context;
72
+ var options = context.options, dateEnv = context.dateEnv;
73
+ var dateProfile = props.dateProfile;
74
+ var splitProps = this.allDaySplitter.splitProps(props);
75
+ var resourceOrderSpecs = options.resourceOrder || DEFAULT_RESOURCE_ORDER;
76
+ var resources = this.flattenResources(props.resourceStore, resourceOrderSpecs);
77
+ var resourceDayTableModel = this.buildResourceTimeColsModel(dateProfile, context.dateProfileGenerator, resources, options.datesAboveResources, context);
78
+ var slatMetas = this.buildSlatMetas(dateProfile.slotMinTime, dateProfile.slotMaxTime, options.slotLabelInterval, options.slotDuration, dateEnv);
79
+ var dayMinWidth = options.dayMinWidth;
80
+ var hasAttachedAxis = !dayMinWidth;
81
+ var hasDetachedAxis = dayMinWidth;
82
+ var headerContent = options.dayHeaders && (createElement(ResourceDayHeader, { resources: resources, dates: resourceDayTableModel.dayTableModel.headerDates, dateProfile: dateProfile, datesRepDistinctDays: true, renderIntro: hasAttachedAxis ? this.renderHeadAxis : null }));
83
+ var allDayContent = (options.allDaySlot !== false) && (function (contentArg) { return (createElement(ResourceDayTable, __assign({}, splitProps.allDay, { dateProfile: dateProfile, resourceDayTableModel: resourceDayTableModel, nextDayThreshold: options.nextDayThreshold, tableMinWidth: contentArg.tableMinWidth, colGroupNode: contentArg.tableColGroupNode, renderRowIntro: hasAttachedAxis ? _this.renderTableRowAxis : null, showWeekNumbers: false, expandRows: false, headerAlignElRef: _this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }, _this.getAllDayMaxEventProps()))); });
84
+ var timeGridContent = function (contentArg) { return (createElement(ResourceDayTimeCols, __assign({}, splitProps.timed, { dateProfile: dateProfile, axis: hasAttachedAxis, slotDuration: options.slotDuration, slatMetas: slatMetas, resourceDayTableModel: resourceDayTableModel, tableColGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, onSlatCoords: _this.handleSlatCoords, expandRows: contentArg.expandRows, forPrint: props.forPrint, onScrollTopRequest: _this.handleScrollTopRequest }))); };
85
+ return hasDetachedAxis
86
+ ? this.renderHScrollLayout(headerContent, allDayContent, timeGridContent, resourceDayTableModel.colCnt, dayMinWidth, slatMetas, this.state.slatCoords)
87
+ : this.renderSimpleLayout(headerContent, allDayContent, timeGridContent);
88
+ };
89
+ return ResourceDayTimeColsView;
90
+ }(TimeColsView));
91
+ function buildResourceTimeColsModel(dateProfile, dateProfileGenerator, resources, datesAboveResources, context) {
92
+ var dayTable = buildTimeColsModel(dateProfile, dateProfileGenerator);
93
+ return datesAboveResources ?
94
+ new DayResourceTableModel(dayTable, resources, context) :
95
+ new ResourceDayTableModel(dayTable, resources, context);
96
+ }
97
+
98
+ var main = createPlugin({
99
+ deps: [
100
+ premiumCommonPlugin,
101
+ resourceCommonPlugin,
102
+ timeGridPlugin,
103
+ ],
104
+ initialView: 'resourceTimeGridDay',
105
+ views: {
106
+ resourceTimeGrid: {
107
+ type: 'timeGrid',
108
+ component: ResourceDayTimeColsView,
109
+ needsResourceData: true,
110
+ },
111
+ resourceTimeGridDay: {
112
+ type: 'resourceTimeGrid',
113
+ duration: { days: 1 },
114
+ },
115
+ resourceTimeGridWeek: {
116
+ type: 'resourceTimeGrid',
117
+ duration: { weeks: 1 },
118
+ },
119
+ },
120
+ });
121
+
122
+ export default main;
123
+ export { ResourceDayTimeCols, ResourceDayTimeColsView };
124
+ //# sourceMappingURL=main.js.map
package/main.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sources":["src/ResourceDayTimeColsJoiner.ts","src/ResourceDayTimeCols.tsx","src/ResourceDayTimeColsView.tsx","src/main.ts"],"sourcesContent":["import { TimeColsSeg } from '@fullcalendar/timegrid'\nimport { AbstractResourceDayTableModel, VResourceJoiner } from '@fullcalendar/resource-common'\n\nexport class ResourceDayTimeColsJoiner extends VResourceJoiner<TimeColsSeg> {\n transformSeg(seg: TimeColsSeg, resourceDayTable: AbstractResourceDayTableModel, resourceI: number) {\n return [\n {\n ...seg,\n col: resourceDayTable.computeCol(seg.col, resourceI),\n },\n ]\n }\n}\n","import {\n createElement, createRef, VNode,\n mapHash, DateSpan, DateComponent, EventStore, EventUiHash, EventInteractionState, memoize, DateRange,\n DateMarker, Hit, CssDimValue, NowTimer, Duration, DateProfile,\n} from '@fullcalendar/common'\nimport { DayTimeColsSlicer, TimeCols, buildDayRanges, TimeSlatMeta, TimeColsSlatsCoords } from '@fullcalendar/timegrid'\nimport { AbstractResourceDayTableModel, VResourceSplitter } from '@fullcalendar/resource-common'\nimport { ResourceDayTimeColsJoiner } from './ResourceDayTimeColsJoiner'\n\nexport interface ResourceDayTimeColsProps {\n dateProfile: DateProfile\n resourceDayTableModel: AbstractResourceDayTableModel\n axis: boolean\n slotDuration: Duration\n slatMetas: TimeSlatMeta[]\n businessHours: EventStore\n eventStore: EventStore\n eventUiBases: EventUiHash\n dateSelection: DateSpan | null\n eventSelection: string\n eventDrag: EventInteractionState | null\n eventResize: EventInteractionState | null\n tableColGroupNode: VNode\n tableMinWidth: CssDimValue\n clientWidth: number | null\n clientHeight: number | null\n expandRows: boolean\n onScrollTopRequest?: (scrollTop: number) => void\n forPrint: boolean\n onSlatCoords?: (slatCoords: TimeColsSlatsCoords) => void\n}\n\nexport class ResourceDayTimeCols extends DateComponent<ResourceDayTimeColsProps> {\n private buildDayRanges = memoize(buildDayRanges)\n private dayRanges: DateRange[] // for now indicator\n private splitter = new VResourceSplitter()\n private slicers: { [resourceId: string]: DayTimeColsSlicer } = {}\n private joiner = new ResourceDayTimeColsJoiner()\n private timeColsRef = createRef<TimeCols>()\n\n render() {\n let { props, context } = this\n let { dateEnv, options } = context\n let { dateProfile, resourceDayTableModel } = props\n\n let dayRanges = this.dayRanges = this.buildDayRanges(resourceDayTableModel.dayTableModel, dateProfile, dateEnv)\n let splitProps = this.splitter.splitProps(props)\n\n this.slicers = mapHash(splitProps, (split, resourceId) => this.slicers[resourceId] || new DayTimeColsSlicer())\n let slicedProps = mapHash(this.slicers, (slicer, resourceId) => slicer.sliceProps(\n splitProps[resourceId],\n dateProfile,\n null,\n context,\n dayRanges,\n ))\n\n return ( // TODO: would move this further down hierarchy, but sliceNowDate needs it\n <NowTimer unit={options.nowIndicator ? 'minute' : 'day'}>\n {(nowDate: DateMarker, todayRange: DateRange) => (\n <TimeCols\n ref={this.timeColsRef}\n {...this.joiner.joinProps(slicedProps, resourceDayTableModel)}\n dateProfile={dateProfile}\n axis={props.axis}\n slotDuration={props.slotDuration}\n slatMetas={props.slatMetas}\n cells={resourceDayTableModel.cells[0]}\n tableColGroupNode={props.tableColGroupNode}\n tableMinWidth={props.tableMinWidth}\n clientWidth={props.clientWidth}\n clientHeight={props.clientHeight}\n expandRows={props.expandRows}\n nowDate={nowDate}\n nowIndicatorSegs={options.nowIndicator && this.buildNowIndicatorSegs(nowDate)}\n todayRange={todayRange}\n onScrollTopRequest={props.onScrollTopRequest}\n forPrint={props.forPrint}\n onSlatCoords={props.onSlatCoords}\n isHitComboAllowed={this.isHitComboAllowed}\n />\n )}\n </NowTimer>\n )\n }\n\n isHitComboAllowed = (hit0: Hit, hit1: Hit) => {\n let allowAcrossResources = this.dayRanges.length === 1\n return allowAcrossResources || hit0.dateSpan.resourceId === hit1.dateSpan.resourceId\n }\n\n buildNowIndicatorSegs(date: DateMarker) {\n let nonResourceSegs = this.slicers[''].sliceNowDate(date, this.context, this.dayRanges)\n return this.joiner.expandSegs(this.props.resourceDayTableModel, nonResourceSegs)\n }\n}\n","import { createElement, DateProfileGenerator, memoize, DateProfile, ChunkContentCallbackArgs, CalendarContext } from '@fullcalendar/common'\nimport { TimeColsView, buildTimeColsModel, buildSlatMetas } from '@fullcalendar/timegrid'\nimport {\n ResourceDayHeader, ResourceDayTableModel, DayResourceTableModel, ResourceViewProps,\n Resource, flattenResources, DEFAULT_RESOURCE_ORDER,\n} from '@fullcalendar/resource-common'\nimport { ResourceDayTable } from '@fullcalendar/resource-daygrid'\nimport { ResourceDayTimeCols } from './ResourceDayTimeCols'\n\nexport class ResourceDayTimeColsView extends TimeColsView {\n props: ResourceViewProps\n\n private flattenResources = memoize(flattenResources)\n private buildResourceTimeColsModel = memoize(buildResourceTimeColsModel)\n private buildSlatMetas = memoize(buildSlatMetas)\n\n render() {\n let { props, context } = this\n let { options, dateEnv } = context\n let { dateProfile } = props\n\n let splitProps = this.allDaySplitter.splitProps(props)\n let resourceOrderSpecs = options.resourceOrder || DEFAULT_RESOURCE_ORDER\n let resources = this.flattenResources(props.resourceStore, resourceOrderSpecs)\n let resourceDayTableModel = this.buildResourceTimeColsModel(\n dateProfile,\n context.dateProfileGenerator,\n resources,\n options.datesAboveResources,\n context,\n )\n\n let slatMetas = this.buildSlatMetas(\n dateProfile.slotMinTime,\n dateProfile.slotMaxTime,\n options.slotLabelInterval,\n options.slotDuration,\n dateEnv,\n )\n let { dayMinWidth } = options\n let hasAttachedAxis = !dayMinWidth\n let hasDetachedAxis = dayMinWidth\n\n let headerContent = options.dayHeaders && (\n <ResourceDayHeader\n resources={resources}\n dates={resourceDayTableModel.dayTableModel.headerDates}\n dateProfile={dateProfile}\n datesRepDistinctDays\n renderIntro={hasAttachedAxis ? this.renderHeadAxis : null}\n />\n )\n\n let allDayContent = (options.allDaySlot !== false) && ((contentArg: ChunkContentCallbackArgs) => (\n <ResourceDayTable\n {...splitProps.allDay}\n dateProfile={dateProfile}\n resourceDayTableModel={resourceDayTableModel}\n nextDayThreshold={options.nextDayThreshold}\n tableMinWidth={contentArg.tableMinWidth}\n colGroupNode={contentArg.tableColGroupNode}\n renderRowIntro={hasAttachedAxis ? this.renderTableRowAxis : null}\n showWeekNumbers={false}\n expandRows={false}\n headerAlignElRef={this.headerElRef}\n clientWidth={contentArg.clientWidth}\n clientHeight={contentArg.clientHeight}\n forPrint={props.forPrint}\n {...this.getAllDayMaxEventProps()}\n />\n ))\n\n let timeGridContent = (contentArg: ChunkContentCallbackArgs) => (\n <ResourceDayTimeCols\n {...splitProps.timed}\n dateProfile={dateProfile}\n axis={hasAttachedAxis}\n slotDuration={options.slotDuration}\n slatMetas={slatMetas}\n resourceDayTableModel={resourceDayTableModel}\n tableColGroupNode={contentArg.tableColGroupNode}\n tableMinWidth={contentArg.tableMinWidth}\n clientWidth={contentArg.clientWidth}\n clientHeight={contentArg.clientHeight}\n onSlatCoords={this.handleSlatCoords}\n expandRows={contentArg.expandRows}\n forPrint={props.forPrint}\n onScrollTopRequest={this.handleScrollTopRequest}\n />\n )\n\n return hasDetachedAxis\n ? this.renderHScrollLayout(\n headerContent,\n allDayContent,\n timeGridContent,\n resourceDayTableModel.colCnt,\n dayMinWidth,\n slatMetas,\n this.state.slatCoords,\n )\n : this.renderSimpleLayout(\n headerContent,\n allDayContent,\n timeGridContent,\n )\n }\n}\n\nfunction buildResourceTimeColsModel(\n dateProfile: DateProfile,\n dateProfileGenerator: DateProfileGenerator,\n resources: Resource[],\n datesAboveResources: boolean,\n context: CalendarContext,\n) {\n let dayTable = buildTimeColsModel(dateProfile, dateProfileGenerator)\n\n return datesAboveResources ?\n new DayResourceTableModel(dayTable, resources, context) :\n new ResourceDayTableModel(dayTable, resources, context)\n}\n","import { createPlugin } from '@fullcalendar/common'\n\nimport premiumCommonPlugin from '@fullcalendar/premium-common' // eslint-disable-line import/no-duplicates\n// ensure ambient declarations\nimport '@fullcalendar/premium-common' // eslint-disable-line import/no-duplicates\n\nimport resourceCommonPlugin from '@fullcalendar/resource-common'\nimport timeGridPlugin from '@fullcalendar/timegrid'\nimport { ResourceDayTimeColsView } from './ResourceDayTimeColsView'\n\nexport { ResourceDayTimeColsView }\nexport { ResourceDayTimeCols } from './ResourceDayTimeCols'\n\nexport default createPlugin({\n deps: [\n premiumCommonPlugin,\n resourceCommonPlugin,\n timeGridPlugin,\n ],\n initialView: 'resourceTimeGridDay',\n views: {\n\n resourceTimeGrid: {\n type: 'timeGrid', // will inherit this configuration\n component: ResourceDayTimeColsView,\n needsResourceData: true,\n },\n\n resourceTimeGridDay: {\n type: 'resourceTimeGrid',\n duration: { days: 1 },\n },\n\n resourceTimeGridWeek: {\n type: 'resourceTimeGrid',\n duration: { weeks: 1 },\n },\n\n },\n})\n"],"names":[],"mappings":";;;;;;;;;;;;AAGA;IAA+C,6CAA4B;IAA3E;;KASC;IARC,gDAAY,GAAZ,UAAa,GAAgB,EAAE,gBAA+C,EAAE,SAAiB;QAC/F,OAAO;kCAEA,GAAG,KACN,GAAG,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;SAEvD,CAAA;KACF;IACH,gCAAC;AAAD,CATA,CAA+C,eAAe;;;IC6BrB,uCAAuC;IAAhF;QAAA,qEA+DC;QA9DS,oBAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;QAExC,cAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAA;QAClC,aAAO,GAAgD,EAAE,CAAA;QACzD,YAAM,GAAG,IAAI,yBAAyB,EAAE,CAAA;QACxC,iBAAW,GAAG,SAAS,EAAY,CAAA;QAgD3C,uBAAiB,GAAG,UAAC,IAAS,EAAE,IAAS;YACvC,IAAI,oBAAoB,GAAG,KAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAA;YACtD,OAAO,oBAAoB,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAA;SACrF,CAAA;;KAMF;IAvDC,oCAAM,GAAN;QAAA,iBA4CC;QA3CK,IAAA,KAAqB,IAAI,EAAvB,KAAK,WAAA,EAAE,OAAO,aAAS,CAAA;QACvB,IAAA,OAAO,GAAc,OAAO,QAArB,EAAE,OAAO,GAAK,OAAO,QAAZ,CAAY;QAC5B,IAAA,WAAW,GAA4B,KAAK,YAAjC,EAAE,qBAA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AE,SAAS,EAAE,OAAO,CAAC;QACvD,IAAI,qBAAqB,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3D;;AC5GA,WAAe,YAAY,CAAC;IAC1B,IAAI,EAAE;QACJ,mBAAmB;QACnB,oBAAoB;QACpB,cAAc;KACf;IACD,WAAW,EAAE,qBAAqB;IAClC,KAAK,EAAE;QAEL,gBAAgB,EAAE;YAChB,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,uBAAuB;YAClC,iBAAiB,EAAE,IAAI;SACxB;QAED,mBAAmB,EAAE;YACnB,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;SACtB;QAED,oBAAoB,EAAE;YACpB,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;SACvB;KAEF;CACF,CAAC;;;;;"}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@fullcalendar/resource-timegrid",
3
+ "version": "5.10.0",
4
+ "title": "FullCalendar Resource Time Grid Plugin",
5
+ "description": "Displays events on a vertical resource view with time slots",
6
+ "docs": "https://fullcalendar.io/docs/vertical-resource-view",
7
+ "dependencies": {
8
+ "@fullcalendar/common": "~5.10.0",
9
+ "@fullcalendar/premium-common": "~5.10.0",
10
+ "@fullcalendar/resource-common": "~5.10.0",
11
+ "@fullcalendar/resource-daygrid": "~5.10.0",
12
+ "@fullcalendar/timegrid": "~5.10.0",
13
+ "tslib": "^2.1.0"
14
+ },
15
+ "main": "main.cjs.js",
16
+ "module": "main.js",
17
+ "types": "main.d.ts",
18
+ "jsdelivr": "main.global.min.js",
19
+ "browserGlobal": "FullCalendarResourceTimeGrid",
20
+ "homepage": "https://fullcalendar.io/scheduler",
21
+ "bugs": "https://fullcalendar.io/reporting-bugs",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/fullcalendar/fullcalendar-scheduler.git",
25
+ "homepage": "https://github.com/fullcalendar/fullcalendar-scheduler"
26
+ },
27
+ "license": "SEE LICENSE IN LICENSE.md",
28
+ "author": {
29
+ "name": "Adam Shaw",
30
+ "email": "arshaw@arshaw.com",
31
+ "url": "http://arshaw.com/"
32
+ },
33
+ "devDependencies": {
34
+ "@fullcalendar/core-preact": "5.10.0"
35
+ }
36
+ }