react-big-schedule 8.1.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1129
- package/dist/calendar/Calendar.d.ts +28 -0
- package/dist/calendar/Calendar.js +95 -0
- package/dist/calendar/Toolbar.d.ts +18 -0
- package/dist/calendar/Toolbar.js +6 -0
- package/dist/calendar/recurrence.check.d.ts +1 -0
- package/dist/calendar/recurrence.check.js +49 -0
- package/dist/calendar/recurrence.d.ts +8 -0
- package/dist/calendar/recurrence.js +90 -0
- package/dist/calendar/timezone.d.ts +6 -0
- package/dist/calendar/timezone.js +14 -0
- package/dist/calendar/types.d.ts +187 -0
- package/dist/calendar/types.js +1 -0
- package/dist/calendar/useEventSources.d.ts +11 -0
- package/dist/calendar/useEventSources.js +89 -0
- package/dist/calendar/useRecurrence.d.ts +4 -0
- package/dist/calendar/useRecurrence.js +15 -0
- package/dist/calendar/utils.d.ts +38 -0
- package/dist/calendar/utils.js +143 -0
- package/dist/calendar/views/DayGridView.d.ts +3 -0
- package/dist/calendar/views/DayGridView.js +375 -0
- package/dist/calendar/views/ListView.d.ts +4 -0
- package/dist/calendar/views/ListView.js +56 -0
- package/dist/calendar/views/MultiMonthView.d.ts +4 -0
- package/dist/calendar/views/MultiMonthView.js +36 -0
- package/dist/calendar/views/TimeGridView.d.ts +3 -0
- package/dist/calendar/views/TimeGridView.js +334 -0
- package/dist/calendar/views/daygrid/DayCell.d.ts +19 -0
- package/dist/calendar/views/daygrid/DayCell.js +17 -0
- package/dist/calendar/views/daygrid/EventChip.d.ts +19 -0
- package/dist/calendar/views/daygrid/EventChip.js +40 -0
- package/dist/calendar/views/daygrid/layout.d.ts +30 -0
- package/dist/calendar/views/daygrid/layout.js +63 -0
- package/dist/calendar/views/list/bucket.d.ts +8 -0
- package/dist/calendar/views/list/bucket.js +37 -0
- package/dist/calendar/views/multimonth/Cell.d.ts +12 -0
- package/dist/calendar/views/multimonth/Cell.js +44 -0
- package/dist/calendar/views/multimonth/Continuous.d.ts +8 -0
- package/dist/calendar/views/multimonth/Continuous.js +28 -0
- package/dist/calendar/views/multimonth/MonthGrid.d.ts +10 -0
- package/dist/calendar/views/multimonth/MonthGrid.js +36 -0
- package/dist/calendar/views/multimonth/shared.d.ts +27 -0
- package/dist/calendar/views/multimonth/shared.js +40 -0
- package/dist/calendar/views/timegrid/DayColumn.d.ts +49 -0
- package/dist/calendar/views/timegrid/DayColumn.js +86 -0
- package/dist/calendar/views/timegrid/model.d.ts +55 -0
- package/dist/calendar/views/timegrid/model.js +102 -0
- package/dist/components/AddMore.d.ts +13 -0
- package/dist/components/AddMore.js +9 -42
- package/dist/components/AddMorePopover.d.ts +13 -0
- package/dist/components/AddMorePopover.js +24 -95
- package/dist/components/AgendaEventItem.d.ts +10 -0
- package/dist/components/AgendaEventItem.js +33 -81
- package/dist/components/AgendaResourceEvents.d.ts +10 -0
- package/dist/components/AgendaResourceEvents.js +37 -91
- package/dist/components/AgendaView.d.ts +9 -0
- package/dist/components/AgendaView.js +10 -69
- package/dist/components/BodyView.d.ts +11 -0
- package/dist/components/BodyView.js +36 -67
- package/dist/components/DnDContext.d.ts +48 -0
- package/dist/components/DnDContext.js +200 -221
- package/dist/components/DnDSource.d.ts +49 -0
- package/dist/components/DnDSource.js +125 -120
- package/dist/components/EventItem.d.ts +41 -0
- package/dist/components/EventItem.js +585 -787
- package/dist/components/EventItemPopover.d.ts +12 -0
- package/dist/components/EventItemPopover.js +19 -143
- package/dist/components/HeaderView.d.ts +14 -0
- package/dist/components/HeaderView.js +123 -186
- package/dist/components/ResourceEvents.d.ts +54 -0
- package/dist/components/ResourceEvents.js +534 -703
- package/dist/components/ResourceView.d.ts +26 -0
- package/dist/components/ResourceView.js +64 -184
- package/dist/components/SchedulerData.d.ts +136 -0
- package/dist/components/SchedulerData.js +1296 -1226
- package/dist/components/SchedulerHeader.d.ts +25 -0
- package/dist/components/SchedulerHeader.js +50 -150
- package/dist/components/SelectedArea.d.ts +8 -0
- package/dist/components/SelectedArea.js +11 -26
- package/dist/components/Summary.d.ts +11 -0
- package/dist/components/Summary.js +21 -50
- package/dist/components/WrapperFun.d.ts +2 -0
- package/dist/components/WrapperFun.js +5 -10
- package/dist/components/index.d.ts +44 -0
- package/dist/components/index.js +428 -654
- package/dist/components/ui/Icons.d.ts +8 -0
- package/dist/components/ui/Icons.js +7 -0
- package/dist/components/ui/MiniCalendar.d.ts +9 -0
- package/dist/components/ui/MiniCalendar.js +17 -0
- package/dist/components/ui/Popover.d.ts +13 -0
- package/dist/components/ui/Popover.js +80 -0
- package/dist/config/default.d.ts +36 -0
- package/dist/config/default.js +17 -26
- package/dist/config/i18n.d.ts +27 -0
- package/dist/config/i18n.js +21 -37
- package/dist/config/scheduler.d.ts +12 -0
- package/dist/config/scheduler.js +126 -119
- package/dist/css/style.css +2 -316
- package/dist/helper/behaviors.d.ts +14 -0
- package/dist/helper/behaviors.js +75 -75
- package/dist/helper/utility.d.ts +26 -0
- package/dist/helper/utility.js +23 -30
- package/dist/index.d.ts +6 -477
- package/dist/index.js +4 -2
- package/dist/sample-data/sample1.d.ts +11 -0
- package/dist/sample-data/sample1.js +427 -372
- package/dist/types.d.ts +267 -0
- package/dist/types.js +1 -0
- package/package.json +30 -27
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import { CellUnit, DATE_FORMAT, DATETIME_FORMAT, SummaryPos, ViewType } from '../config/default';
|
|
4
|
+
import { toDate } from '../helper/behaviors';
|
|
4
5
|
import DemoData from '../sample-data/sample1';
|
|
5
6
|
import AddMorePopover from './AddMorePopover';
|
|
6
7
|
import AgendaView from './AgendaView';
|
|
@@ -13,669 +14,442 @@ import ResourceView from './ResourceView';
|
|
|
13
14
|
import SchedulerData from './SchedulerData';
|
|
14
15
|
import SchedulerHeader from './SchedulerHeader';
|
|
15
16
|
import wrapperFun from './WrapperFun';
|
|
16
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const initDndContext = (schedulerData, dndSources) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
let sources = [];
|
|
19
|
+
sources.push(new DnDSource((dndProps) => dndProps.eventItem, schedulerData.config.dragAndDropEnabled));
|
|
20
|
+
if (dndSources !== undefined && dndSources.length > 0) {
|
|
21
|
+
sources = [...sources, ...dndSources];
|
|
22
|
+
}
|
|
23
|
+
return new DnDContext(sources);
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Render the full scheduler table including the header toolbar, resource column, timeline header, and all resource event rows.
|
|
28
|
-
*
|
|
29
|
-
* @param {object} props - Component properties.
|
|
30
|
-
* @param {SchedulerData} props.schedulerData - View model that supplies configuration, layout, and rendering data for the scheduler.
|
|
31
|
-
* @param {Array<DnDSource>} [props.dndSources] - Additional drag-and-drop sources merged into the scheduler's DnD context on first mount.
|
|
32
|
-
* @param {React.RefObject<HTMLElement>} [props.parentRef] - Parent container ref used when `config.responsiveByParent` is true; a ResizeObserver tracks this element's size.
|
|
33
|
-
* @param {function(SchedulerData):void} props.prevClick - Called when navigating to the previous time range.
|
|
34
|
-
* @param {function(SchedulerData):void} props.nextClick - Called when navigating to the next time range.
|
|
35
|
-
* @param {function(SchedulerData, object):void} props.onViewChange - Called when the view type, agenda toggle, or event perspective changes.
|
|
36
|
-
* @param {function(SchedulerData, string|Date):void} props.onSelectDate - Called when a date is selected from the date picker.
|
|
37
|
-
* @param {function(SchedulerData, HTMLElement, number):void} [props.onScrollLeft] - Called when content reaches the leftmost scroll position.
|
|
38
|
-
* @param {function(SchedulerData, HTMLElement, number):void} [props.onScrollRight] - Called when content reaches the rightmost scroll position.
|
|
39
|
-
* @param {function(SchedulerData, HTMLElement, number):void} [props.onScrollTop] - Called when content reaches the topmost scroll position.
|
|
40
|
-
* @param {function(SchedulerData, HTMLElement, number):void} [props.onScrollBottom] - Called when content reaches the bottommost scroll position.
|
|
41
|
-
* @returns {JSX.Element} The root scheduler table element containing the rendered scheduler UI.
|
|
42
|
-
*/
|
|
43
|
-
|
|
25
|
+
/** Render the full scheduler: header toolbar, resource column, timeline header and all resource event rows. */
|
|
44
26
|
// content-box height: clientHeight includes the padding, which the scheduler cannot use
|
|
45
|
-
const getInnerHeight = el => {
|
|
46
|
-
|
|
47
|
-
paddingTop
|
|
48
|
-
paddingBottom
|
|
49
|
-
} = window.getComputedStyle(el);
|
|
50
|
-
return el.clientHeight - (parseFloat(paddingTop) || 0) - (parseFloat(paddingBottom) || 0);
|
|
27
|
+
const getInnerHeight = (el) => {
|
|
28
|
+
const { paddingTop, paddingBottom } = window.getComputedStyle(el);
|
|
29
|
+
return el.clientHeight - (parseFloat(paddingTop) || 0) - (parseFloat(paddingBottom) || 0);
|
|
51
30
|
};
|
|
52
31
|
function Scheduler(props) {
|
|
53
|
-
|
|
54
|
-
schedulerData,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const schedulerHeadRef = useRef(null);
|
|
99
|
-
const schedulerResourceRef = useRef(null);
|
|
100
|
-
const schedulerContentRef = useRef(null);
|
|
101
|
-
const schedulerContentBgTableRef = useRef(null);
|
|
102
|
-
|
|
103
|
-
// Observer refs
|
|
104
|
-
const ulObserverRef = useRef(null);
|
|
105
|
-
const headerObserverRef = useRef(null);
|
|
106
|
-
|
|
107
|
-
// Scroll position tracking
|
|
108
|
-
const currentAreaRef = useRef(-1);
|
|
109
|
-
const scrollLeftRef = useRef(0);
|
|
110
|
-
const scrollTopRef = useRef(0);
|
|
111
|
-
const scrollbarSizeRef = useRef({
|
|
112
|
-
contentScrollbarHeight: 17,
|
|
113
|
-
contentScrollbarWidth: 17,
|
|
114
|
-
resourceScrollbarHeight: 17,
|
|
115
|
-
resourceScrollbarWidth: 17
|
|
116
|
-
});
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
if (typeof schedulerData.setVersionChangeNotifier === 'function') {
|
|
119
|
-
schedulerData.setVersionChangeNotifier(setRenderTrigger);
|
|
120
|
-
return () => schedulerData.setVersionChangeNotifier(null);
|
|
121
|
-
}
|
|
122
|
-
return undefined;
|
|
123
|
-
}, [schedulerData]);
|
|
124
|
-
|
|
125
|
-
// Width comes from the scheduler's own wrapper (100% wide of its parent). `parentRef` only supplies the height
|
|
126
|
-
// when responsiveByParent is on.
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
const {
|
|
129
|
-
responsiveByParent
|
|
130
|
-
} = schedulerData.config;
|
|
131
|
-
const parentEl = responsiveByParent ? parentRef?.current : null;
|
|
132
|
-
// the wrapper is 100% wide of its parent (padding excluded), so it gives the width in both modes
|
|
133
|
-
const widthEl = containerRef.current;
|
|
134
|
-
if (!widthEl) return undefined;
|
|
135
|
-
const update = () => {
|
|
136
|
-
schedulerData.beginBatch();
|
|
137
|
-
try {
|
|
138
|
-
schedulerData._setDocumentWidth(widthEl.clientWidth);
|
|
139
|
-
if (responsiveByParent) {
|
|
140
|
-
schedulerData._setDocumentHeight(parentEl ? getInnerHeight(parentEl) : document.documentElement.clientHeight);
|
|
32
|
+
const { schedulerData, dndSources, parentRef, className, style, prevClick, nextClick, onViewChange, onSelectDate, leftCustomHeader, rightCustomHeader, CustomResourceHeader, configTableHeaderStyle, onScrollLeft, onScrollRight, onScrollTop, onScrollBottom, } = props;
|
|
33
|
+
const [dndContext] = useState(() => initDndContext(schedulerData, dndSources));
|
|
34
|
+
const [contentScrollbarHeight, setContentScrollbarHeight] = useState(17);
|
|
35
|
+
const [contentScrollbarWidth, setContentScrollbarWidth] = useState(17);
|
|
36
|
+
const [resourceScrollbarHeight, setResourceScrollbarHeight] = useState(17);
|
|
37
|
+
const [resourceScrollbarWidth, setResourceScrollbarWidth] = useState(17);
|
|
38
|
+
const [selectionState, setSelectionState] = useState({
|
|
39
|
+
isSelecting: false,
|
|
40
|
+
selectedResourceIds: [],
|
|
41
|
+
left: 0,
|
|
42
|
+
width: 0,
|
|
43
|
+
});
|
|
44
|
+
const [, setRenderTrigger] = useState(0);
|
|
45
|
+
const schedulerRootRef = useRef(null);
|
|
46
|
+
const containerRef = useRef(null);
|
|
47
|
+
// Layout/header refs - declare before setSchedulerHeaderRef useCallback
|
|
48
|
+
const schedulerHeaderRef = useRef(null);
|
|
49
|
+
// Callback ref pattern for ResizeObserver to handle schedulerHeader element reassignment
|
|
50
|
+
const [schedulerHeaderEl, setSchedulerHeaderEl] = useState(null);
|
|
51
|
+
const setSchedulerHeaderRef = useCallback((el) => {
|
|
52
|
+
schedulerHeaderRef.current = el;
|
|
53
|
+
setSchedulerHeaderEl(el);
|
|
54
|
+
}, []);
|
|
55
|
+
// Scroll sync refs
|
|
56
|
+
const schedulerHeadRef = useRef(null);
|
|
57
|
+
const schedulerResourceRef = useRef(null);
|
|
58
|
+
const schedulerContentRef = useRef(null);
|
|
59
|
+
const schedulerContentBgTableRef = useRef(null);
|
|
60
|
+
// Observer refs
|
|
61
|
+
const ulObserverRef = useRef(null);
|
|
62
|
+
const headerObserverRef = useRef(null);
|
|
63
|
+
// Scroll position tracking
|
|
64
|
+
const currentAreaRef = useRef(-1);
|
|
65
|
+
const scrollLeftRef = useRef(0);
|
|
66
|
+
const scrollTopRef = useRef(0);
|
|
67
|
+
const scrollbarSizeRef = useRef({
|
|
68
|
+
contentScrollbarHeight: 17,
|
|
69
|
+
contentScrollbarWidth: 17,
|
|
70
|
+
resourceScrollbarHeight: 17,
|
|
71
|
+
resourceScrollbarWidth: 17,
|
|
72
|
+
});
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (typeof schedulerData.setVersionChangeNotifier === 'function') {
|
|
75
|
+
schedulerData.setVersionChangeNotifier(setRenderTrigger);
|
|
76
|
+
return () => schedulerData.setVersionChangeNotifier(null);
|
|
141
77
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
78
|
+
return undefined;
|
|
79
|
+
}, [schedulerData]);
|
|
80
|
+
// Width comes from the scheduler's own wrapper (100% wide of its parent). `parentRef` only supplies the height
|
|
81
|
+
// when responsiveByParent is on.
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
const { responsiveByParent } = schedulerData.config;
|
|
84
|
+
const parentEl = responsiveByParent ? parentRef?.current : null;
|
|
85
|
+
// the wrapper is 100% wide of its parent (padding excluded), so it gives the width in both modes
|
|
86
|
+
const widthEl = containerRef.current;
|
|
87
|
+
if (!widthEl)
|
|
88
|
+
return undefined;
|
|
89
|
+
const update = () => {
|
|
90
|
+
schedulerData.beginBatch();
|
|
91
|
+
try {
|
|
92
|
+
schedulerData._setDocumentWidth(widthEl.clientWidth);
|
|
93
|
+
if (responsiveByParent) {
|
|
94
|
+
schedulerData._setDocumentHeight(parentEl ? getInnerHeight(parentEl) : document.documentElement.clientHeight);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
schedulerData.endBatch();
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
update();
|
|
102
|
+
ulObserverRef.current = new ResizeObserver(update);
|
|
103
|
+
ulObserverRef.current.observe(widthEl);
|
|
104
|
+
if (parentEl)
|
|
105
|
+
ulObserverRef.current.observe(parentEl);
|
|
106
|
+
const listenToWindow = responsiveByParent && !parentEl;
|
|
107
|
+
if (listenToWindow)
|
|
108
|
+
window.addEventListener('resize', update);
|
|
109
|
+
return () => {
|
|
110
|
+
ulObserverRef.current?.disconnect();
|
|
111
|
+
if (listenToWindow)
|
|
112
|
+
window.removeEventListener('resize', update);
|
|
113
|
+
};
|
|
114
|
+
}, [parentRef, schedulerData]);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (schedulerData.config.responsiveByParent && schedulerHeaderEl) {
|
|
117
|
+
const updateHeaderHeight = (node) => {
|
|
118
|
+
const rect = node.getBoundingClientRect();
|
|
119
|
+
const style = window.getComputedStyle(node);
|
|
120
|
+
const totalHeight = rect.height +
|
|
121
|
+
(parseFloat(style.marginTop) || 0) +
|
|
122
|
+
(parseFloat(style.marginBottom) || 0) +
|
|
123
|
+
schedulerData.getHeaderGroupRowsHeight();
|
|
124
|
+
schedulerData._setSchedulerHeaderHeight(totalHeight);
|
|
125
|
+
};
|
|
126
|
+
updateHeaderHeight(schedulerHeaderEl);
|
|
127
|
+
headerObserverRef.current = new ResizeObserver(entries => {
|
|
128
|
+
for (const entry of entries) {
|
|
129
|
+
updateHeaderHeight(entry.target);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
headerObserverRef.current.observe(schedulerHeaderEl);
|
|
133
|
+
return () => {
|
|
134
|
+
if (headerObserverRef.current) {
|
|
135
|
+
headerObserverRef.current.disconnect();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
169
138
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
139
|
+
}, [
|
|
140
|
+
schedulerHeaderEl,
|
|
141
|
+
schedulerData,
|
|
142
|
+
schedulerData.config.showWeekNumber,
|
|
143
|
+
schedulerData.config.weekNumberRowHeight,
|
|
144
|
+
schedulerData.config.showMonthRow,
|
|
145
|
+
schedulerData.config.monthRowHeight,
|
|
146
|
+
]);
|
|
147
|
+
const resolveScrollbarSize = useCallback(() => {
|
|
148
|
+
const prev = scrollbarSizeRef.current;
|
|
149
|
+
const newContentHeight = schedulerContentRef.current
|
|
150
|
+
? schedulerContentRef.current.offsetHeight - schedulerContentRef.current.clientHeight
|
|
151
|
+
: 17;
|
|
152
|
+
const newContentWidth = schedulerContentRef.current
|
|
153
|
+
? schedulerContentRef.current.offsetWidth - schedulerContentRef.current.clientWidth
|
|
154
|
+
: 17;
|
|
155
|
+
const newResourceHeight = schedulerResourceRef.current
|
|
156
|
+
? schedulerResourceRef.current.offsetHeight - schedulerResourceRef.current.clientHeight
|
|
157
|
+
: 17;
|
|
158
|
+
const newResourceWidth = schedulerResourceRef.current
|
|
159
|
+
? schedulerResourceRef.current.offsetWidth - schedulerResourceRef.current.clientWidth
|
|
160
|
+
: 17;
|
|
161
|
+
if (newContentHeight !== prev.contentScrollbarHeight) {
|
|
162
|
+
setContentScrollbarHeight(newContentHeight);
|
|
163
|
+
scrollbarSizeRef.current.contentScrollbarHeight = newContentHeight;
|
|
175
164
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const resolveScrollbarSize = useCallback(() => {
|
|
180
|
-
const prev = scrollbarSizeRef.current;
|
|
181
|
-
const newContentHeight = schedulerContentRef.current ? schedulerContentRef.current.offsetHeight - schedulerContentRef.current.clientHeight : 17;
|
|
182
|
-
const newContentWidth = schedulerContentRef.current ? schedulerContentRef.current.offsetWidth - schedulerContentRef.current.clientWidth : 17;
|
|
183
|
-
const newResourceHeight = schedulerResourceRef.current ? schedulerResourceRef.current.offsetHeight - schedulerResourceRef.current.clientHeight : 17;
|
|
184
|
-
const newResourceWidth = schedulerResourceRef.current ? schedulerResourceRef.current.offsetWidth - schedulerResourceRef.current.clientWidth : 17;
|
|
185
|
-
if (newContentHeight !== prev.contentScrollbarHeight) {
|
|
186
|
-
setContentScrollbarHeight(newContentHeight);
|
|
187
|
-
scrollbarSizeRef.current.contentScrollbarHeight = newContentHeight;
|
|
188
|
-
}
|
|
189
|
-
if (newContentWidth !== prev.contentScrollbarWidth) {
|
|
190
|
-
setContentScrollbarWidth(newContentWidth);
|
|
191
|
-
scrollbarSizeRef.current.contentScrollbarWidth = newContentWidth;
|
|
192
|
-
}
|
|
193
|
-
if (newResourceHeight !== prev.resourceScrollbarHeight) {
|
|
194
|
-
setResourceScrollbarHeight(newResourceHeight);
|
|
195
|
-
scrollbarSizeRef.current.resourceScrollbarHeight = newResourceHeight;
|
|
196
|
-
}
|
|
197
|
-
if (newResourceWidth !== prev.resourceScrollbarWidth) {
|
|
198
|
-
setResourceScrollbarWidth(newResourceWidth);
|
|
199
|
-
scrollbarSizeRef.current.resourceScrollbarWidth = newResourceWidth;
|
|
200
|
-
}
|
|
201
|
-
}, []);
|
|
202
|
-
useEffect(() => {
|
|
203
|
-
resolveScrollbarSize();
|
|
204
|
-
const {
|
|
205
|
-
localeDayjs,
|
|
206
|
-
behaviors
|
|
207
|
-
} = schedulerData;
|
|
208
|
-
if (schedulerData.getScrollToSpecialDayjs() && behaviors.getScrollSpecialDayjsFunc) {
|
|
209
|
-
if (schedulerContentRef.current && schedulerContentRef.current.scrollWidth > schedulerContentRef.current.clientWidth) {
|
|
210
|
-
const start = localeDayjs(new Date(schedulerData.startDate)).startOf('day');
|
|
211
|
-
const end = localeDayjs(new Date(schedulerData.endDate)).endOf('day');
|
|
212
|
-
const specialDayjs = behaviors.getScrollSpecialDayjsFunc(schedulerData, start, end);
|
|
213
|
-
if (specialDayjs >= start && specialDayjs <= end) {
|
|
214
|
-
let index = 0;
|
|
215
|
-
schedulerData.headers.forEach(item => {
|
|
216
|
-
if (specialDayjs >= localeDayjs(new Date(item.time))) index += 1;
|
|
217
|
-
});
|
|
218
|
-
schedulerContentRef.current.scrollLeft = (index - 1) * schedulerData.getContentCellWidth();
|
|
219
|
-
schedulerData.setScrollToSpecialDayjs(false);
|
|
165
|
+
if (newContentWidth !== prev.contentScrollbarWidth) {
|
|
166
|
+
setContentScrollbarWidth(newContentWidth);
|
|
167
|
+
scrollbarSizeRef.current.contentScrollbarWidth = newContentWidth;
|
|
220
168
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
const onSchedulerHeadMouseOver = useCallback(() => {
|
|
225
|
-
currentAreaRef.current = 2;
|
|
226
|
-
}, []);
|
|
227
|
-
const onSchedulerHeadMouseOut = useCallback(() => {
|
|
228
|
-
currentAreaRef.current = -1;
|
|
229
|
-
}, []);
|
|
230
|
-
const onSchedulerHeadScroll = useCallback(() => {
|
|
231
|
-
if ((currentAreaRef.current === 2 || currentAreaRef.current === -1) && schedulerContentRef.current.scrollLeft !== schedulerHeadRef.current.scrollLeft) {
|
|
232
|
-
schedulerContentRef.current.scrollLeft = schedulerHeadRef.current.scrollLeft;
|
|
233
|
-
}
|
|
234
|
-
}, []);
|
|
235
|
-
const onSchedulerResourceMouseOver = useCallback(() => {
|
|
236
|
-
currentAreaRef.current = 1;
|
|
237
|
-
}, []);
|
|
238
|
-
const onSchedulerResourceMouseOut = useCallback(() => {
|
|
239
|
-
currentAreaRef.current = -1;
|
|
240
|
-
}, []);
|
|
241
|
-
const onSchedulerResourceScroll = useCallback(() => {
|
|
242
|
-
if (schedulerResourceRef.current && (currentAreaRef.current === 1 || currentAreaRef.current === -1) && schedulerContentRef.current.scrollTop !== schedulerResourceRef.current.scrollTop) {
|
|
243
|
-
schedulerContentRef.current.scrollTop = schedulerResourceRef.current.scrollTop;
|
|
244
|
-
}
|
|
245
|
-
}, []);
|
|
246
|
-
const onSchedulerContentMouseOver = useCallback(() => {
|
|
247
|
-
currentAreaRef.current = 0;
|
|
248
|
-
}, []);
|
|
249
|
-
const onSchedulerContentMouseOut = useCallback(() => {
|
|
250
|
-
currentAreaRef.current = -1;
|
|
251
|
-
}, []);
|
|
252
|
-
const onSchedulerContentScroll = useCallback(() => {
|
|
253
|
-
if (schedulerResourceRef.current) {
|
|
254
|
-
if (currentAreaRef.current === 0 || currentAreaRef.current === -1) {
|
|
255
|
-
if (schedulerHeadRef.current.scrollLeft !== schedulerContentRef.current.scrollLeft) {
|
|
256
|
-
schedulerHeadRef.current.scrollLeft = schedulerContentRef.current.scrollLeft;
|
|
169
|
+
if (newResourceHeight !== prev.resourceScrollbarHeight) {
|
|
170
|
+
setResourceScrollbarHeight(newResourceHeight);
|
|
171
|
+
scrollbarSizeRef.current.resourceScrollbarHeight = newResourceHeight;
|
|
257
172
|
}
|
|
258
|
-
if (
|
|
259
|
-
|
|
173
|
+
if (newResourceWidth !== prev.resourceScrollbarWidth) {
|
|
174
|
+
setResourceScrollbarWidth(newResourceWidth);
|
|
175
|
+
scrollbarSizeRef.current.resourceScrollbarWidth = newResourceWidth;
|
|
260
176
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
177
|
+
}, []);
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
resolveScrollbarSize();
|
|
180
|
+
const { localeDayjs, behaviors } = schedulerData;
|
|
181
|
+
if (schedulerData.getScrollToSpecialDayjs() && behaviors.getScrollSpecialDayjsFunc) {
|
|
182
|
+
if (schedulerContentRef.current &&
|
|
183
|
+
schedulerContentRef.current.scrollWidth > schedulerContentRef.current.clientWidth) {
|
|
184
|
+
const start = localeDayjs(toDate(schedulerData.startDate)).startOf('day');
|
|
185
|
+
const end = localeDayjs(toDate(schedulerData.endDate)).endOf('day');
|
|
186
|
+
const specialDayjs = behaviors.getScrollSpecialDayjsFunc(schedulerData, start, end);
|
|
187
|
+
if (specialDayjs >= start && specialDayjs <= end) {
|
|
188
|
+
let index = 0;
|
|
189
|
+
schedulerData.headers.forEach(item => {
|
|
190
|
+
if (specialDayjs >= localeDayjs(new Date(item.time)))
|
|
191
|
+
index += 1;
|
|
192
|
+
});
|
|
193
|
+
schedulerContentRef.current.scrollLeft = (index - 1) * schedulerData.getContentCellWidth();
|
|
194
|
+
schedulerData.setScrollToSpecialDayjs(false);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}, [schedulerData, resolveScrollbarSize]);
|
|
199
|
+
const onSchedulerHeadMouseOver = useCallback(() => {
|
|
200
|
+
currentAreaRef.current = 2;
|
|
201
|
+
}, []);
|
|
202
|
+
const onSchedulerHeadMouseOut = useCallback(() => {
|
|
203
|
+
currentAreaRef.current = -1;
|
|
204
|
+
}, []);
|
|
205
|
+
const onSchedulerHeadScroll = useCallback(() => {
|
|
206
|
+
const content = schedulerContentRef.current;
|
|
207
|
+
const head = schedulerHeadRef.current;
|
|
208
|
+
if (content &&
|
|
209
|
+
head &&
|
|
210
|
+
(currentAreaRef.current === 2 || currentAreaRef.current === -1) &&
|
|
211
|
+
content.scrollLeft !== head.scrollLeft) {
|
|
212
|
+
content.scrollLeft = head.scrollLeft;
|
|
213
|
+
}
|
|
214
|
+
}, []);
|
|
215
|
+
const onSchedulerResourceMouseOver = useCallback(() => {
|
|
216
|
+
currentAreaRef.current = 1;
|
|
217
|
+
}, []);
|
|
218
|
+
const onSchedulerResourceMouseOut = useCallback(() => {
|
|
219
|
+
currentAreaRef.current = -1;
|
|
220
|
+
}, []);
|
|
221
|
+
const onSchedulerResourceScroll = useCallback(() => {
|
|
222
|
+
const content = schedulerContentRef.current;
|
|
223
|
+
const resource = schedulerResourceRef.current;
|
|
224
|
+
if (content &&
|
|
225
|
+
resource &&
|
|
226
|
+
(currentAreaRef.current === 1 || currentAreaRef.current === -1) &&
|
|
227
|
+
content.scrollTop !== resource.scrollTop) {
|
|
228
|
+
content.scrollTop = resource.scrollTop;
|
|
229
|
+
}
|
|
230
|
+
}, []);
|
|
231
|
+
const onSchedulerContentMouseOver = useCallback(() => {
|
|
232
|
+
currentAreaRef.current = 0;
|
|
233
|
+
}, []);
|
|
234
|
+
const onSchedulerContentMouseOut = useCallback(() => {
|
|
235
|
+
currentAreaRef.current = -1;
|
|
236
|
+
}, []);
|
|
237
|
+
const onSchedulerContentScroll = useCallback(() => {
|
|
238
|
+
const content = schedulerContentRef.current;
|
|
239
|
+
const head = schedulerHeadRef.current;
|
|
240
|
+
if (!content || !head)
|
|
241
|
+
return;
|
|
242
|
+
if (schedulerResourceRef.current) {
|
|
243
|
+
if (currentAreaRef.current === 0 || currentAreaRef.current === -1) {
|
|
244
|
+
if (head.scrollLeft !== content.scrollLeft) {
|
|
245
|
+
head.scrollLeft = content.scrollLeft;
|
|
246
|
+
}
|
|
247
|
+
if (schedulerResourceRef.current.scrollTop !== content.scrollTop) {
|
|
248
|
+
schedulerResourceRef.current.scrollTop = content.scrollTop;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (content.scrollLeft !== scrollLeftRef.current) {
|
|
253
|
+
if (content.scrollLeft === 0 && onScrollLeft !== undefined) {
|
|
254
|
+
onScrollLeft(schedulerData, content, content.scrollWidth - content.clientWidth);
|
|
255
|
+
}
|
|
256
|
+
if (Math.round(content.scrollLeft) === content.scrollWidth - content.clientWidth && onScrollRight !== undefined) {
|
|
257
|
+
onScrollRight(schedulerData, content, content.scrollWidth - content.clientWidth);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
else if (content.scrollTop !== scrollTopRef.current) {
|
|
261
|
+
if (content.scrollTop === 0 && onScrollTop !== undefined) {
|
|
262
|
+
onScrollTop(schedulerData, content, content.scrollHeight - content.clientHeight);
|
|
263
|
+
}
|
|
264
|
+
if (Math.round(content.scrollTop) === content.scrollHeight - content.clientHeight &&
|
|
265
|
+
onScrollBottom !== undefined) {
|
|
266
|
+
onScrollBottom(schedulerData, content, content.scrollHeight - content.clientHeight);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
scrollLeftRef.current = content.scrollLeft;
|
|
270
|
+
scrollTopRef.current = content.scrollTop;
|
|
271
|
+
}, [schedulerData, onScrollLeft, onScrollRight, onScrollTop, onScrollBottom]);
|
|
272
|
+
const handleViewChange = useCallback((e) => {
|
|
273
|
+
const viewType = parseInt(e.target.value.charAt(0), 10);
|
|
274
|
+
const showAgenda = e.target.value.charAt(1) === '1';
|
|
275
|
+
const isEventPerspective = e.target.value.charAt(2) === '1';
|
|
276
|
+
onViewChange(schedulerData, { viewType, showAgenda, isEventPerspective });
|
|
277
|
+
}, [onViewChange, schedulerData]);
|
|
278
|
+
const goNext = useCallback(() => nextClick(schedulerData), [nextClick, schedulerData]);
|
|
279
|
+
const goBack = useCallback(() => prevClick(schedulerData), [prevClick, schedulerData]);
|
|
280
|
+
const onSelect = useCallback((date) => onSelectDate(schedulerData, date), [onSelectDate, schedulerData]);
|
|
281
|
+
const { viewType, renderData, showAgenda, config } = schedulerData;
|
|
282
|
+
const width = schedulerData.getSchedulerWidth();
|
|
283
|
+
const { showWeekNumber, weekNumberRowHeight, showMonthRow, monthRowHeight } = config;
|
|
284
|
+
const schedulerDataVersion = schedulerData.getVersion ? schedulerData.getVersion() : 0;
|
|
285
|
+
const schedulerWidth = schedulerData.getContentTableWidth();
|
|
286
|
+
const weekNumberRowStyle = useMemo(() => ({ height: weekNumberRowHeight }), [weekNumberRowHeight]);
|
|
287
|
+
const weekNumberThStyle = useMemo(() => ({
|
|
288
|
+
borderBottom: `1px solid ${config.headerBorderColor ?? 'var(--rbs-border)'}`,
|
|
289
|
+
fontSize: '0.85em',
|
|
290
|
+
opacity: 0.7,
|
|
291
|
+
padding: '4px 8px',
|
|
292
|
+
}), [config.headerBorderColor]);
|
|
293
|
+
const schedulerInnerStyle = useMemo(() => ({ width: schedulerWidth }), [schedulerWidth]);
|
|
294
|
+
const displayRenderData = useMemo(() => renderData.filter(o => o.render), [renderData]);
|
|
295
|
+
const eventDndSource = dndContext.getDndSource();
|
|
296
|
+
if (!eventDndSource)
|
|
297
|
+
throw new Error('react-big-schedule: no DnD source registered for events');
|
|
298
|
+
const handleSelectionChange = useCallback((isSelecting, selectedResourceIds, preview = {}) => {
|
|
299
|
+
const nextSelectedResourceIds = selectedResourceIds || [];
|
|
300
|
+
const nextLeft = preview.left || 0;
|
|
301
|
+
const nextWidth = preview.width || 0;
|
|
302
|
+
setSelectionState(prev => {
|
|
303
|
+
const sameIdsLength = prev.selectedResourceIds.length === nextSelectedResourceIds.length;
|
|
304
|
+
const sameIds = sameIdsLength && prev.selectedResourceIds.every((id, index) => id === nextSelectedResourceIds[index]);
|
|
305
|
+
if (prev.isSelecting === isSelecting && prev.left === nextLeft && prev.width === nextWidth && sameIds) {
|
|
306
|
+
return prev;
|
|
307
|
+
}
|
|
308
|
+
return {
|
|
309
|
+
isSelecting,
|
|
310
|
+
selectedResourceIds: nextSelectedResourceIds,
|
|
311
|
+
left: nextLeft,
|
|
312
|
+
width: nextWidth,
|
|
313
|
+
};
|
|
314
|
+
});
|
|
315
|
+
}, []);
|
|
316
|
+
const selectionPreview = useMemo(() => ({
|
|
317
|
+
isSelecting: selectionState.isSelecting,
|
|
318
|
+
left: selectionState.left,
|
|
319
|
+
width: selectionState.width,
|
|
320
|
+
}), [selectionState.isSelecting, selectionState.left, selectionState.width]);
|
|
321
|
+
const selectedIdsSet = useMemo(() => new Set(selectionState.selectedResourceIds), [selectionState.selectedResourceIds]);
|
|
322
|
+
const resourceEventsList = useMemo(() => displayRenderData.map(item => (_jsx(ResourceEvents, { resourceEvents: item, schedulerData: schedulerData, schedulerDataVersion: schedulerDataVersion, dndSource: eventDndSource, dndContext: dndContext, onSetAddMoreState: props.onSetAddMoreState, updateEventStart: props.updateEventStart, updateEventEnd: props.updateEventEnd, moveEvent: props.moveEvent, movingEvent: props.movingEvent, conflictOccurred: props.conflictOccurred, subtitleGetter: props.subtitleGetter, eventItemClick: props.eventItemClick, viewEventClick: props.viewEventClick, viewEventText: props.viewEventText, viewEvent2Click: props.viewEvent2Click, viewEvent2Text: props.viewEvent2Text, newEvent: props.newEvent, eventItemTemplateResolver: props.eventItemTemplateResolver, eventItemPopoverTemplateResolver: props.eventItemPopoverTemplateResolver, onSelectionChange: handleSelectionChange, isRowSelected: selectedIdsSet.has(item.slotId), selectionPreview: selectionPreview }, item.slotId))), [
|
|
323
|
+
displayRenderData,
|
|
324
|
+
schedulerData,
|
|
325
|
+
schedulerDataVersion,
|
|
326
|
+
eventDndSource,
|
|
327
|
+
dndContext,
|
|
328
|
+
props.onSetAddMoreState,
|
|
329
|
+
props.updateEventStart,
|
|
330
|
+
props.updateEventEnd,
|
|
331
|
+
props.moveEvent,
|
|
332
|
+
props.movingEvent,
|
|
333
|
+
props.conflictOccurred,
|
|
334
|
+
props.subtitleGetter,
|
|
335
|
+
props.eventItemClick,
|
|
336
|
+
props.viewEventClick,
|
|
337
|
+
props.viewEventText,
|
|
338
|
+
props.viewEvent2Click,
|
|
339
|
+
props.viewEvent2Text,
|
|
340
|
+
props.newEvent,
|
|
341
|
+
props.eventItemTemplateResolver,
|
|
342
|
+
props.eventItemPopoverTemplateResolver,
|
|
343
|
+
handleSelectionChange,
|
|
344
|
+
selectedIdsSet,
|
|
345
|
+
selectionPreview,
|
|
346
|
+
]);
|
|
347
|
+
let tbodyContent = _jsx("tr", {});
|
|
348
|
+
if (showAgenda) {
|
|
349
|
+
tbodyContent = (_jsx(AgendaView, { schedulerData: schedulerData, subtitleGetter: props.subtitleGetter, eventItemClick: props.eventItemClick, viewEventClick: props.viewEventClick, viewEventText: props.viewEventText, viewEvent2Click: props.viewEvent2Click, viewEvent2Text: props.viewEvent2Text, slotClickedFunc: props.slotClickedFunc, slotItemTemplateResolver: props.slotItemTemplateResolver, eventItemTemplateResolver: props.eventItemTemplateResolver, eventItemPopoverTemplateResolver: props.eventItemPopoverTemplateResolver }));
|
|
277
350
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
eventItemClick: props.eventItemClick,
|
|
362
|
-
viewEventClick: props.viewEventClick,
|
|
363
|
-
viewEventText: props.viewEventText,
|
|
364
|
-
viewEvent2Click: props.viewEvent2Click,
|
|
365
|
-
viewEvent2Text: props.viewEvent2Text,
|
|
366
|
-
newEvent: props.newEvent,
|
|
367
|
-
eventItemTemplateResolver: props.eventItemTemplateResolver,
|
|
368
|
-
eventItemPopoverTemplateResolver: props.eventItemPopoverTemplateResolver,
|
|
369
|
-
onSelectionChange: handleSelectionChange,
|
|
370
|
-
isRowSelected: selectedIdsSet.has(item.slotId),
|
|
371
|
-
selectionPreview: selectionPreview
|
|
372
|
-
}, item.slotId)), [displayRenderData, schedulerData, schedulerDataVersion, eventDndSource, dndContext, props.onSetAddMoreState, props.updateEventStart, props.updateEventEnd, props.moveEvent, props.movingEvent, props.conflictOccurred, props.subtitleGetter, props.eventItemClick, props.viewEventClick, props.viewEventText, props.viewEvent2Click, props.viewEvent2Text, props.newEvent, props.eventItemTemplateResolver, props.eventItemPopoverTemplateResolver, handleSelectionChange, selectedIdsSet, selectionPreview]);
|
|
373
|
-
let tbodyContent = /*#__PURE__*/_jsx("tr", {});
|
|
374
|
-
if (showAgenda) {
|
|
375
|
-
tbodyContent = /*#__PURE__*/_jsx(AgendaView, {
|
|
376
|
-
schedulerData: schedulerData,
|
|
377
|
-
subtitleGetter: props.subtitleGetter,
|
|
378
|
-
eventItemClick: props.eventItemClick,
|
|
379
|
-
viewEventClick: props.viewEventClick,
|
|
380
|
-
viewEventText: props.viewEventText,
|
|
381
|
-
viewEvent2Click: props.viewEvent2Click,
|
|
382
|
-
viewEvent2Text: props.viewEvent2Text,
|
|
383
|
-
slotClickedFunc: props.slotClickedFunc,
|
|
384
|
-
slotItemTemplateResolver: props.slotItemTemplateResolver,
|
|
385
|
-
eventItemTemplateResolver: props.eventItemTemplateResolver,
|
|
386
|
-
eventItemPopoverTemplateResolver: props.eventItemPopoverTemplateResolver
|
|
387
|
-
});
|
|
388
|
-
} else {
|
|
389
|
-
const resourceTableWidth = schedulerData.getResourceTableWidth();
|
|
390
|
-
const schedulerContainerWidth = width - (config.resourceViewEnabled ? resourceTableWidth : 0);
|
|
391
|
-
const configuredContentHeight = config.schedulerContentHeight;
|
|
392
|
-
const contentHeight = !config.responsiveByParent && configuredContentHeight === '100%' ? schedulerData.getSchedulerContentDesiredHeight() : configuredContentHeight;
|
|
393
|
-
const resourcePaddingBottom = resourceScrollbarHeight === 0 ? contentScrollbarHeight : 0;
|
|
394
|
-
const contentPaddingBottom = contentScrollbarHeight === 0 ? resourceScrollbarHeight : 0;
|
|
395
|
-
let schedulerContentStyle = {
|
|
396
|
-
overflowX: viewType === ViewType.Week ? 'hidden' : 'auto',
|
|
397
|
-
overflowY: 'auto',
|
|
398
|
-
margin: '0px',
|
|
399
|
-
position: 'relative',
|
|
400
|
-
height: contentHeight,
|
|
401
|
-
paddingBottom: contentPaddingBottom
|
|
402
|
-
};
|
|
403
|
-
let resourceContentStyle = {
|
|
404
|
-
height: contentHeight,
|
|
405
|
-
overflowX: 'auto',
|
|
406
|
-
overflowY: 'auto',
|
|
407
|
-
width: resourceTableWidth + resourceScrollbarWidth,
|
|
408
|
-
margin: `0px -${contentScrollbarWidth}px 0px 0px`
|
|
409
|
-
};
|
|
410
|
-
if (config.schedulerMaxHeight > 0) {
|
|
411
|
-
const totalHeaderHeight = config.tableHeaderHeight + schedulerData.getHeaderGroupRowsHeight();
|
|
412
|
-
schedulerContentStyle = {
|
|
413
|
-
...schedulerContentStyle,
|
|
414
|
-
maxHeight: config.schedulerMaxHeight - totalHeaderHeight
|
|
415
|
-
};
|
|
416
|
-
resourceContentStyle = {
|
|
417
|
-
...resourceContentStyle,
|
|
418
|
-
maxHeight: config.schedulerMaxHeight - totalHeaderHeight
|
|
419
|
-
};
|
|
420
|
-
} else if (config.responsiveByParent && schedulerData.documentHeight > 0) {
|
|
421
|
-
const availableHeight = schedulerData.getSchedulerHeight();
|
|
422
|
-
schedulerContentStyle = {
|
|
423
|
-
...schedulerContentStyle,
|
|
424
|
-
height: availableHeight
|
|
425
|
-
};
|
|
426
|
-
resourceContentStyle = {
|
|
427
|
-
...resourceContentStyle,
|
|
428
|
-
height: availableHeight
|
|
429
|
-
};
|
|
351
|
+
else {
|
|
352
|
+
const resourceTableWidth = schedulerData.getResourceTableWidth();
|
|
353
|
+
const schedulerContainerWidth = width - (config.resourceViewEnabled ? resourceTableWidth : 0);
|
|
354
|
+
const configuredContentHeight = config.schedulerContentHeight;
|
|
355
|
+
const contentHeight = !config.responsiveByParent && configuredContentHeight === '100%'
|
|
356
|
+
? schedulerData.getSchedulerContentDesiredHeight()
|
|
357
|
+
: configuredContentHeight;
|
|
358
|
+
const resourcePaddingBottom = resourceScrollbarHeight === 0 ? contentScrollbarHeight : 0;
|
|
359
|
+
const contentPaddingBottom = contentScrollbarHeight === 0 ? resourceScrollbarHeight : 0;
|
|
360
|
+
let schedulerContentStyle = {
|
|
361
|
+
overflowX: viewType === ViewType.Week ? 'hidden' : 'auto',
|
|
362
|
+
overflowY: 'auto',
|
|
363
|
+
margin: '0px',
|
|
364
|
+
position: 'relative',
|
|
365
|
+
height: contentHeight,
|
|
366
|
+
paddingBottom: contentPaddingBottom,
|
|
367
|
+
};
|
|
368
|
+
let resourceContentStyle = {
|
|
369
|
+
height: contentHeight,
|
|
370
|
+
overflowX: 'auto',
|
|
371
|
+
overflowY: 'auto',
|
|
372
|
+
width: resourceTableWidth + resourceScrollbarWidth,
|
|
373
|
+
margin: `0px -${contentScrollbarWidth}px 0px 0px`,
|
|
374
|
+
};
|
|
375
|
+
if (config.schedulerMaxHeight > 0) {
|
|
376
|
+
const totalHeaderHeight = config.tableHeaderHeight + schedulerData.getHeaderGroupRowsHeight();
|
|
377
|
+
schedulerContentStyle = {
|
|
378
|
+
...schedulerContentStyle,
|
|
379
|
+
maxHeight: config.schedulerMaxHeight - totalHeaderHeight,
|
|
380
|
+
};
|
|
381
|
+
resourceContentStyle = {
|
|
382
|
+
...resourceContentStyle,
|
|
383
|
+
maxHeight: config.schedulerMaxHeight - totalHeaderHeight,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
else if (config.responsiveByParent && schedulerData.documentHeight > 0) {
|
|
387
|
+
const availableHeight = schedulerData.getSchedulerHeight();
|
|
388
|
+
schedulerContentStyle = {
|
|
389
|
+
...schedulerContentStyle,
|
|
390
|
+
height: availableHeight,
|
|
391
|
+
};
|
|
392
|
+
resourceContentStyle = {
|
|
393
|
+
...resourceContentStyle,
|
|
394
|
+
height: availableHeight,
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
const resourceName = schedulerData.isEventPerspective ? config.taskName : config.resourceName;
|
|
398
|
+
const resourceColumnStyle = {
|
|
399
|
+
display: config.resourceViewEnabled ? undefined : 'none',
|
|
400
|
+
width: resourceTableWidth,
|
|
401
|
+
verticalAlign: 'top',
|
|
402
|
+
};
|
|
403
|
+
const resourceHeaderStyle = {
|
|
404
|
+
borderBottom: `1px solid ${config.headerBorderColor ?? 'var(--rbs-border)'}`,
|
|
405
|
+
height: config.tableHeaderHeight + schedulerData.getHeaderGroupRowsHeight(),
|
|
406
|
+
...configTableHeaderStyle,
|
|
407
|
+
};
|
|
408
|
+
const resourceHeaderScrollStyle = {
|
|
409
|
+
overflowX: 'scroll',
|
|
410
|
+
overflowY: 'hidden',
|
|
411
|
+
margin: `0px 0px -${contentScrollbarHeight}px`,
|
|
412
|
+
};
|
|
413
|
+
const schedulerViewStyle = {
|
|
414
|
+
width: schedulerContainerWidth,
|
|
415
|
+
};
|
|
416
|
+
const schedulerViewColumnStyle = {
|
|
417
|
+
verticalAlign: 'top',
|
|
418
|
+
};
|
|
419
|
+
const schedulerHeadWrapperStyle = {
|
|
420
|
+
overflow: 'hidden',
|
|
421
|
+
borderBottom: `1px solid ${config.headerBorderColor ?? 'var(--rbs-border)'}`,
|
|
422
|
+
height: config.tableHeaderHeight + schedulerData.getHeaderGroupRowsHeight(),
|
|
423
|
+
};
|
|
424
|
+
const schedulerHeadScrollStyle = {
|
|
425
|
+
overflowX: 'scroll',
|
|
426
|
+
overflowY: 'hidden',
|
|
427
|
+
margin: `0px 0px -${contentScrollbarHeight}px`,
|
|
428
|
+
};
|
|
429
|
+
const schedulerHeadInnerStyle = {
|
|
430
|
+
paddingRight: `${contentScrollbarWidth}px`,
|
|
431
|
+
width: schedulerWidth + contentScrollbarWidth,
|
|
432
|
+
};
|
|
433
|
+
tbodyContent = (_jsxs("tr", { children: [_jsx("td", { style: resourceColumnStyle, children: _jsxs("div", { className: "resource-view", children: [_jsx("div", { style: resourceHeaderStyle, children: _jsx("div", { style: resourceHeaderScrollStyle, children: _jsx("table", { className: "resource-table", children: _jsxs("thead", { children: [showMonthRow && (_jsx("tr", { style: { height: monthRowHeight }, children: _jsx("th", { style: weekNumberThStyle }) })), showWeekNumber && (_jsx("tr", { style: weekNumberRowStyle, children: _jsx("th", { style: weekNumberThStyle, children: config.weekNumberLabel ?? 'Week No.' }) })), _jsx("tr", { style: { height: config.tableHeaderHeight }, children: _jsx("th", { className: "header3-text", children: CustomResourceHeader ? _jsx(CustomResourceHeader, {}) : resourceName }) })] }) }) }) }), _jsx("section", { style: resourceContentStyle, ref: schedulerResourceRef, onMouseOver: onSchedulerResourceMouseOver, onFocus: onSchedulerResourceMouseOver, onMouseOut: onSchedulerResourceMouseOut, onBlur: onSchedulerResourceMouseOut, onScroll: onSchedulerResourceScroll, "aria-label": "Resource sidebar", children: _jsx(ResourceView, { schedulerData: schedulerData, schedulerDataVersion: schedulerDataVersion, contentScrollbarHeight: resourcePaddingBottom, slotClickedFunc: props.slotClickedFunc, slotItemTemplateResolver: props.slotItemTemplateResolver, toggleExpandFunc: props.toggleExpandFunc, CustomResourceCell: props.CustomResourceCell, isSelecting: selectionState.isSelecting, selectedResourceIds: selectionState.selectedResourceIds }) })] }) }), _jsx("td", { style: schedulerViewColumnStyle, children: _jsxs("div", { className: "scheduler-view", style: schedulerViewStyle, children: [_jsx("div", { style: schedulerHeadWrapperStyle, children: _jsx("section", { style: schedulerHeadScrollStyle, ref: schedulerHeadRef, onMouseOver: onSchedulerHeadMouseOver, onFocus: onSchedulerHeadMouseOver, onMouseOut: onSchedulerHeadMouseOut, onBlur: onSchedulerHeadMouseOut, onScroll: onSchedulerHeadScroll, "aria-label": "Scheduler Header", children: _jsx("div", { style: schedulerHeadInnerStyle, children: _jsx("table", { className: "scheduler-bg-table", style: schedulerInnerStyle, children: _jsx(HeaderView, { schedulerData: schedulerData, schedulerDataVersion: schedulerDataVersion, nonAgendaCellHeaderTemplateResolver: props.nonAgendaCellHeaderTemplateResolver }) }) }) }) }), _jsx("section", { style: schedulerContentStyle, ref: schedulerContentRef, onMouseOver: onSchedulerContentMouseOver, onFocus: onSchedulerContentMouseOver, onMouseOut: onSchedulerContentMouseOut, onBlur: onSchedulerContentMouseOut, onScroll: onSchedulerContentScroll, "aria-label": "Scheduler content", children: _jsxs("div", { style: schedulerInnerStyle, children: [_jsx("div", { className: "scheduler-content", children: _jsx("table", { className: "scheduler-content-table", children: _jsx("tbody", { children: resourceEventsList }) }) }), _jsx("div", { className: "scheduler-bg", children: _jsx("table", { className: "scheduler-bg-table", style: schedulerInnerStyle, ref: schedulerContentBgTableRef, children: _jsx(BodyView, { schedulerData: schedulerData, schedulerDataVersion: schedulerDataVersion }) }) })] }) })] }) })] }));
|
|
430
434
|
}
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
};
|
|
450
|
-
const schedulerViewColumnStyle = {
|
|
451
|
-
verticalAlign: 'top'
|
|
452
|
-
};
|
|
453
|
-
const schedulerHeadWrapperStyle = {
|
|
454
|
-
overflow: 'hidden',
|
|
455
|
-
borderBottom: `1px solid ${config.headerBorderColor ?? '#e9e9e9'}`,
|
|
456
|
-
height: config.tableHeaderHeight + schedulerData.getHeaderGroupRowsHeight()
|
|
457
|
-
};
|
|
458
|
-
const schedulerHeadScrollStyle = {
|
|
459
|
-
overflowX: 'scroll',
|
|
460
|
-
overflowY: 'hidden',
|
|
461
|
-
margin: `0px 0px -${contentScrollbarHeight}px`
|
|
462
|
-
};
|
|
463
|
-
const schedulerHeadInnerStyle = {
|
|
464
|
-
paddingRight: `${contentScrollbarWidth}px`,
|
|
465
|
-
width: schedulerWidth + contentScrollbarWidth
|
|
466
|
-
};
|
|
467
|
-
tbodyContent = /*#__PURE__*/_jsxs("tr", {
|
|
468
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
469
|
-
style: resourceColumnStyle,
|
|
470
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
471
|
-
className: "resource-view",
|
|
472
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
473
|
-
style: resourceHeaderStyle,
|
|
474
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
475
|
-
style: resourceHeaderScrollStyle,
|
|
476
|
-
children: /*#__PURE__*/_jsx("table", {
|
|
477
|
-
className: "resource-table",
|
|
478
|
-
children: /*#__PURE__*/_jsxs("thead", {
|
|
479
|
-
children: [showMonthRow && /*#__PURE__*/_jsx("tr", {
|
|
480
|
-
style: {
|
|
481
|
-
height: monthRowHeight
|
|
482
|
-
},
|
|
483
|
-
children: /*#__PURE__*/_jsx("th", {
|
|
484
|
-
style: weekNumberThStyle
|
|
485
|
-
})
|
|
486
|
-
}), showWeekNumber && /*#__PURE__*/_jsx("tr", {
|
|
487
|
-
style: weekNumberRowStyle,
|
|
488
|
-
children: /*#__PURE__*/_jsx("th", {
|
|
489
|
-
style: weekNumberThStyle,
|
|
490
|
-
children: config.weekNumberLabel ?? 'Week No.'
|
|
491
|
-
})
|
|
492
|
-
}), /*#__PURE__*/_jsx("tr", {
|
|
493
|
-
style: {
|
|
494
|
-
height: config.tableHeaderHeight
|
|
495
|
-
},
|
|
496
|
-
children: /*#__PURE__*/_jsx("th", {
|
|
497
|
-
className: "header3-text",
|
|
498
|
-
children: CustomResourceHeader ? /*#__PURE__*/_jsx(CustomResourceHeader, {}) : resourceName
|
|
499
|
-
})
|
|
500
|
-
})]
|
|
501
|
-
})
|
|
502
|
-
})
|
|
503
|
-
})
|
|
504
|
-
}), /*#__PURE__*/_jsx("section", {
|
|
505
|
-
style: resourceContentStyle,
|
|
506
|
-
ref: schedulerResourceRef,
|
|
507
|
-
onMouseOver: onSchedulerResourceMouseOver,
|
|
508
|
-
onFocus: onSchedulerResourceMouseOver,
|
|
509
|
-
onMouseOut: onSchedulerResourceMouseOut,
|
|
510
|
-
onBlur: onSchedulerResourceMouseOut,
|
|
511
|
-
onScroll: onSchedulerResourceScroll,
|
|
512
|
-
"aria-label": "Resource sidebar",
|
|
513
|
-
children: /*#__PURE__*/_jsx(ResourceView, {
|
|
514
|
-
schedulerData: schedulerData,
|
|
515
|
-
schedulerDataVersion: schedulerDataVersion,
|
|
516
|
-
contentScrollbarHeight: resourcePaddingBottom,
|
|
517
|
-
slotClickedFunc: props.slotClickedFunc,
|
|
518
|
-
slotItemTemplateResolver: props.slotItemTemplateResolver,
|
|
519
|
-
toggleExpandFunc: props.toggleExpandFunc,
|
|
520
|
-
CustomResourceCell: props.CustomResourceCell,
|
|
521
|
-
isSelecting: selectionState.isSelecting,
|
|
522
|
-
selectedResourceIds: selectionState.selectedResourceIds
|
|
523
|
-
})
|
|
524
|
-
})]
|
|
525
|
-
})
|
|
526
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
527
|
-
style: schedulerViewColumnStyle,
|
|
528
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
529
|
-
className: "scheduler-view",
|
|
530
|
-
style: schedulerViewStyle,
|
|
531
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
532
|
-
style: schedulerHeadWrapperStyle,
|
|
533
|
-
children: /*#__PURE__*/_jsx("section", {
|
|
534
|
-
style: schedulerHeadScrollStyle,
|
|
535
|
-
ref: schedulerHeadRef,
|
|
536
|
-
onMouseOver: onSchedulerHeadMouseOver,
|
|
537
|
-
onFocus: onSchedulerHeadMouseOver,
|
|
538
|
-
onMouseOut: onSchedulerHeadMouseOut,
|
|
539
|
-
onBlur: onSchedulerHeadMouseOut,
|
|
540
|
-
onScroll: onSchedulerHeadScroll,
|
|
541
|
-
"aria-label": "Scheduler Header",
|
|
542
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
543
|
-
style: schedulerHeadInnerStyle,
|
|
544
|
-
children: /*#__PURE__*/_jsx("table", {
|
|
545
|
-
className: "scheduler-bg-table",
|
|
546
|
-
style: schedulerInnerStyle,
|
|
547
|
-
children: /*#__PURE__*/_jsx(HeaderView, {
|
|
548
|
-
schedulerData: schedulerData,
|
|
549
|
-
schedulerDataVersion: schedulerDataVersion,
|
|
550
|
-
nonAgendaCellHeaderTemplateResolver: props.nonAgendaCellHeaderTemplateResolver
|
|
551
|
-
})
|
|
552
|
-
})
|
|
553
|
-
})
|
|
554
|
-
})
|
|
555
|
-
}), /*#__PURE__*/_jsx("section", {
|
|
556
|
-
style: schedulerContentStyle,
|
|
557
|
-
ref: schedulerContentRef,
|
|
558
|
-
onMouseOver: onSchedulerContentMouseOver,
|
|
559
|
-
onFocus: onSchedulerContentMouseOver,
|
|
560
|
-
onMouseOut: onSchedulerContentMouseOut,
|
|
561
|
-
onBlur: onSchedulerContentMouseOut,
|
|
562
|
-
onScroll: onSchedulerContentScroll,
|
|
563
|
-
"aria-label": "Scheduler content",
|
|
564
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
565
|
-
style: schedulerInnerStyle,
|
|
566
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
567
|
-
className: "scheduler-content",
|
|
568
|
-
children: /*#__PURE__*/_jsx("table", {
|
|
569
|
-
className: "scheduler-content-table",
|
|
570
|
-
children: /*#__PURE__*/_jsx("tbody", {
|
|
571
|
-
children: resourceEventsList
|
|
572
|
-
})
|
|
573
|
-
})
|
|
574
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
575
|
-
className: "scheduler-bg",
|
|
576
|
-
children: /*#__PURE__*/_jsx("table", {
|
|
577
|
-
className: "scheduler-bg-table",
|
|
578
|
-
style: schedulerInnerStyle,
|
|
579
|
-
ref: schedulerContentBgTableRef,
|
|
580
|
-
children: /*#__PURE__*/_jsx(BodyView, {
|
|
581
|
-
schedulerData: schedulerData,
|
|
582
|
-
schedulerDataVersion: schedulerDataVersion
|
|
583
|
-
})
|
|
584
|
-
})
|
|
585
|
-
})]
|
|
586
|
-
})
|
|
587
|
-
})]
|
|
588
|
-
})
|
|
589
|
-
})]
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
const schedulerHeaderStyle = useMemo(() => ({
|
|
593
|
-
display: config.headerEnabled ? undefined : 'none',
|
|
594
|
-
marginBottom: config.headerEnabled ? '24px' : undefined
|
|
595
|
-
}), [config.headerEnabled]);
|
|
596
|
-
const schedulerHeader = useMemo(() => /*#__PURE__*/_jsx(SchedulerHeader, {
|
|
597
|
-
ref: setSchedulerHeaderRef,
|
|
598
|
-
style: schedulerHeaderStyle,
|
|
599
|
-
onViewChange: handleViewChange,
|
|
600
|
-
schedulerData: schedulerData,
|
|
601
|
-
onSelectDate: onSelect,
|
|
602
|
-
goNext: goNext,
|
|
603
|
-
goBack: goBack,
|
|
604
|
-
rightCustomHeader: rightCustomHeader,
|
|
605
|
-
leftCustomHeader: leftCustomHeader
|
|
606
|
-
}), [schedulerHeaderStyle, handleViewChange, schedulerData, onSelect, goNext, goBack, rightCustomHeader, leftCustomHeader, setSchedulerHeaderRef]);
|
|
607
|
-
|
|
608
|
-
// table-layout: fixed sizes columns from the first row (the toolbar, colSpan=2), so pin the resource column here
|
|
609
|
-
const resourceColumnWidth = schedulerData.showAgenda || !config.resourceViewEnabled ? undefined : schedulerData.getResourceTableWidth();
|
|
610
|
-
const rootTableStyle = useMemo(() => ({
|
|
611
|
-
width: `${width}px`,
|
|
612
|
-
tableLayout: 'fixed'
|
|
613
|
-
}), [width]);
|
|
614
|
-
return /*#__PURE__*/_jsx("div", {
|
|
615
|
-
ref: containerRef,
|
|
616
|
-
className: className ? `rbs-container ${className}` : 'rbs-container',
|
|
617
|
-
style: style,
|
|
618
|
-
children: /*#__PURE__*/_jsxs("table", {
|
|
619
|
-
id: "rbs-root",
|
|
620
|
-
className: `rbs ${schedulerData.isVerticalResourceView() ? 'vertical-view' : ''}`,
|
|
621
|
-
style: rootTableStyle,
|
|
622
|
-
ref: schedulerRootRef,
|
|
623
|
-
children: [resourceColumnWidth !== undefined && /*#__PURE__*/_jsxs("colgroup", {
|
|
624
|
-
children: [/*#__PURE__*/_jsx("col", {
|
|
625
|
-
style: {
|
|
626
|
-
width: resourceColumnWidth
|
|
627
|
-
}
|
|
628
|
-
}), /*#__PURE__*/_jsx("col", {})]
|
|
629
|
-
}), /*#__PURE__*/_jsx("thead", {
|
|
630
|
-
children: /*#__PURE__*/_jsx("tr", {
|
|
631
|
-
children: /*#__PURE__*/_jsx("td", {
|
|
632
|
-
colSpan: "2",
|
|
633
|
-
children: schedulerHeader
|
|
634
|
-
})
|
|
635
|
-
})
|
|
636
|
-
}), /*#__PURE__*/_jsx("tbody", {
|
|
637
|
-
children: tbodyContent
|
|
638
|
-
})]
|
|
639
|
-
})
|
|
640
|
-
});
|
|
435
|
+
const schedulerHeaderStyle = useMemo(() => ({
|
|
436
|
+
display: config.headerEnabled ? undefined : 'none',
|
|
437
|
+
marginBottom: config.headerEnabled ? '24px' : undefined,
|
|
438
|
+
}), [config.headerEnabled]);
|
|
439
|
+
const schedulerHeader = useMemo(() => (_jsx(SchedulerHeader, { ref: setSchedulerHeaderRef, style: schedulerHeaderStyle, onViewChange: handleViewChange, schedulerData: schedulerData, onSelectDate: onSelect, goNext: goNext, goBack: goBack, rightCustomHeader: rightCustomHeader, leftCustomHeader: leftCustomHeader })), [
|
|
440
|
+
schedulerHeaderStyle,
|
|
441
|
+
handleViewChange,
|
|
442
|
+
schedulerData,
|
|
443
|
+
onSelect,
|
|
444
|
+
goNext,
|
|
445
|
+
goBack,
|
|
446
|
+
rightCustomHeader,
|
|
447
|
+
leftCustomHeader,
|
|
448
|
+
setSchedulerHeaderRef,
|
|
449
|
+
]);
|
|
450
|
+
// table-layout: fixed sizes columns from the first row (the toolbar, colSpan=2), so pin the resource column here
|
|
451
|
+
const resourceColumnWidth = schedulerData.showAgenda || !config.resourceViewEnabled ? undefined : schedulerData.getResourceTableWidth();
|
|
452
|
+
const rootTableStyle = useMemo(() => ({ width: `${width}px`, tableLayout: 'fixed' }), [width]);
|
|
453
|
+
return (_jsx("div", { ref: containerRef, className: className ? `rbs-container ${className}` : 'rbs-container', style: style, "data-rbs-theme": config.theme, "data-rbs-look": config.look, "data-rbs-palette": config.palette, children: _jsxs("table", { id: "rbs-root", className: `rbs ${schedulerData.isVerticalResourceView() ? 'vertical-view' : ''}`, style: rootTableStyle, ref: schedulerRootRef, children: [resourceColumnWidth !== undefined && (_jsxs("colgroup", { children: [_jsx("col", { style: { width: resourceColumnWidth } }), _jsx("col", {})] })), _jsx("thead", { children: _jsx("tr", { children: _jsx("td", { colSpan: 2, children: schedulerHeader }) }) }), _jsx("tbody", { children: tbodyContent })] }) }));
|
|
641
454
|
}
|
|
642
|
-
Scheduler
|
|
643
|
-
parentRef: PropTypes.object,
|
|
644
|
-
className: PropTypes.string,
|
|
645
|
-
style: PropTypes.object,
|
|
646
|
-
schedulerData: PropTypes.object.isRequired,
|
|
647
|
-
prevClick: PropTypes.func.isRequired,
|
|
648
|
-
nextClick: PropTypes.func.isRequired,
|
|
649
|
-
onViewChange: PropTypes.func.isRequired,
|
|
650
|
-
onSelectDate: PropTypes.func.isRequired,
|
|
651
|
-
onSetAddMoreState: PropTypes.func,
|
|
652
|
-
updateEventStart: PropTypes.func,
|
|
653
|
-
updateEventEnd: PropTypes.func,
|
|
654
|
-
moveEvent: PropTypes.func,
|
|
655
|
-
movingEvent: PropTypes.func,
|
|
656
|
-
leftCustomHeader: PropTypes.object,
|
|
657
|
-
rightCustomHeader: PropTypes.object,
|
|
658
|
-
newEvent: PropTypes.func,
|
|
659
|
-
subtitleGetter: PropTypes.func,
|
|
660
|
-
eventItemClick: PropTypes.func,
|
|
661
|
-
viewEventClick: PropTypes.func,
|
|
662
|
-
viewEventText: PropTypes.string,
|
|
663
|
-
viewEvent2Click: PropTypes.func,
|
|
664
|
-
viewEvent2Text: PropTypes.string,
|
|
665
|
-
conflictOccurred: PropTypes.func,
|
|
666
|
-
eventItemTemplateResolver: PropTypes.func,
|
|
667
|
-
eventItemPopoverTemplateResolver: PropTypes.func,
|
|
668
|
-
dndSources: PropTypes.array,
|
|
669
|
-
slotClickedFunc: PropTypes.func,
|
|
670
|
-
toggleExpandFunc: PropTypes.func,
|
|
671
|
-
slotItemTemplateResolver: PropTypes.func,
|
|
672
|
-
nonAgendaCellHeaderTemplateResolver: PropTypes.func,
|
|
673
|
-
onScrollLeft: PropTypes.func,
|
|
674
|
-
onScrollRight: PropTypes.func,
|
|
675
|
-
onScrollTop: PropTypes.func,
|
|
676
|
-
onScrollBottom: PropTypes.func,
|
|
677
|
-
CustomResourceHeader: PropTypes.func,
|
|
678
|
-
CustomResourceCell: PropTypes.func,
|
|
679
|
-
configTableHeaderStyle: PropTypes.object
|
|
680
|
-
};
|
|
681
|
-
export { AddMorePopover, CellUnit, DATE_FORMAT, DATETIME_FORMAT, DemoData, DnDContext, DnDSource, Scheduler, SchedulerData, SummaryPos, ViewType, wrapperFun };
|
|
455
|
+
export { AddMorePopover, CellUnit, DATE_FORMAT, DATETIME_FORMAT, DemoData, DnDContext, DnDSource, Scheduler, SchedulerData, SummaryPos, ViewType, wrapperFun, };
|