react-native-ll-calendar 0.11.0 → 0.12.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/lib/module/calendar/resources-calendar/ResourcesCalendar.js +250 -111
- package/lib/module/calendar/resources-calendar/ResourcesCalendar.js.map +1 -1
- package/lib/typescript/src/calendar/resources-calendar/ResourcesCalendar.d.ts +1 -0
- package/lib/typescript/src/calendar/resources-calendar/ResourcesCalendar.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/calendar/resources-calendar/ResourcesCalendar.tsx +308 -126
|
@@ -9,15 +9,14 @@ import ResourcesCalendarEventPosition from "../../utils/resources-calendar-event
|
|
|
9
9
|
import { EVENT_GAP } from "../../constants/size.js";
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
const DEFAULT_DATE_COLUMN_WIDTH = 60;
|
|
12
|
+
const DEFAULT_RESOURCE_COLUMN_WIDTH = 80;
|
|
12
13
|
const DEFAULT_EVENT_HEIGHT = 22;
|
|
13
14
|
const CELL_BORDER_WIDTH = 0.5;
|
|
14
15
|
function ResourceRow({
|
|
15
16
|
resource,
|
|
16
17
|
dates,
|
|
17
18
|
dateColumnWidth,
|
|
18
|
-
scrollOffset,
|
|
19
19
|
eventsByResourceId,
|
|
20
|
-
renderResourceNameLabel,
|
|
21
20
|
onPressCell,
|
|
22
21
|
onLongPressCell,
|
|
23
22
|
delayLongPressCell,
|
|
@@ -28,24 +27,25 @@ function ResourceRow({
|
|
|
28
27
|
eventTextStyle,
|
|
29
28
|
eventEllipsizeMode,
|
|
30
29
|
cellContainerStyle,
|
|
31
|
-
allowFontScaling
|
|
30
|
+
allowFontScaling,
|
|
31
|
+
onLayout,
|
|
32
|
+
inlineBand
|
|
32
33
|
}) {
|
|
33
34
|
const resourceEvents = eventsByResourceId.get(resource.id) ?? [];
|
|
34
35
|
const eventPosition = new ResourcesCalendarEventPosition();
|
|
35
36
|
return /*#__PURE__*/_jsxs(View, {
|
|
36
37
|
style: styles.resourceRow,
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
onLayout: e => onLayout?.(e.nativeEvent.layout.height),
|
|
39
|
+
children: [inlineBand != null && /*#__PURE__*/_jsx(View, {
|
|
40
|
+
style: styles.resourceNameInlineBand,
|
|
39
41
|
children: /*#__PURE__*/_jsx(View, {
|
|
40
42
|
style: {
|
|
41
|
-
marginLeft: scrollOffset + 4
|
|
43
|
+
marginLeft: inlineBand.scrollOffset + 4
|
|
42
44
|
},
|
|
43
|
-
children: renderResourceNameLabel ? renderResourceNameLabel(resource) : /*#__PURE__*/_jsx(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
children: resource.name
|
|
48
|
-
})
|
|
45
|
+
children: inlineBand.renderResourceNameLabel ? inlineBand.renderResourceNameLabel(resource) : /*#__PURE__*/_jsx(Text, {
|
|
46
|
+
allowFontScaling: allowFontScaling,
|
|
47
|
+
style: styles.resourceNameInlineBandText,
|
|
48
|
+
children: resource.name
|
|
49
49
|
})
|
|
50
50
|
})
|
|
51
51
|
}), /*#__PURE__*/_jsx(View, {
|
|
@@ -53,7 +53,7 @@ function ResourceRow({
|
|
|
53
53
|
children: dates.map((date, dateIndex) => {
|
|
54
54
|
const djs = dayjs(date);
|
|
55
55
|
|
|
56
|
-
//
|
|
56
|
+
// Filter events that start on this date, or events that started before this date and continue into the first cell
|
|
57
57
|
const filteredEvents = resourceEvents.filter(event => {
|
|
58
58
|
const startDjs = dayjs(event.start);
|
|
59
59
|
return startDjs.format('YYYY-MM-DD') === djs.format('YYYY-MM-DD') || dateIndex === 0 && startDjs.isBefore(djs);
|
|
@@ -68,7 +68,7 @@ function ResourceRow({
|
|
|
68
68
|
return dayjs(a.start).diff(dayjs(b.start));
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
//
|
|
71
|
+
// Place events considering occupied row numbers to avoid overlap
|
|
72
72
|
const rowNums = eventPosition.getRowNums({
|
|
73
73
|
resourceId: resource.id,
|
|
74
74
|
date
|
|
@@ -104,7 +104,7 @@ function ResourceRow({
|
|
|
104
104
|
height: eventHeight,
|
|
105
105
|
marginBottom: EVENT_GAP
|
|
106
106
|
}
|
|
107
|
-
},
|
|
107
|
+
}, `spacer-${rowIndex}`);
|
|
108
108
|
}
|
|
109
109
|
const rawStartDjs = dayjs(event.start);
|
|
110
110
|
const startDjs = dateIndex === 0 ? djs : dayjs(event.start);
|
|
@@ -112,13 +112,13 @@ function ResourceRow({
|
|
|
112
112
|
const diffDays = endDjs.startOf('day').diff(startDjs.startOf('day'), 'day');
|
|
113
113
|
const isPrevDateEvent = dateIndex === 0 && rawStartDjs.isBefore(djs);
|
|
114
114
|
|
|
115
|
-
//
|
|
115
|
+
// Calculate event width based on the number of days it spans
|
|
116
116
|
let width = (diffDays + 1) * dateColumnWidth - EVENT_GAP * 2 - CELL_BORDER_WIDTH * 2;
|
|
117
117
|
if (isPrevDateEvent) {
|
|
118
118
|
width += EVENT_GAP + 1;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
//
|
|
121
|
+
// Record position info
|
|
122
122
|
eventPosition.push({
|
|
123
123
|
resourceId: resource.id,
|
|
124
124
|
startDate: startDjs.toDate(),
|
|
@@ -163,12 +163,17 @@ function ResourceRow({
|
|
|
163
163
|
}
|
|
164
164
|
export function ResourcesCalendar(props) {
|
|
165
165
|
const dateColumnWidth = props.dateColumnWidth ?? DEFAULT_DATE_COLUMN_WIDTH;
|
|
166
|
-
const
|
|
166
|
+
const isInlineBand = props.resourceNameLayout === 'inline-band';
|
|
167
|
+
const fixedRowCount = isInlineBand ? 0 : props.fixedRowCount ?? 0;
|
|
167
168
|
const dates = useMemo(() => generateDates(props.fromDate, props.toDate), [props.fromDate, props.toDate]);
|
|
168
169
|
const monthGroups = useMemo(() => groupDatesByMonth(dates), [dates]);
|
|
169
170
|
const eventsByResourceId = useMemo(() => {
|
|
170
|
-
const
|
|
171
|
+
const deduped = new Map();
|
|
171
172
|
for (const event of props.events) {
|
|
173
|
+
deduped.set(event.id, event);
|
|
174
|
+
}
|
|
175
|
+
const map = new Map();
|
|
176
|
+
for (const event of deduped.values()) {
|
|
172
177
|
const list = map.get(event.resourceId) ?? [];
|
|
173
178
|
list.push(event);
|
|
174
179
|
map.set(event.resourceId, list);
|
|
@@ -188,16 +193,30 @@ export function ResourcesCalendar(props) {
|
|
|
188
193
|
}, [monthGroups, dateColumnWidth]);
|
|
189
194
|
const fixedResources = useMemo(() => props.resources.slice(0, fixedRowCount), [props.resources, fixedRowCount]);
|
|
190
195
|
const scrollableResources = useMemo(() => props.resources.slice(fixedRowCount), [props.resources, fixedRowCount]);
|
|
196
|
+
const resourceColumnWidth = props.resourceColumnWidth ?? DEFAULT_RESOURCE_COLUMN_WIDTH;
|
|
197
|
+
const [rowHeights, setRowHeights] = useState(new Map());
|
|
198
|
+
const handleRowLayout = useCallback((resourceId, height) => {
|
|
199
|
+
setRowHeights(prev => {
|
|
200
|
+
if (prev.get(resourceId) === height) return prev;
|
|
201
|
+
const next = new Map(prev);
|
|
202
|
+
next.set(resourceId, height);
|
|
203
|
+
return next;
|
|
204
|
+
});
|
|
205
|
+
}, []);
|
|
206
|
+
const [headerHeight, setHeaderHeight] = useState(0);
|
|
191
207
|
const headerScrollRef = useRef(null);
|
|
192
208
|
const bodyScrollRef = useRef(null);
|
|
209
|
+
const outerScrollRef = useRef(null);
|
|
210
|
+
const resourceNameScrollRef = useRef(null);
|
|
193
211
|
const activeScroller = useRef(null);
|
|
194
212
|
const activeScrollerTimer = useRef(null);
|
|
195
213
|
const lastScrollX = useRef(0);
|
|
196
214
|
const [scrollOffset, setScrollOffset] = useState(0);
|
|
215
|
+
const activeVerticalScroller = useRef(null);
|
|
197
216
|
|
|
198
|
-
//
|
|
199
|
-
// activeScroller
|
|
200
|
-
//
|
|
217
|
+
// Sync the label position after scrolling stops.
|
|
218
|
+
// When the activeScroller timeout fires, treat it as scroll end
|
|
219
|
+
// and commit the current lastScrollX value to state.
|
|
201
220
|
const releaseActiveScroller = useCallback(() => {
|
|
202
221
|
activeScroller.current = null;
|
|
203
222
|
setScrollOffset(lastScrollX.current);
|
|
@@ -234,12 +253,34 @@ export function ResourcesCalendar(props) {
|
|
|
234
253
|
animated: false
|
|
235
254
|
});
|
|
236
255
|
}, [releaseActiveScroller]);
|
|
256
|
+
const handleOuterScroll = useCallback(event => {
|
|
257
|
+
if (activeVerticalScroller.current === 'resourceName') return;
|
|
258
|
+
activeVerticalScroller.current = 'outer';
|
|
259
|
+
const y = event.nativeEvent.contentOffset.y;
|
|
260
|
+
resourceNameScrollRef.current?.scrollTo({
|
|
261
|
+
y,
|
|
262
|
+
animated: false
|
|
263
|
+
});
|
|
264
|
+
}, []);
|
|
265
|
+
const handleResourceNameScroll = useCallback(event => {
|
|
266
|
+
if (activeVerticalScroller.current === 'outer') return;
|
|
267
|
+
activeVerticalScroller.current = 'resourceName';
|
|
268
|
+
const y = event.nativeEvent.contentOffset.y;
|
|
269
|
+
outerScrollRef.current?.scrollTo({
|
|
270
|
+
y,
|
|
271
|
+
animated: false
|
|
272
|
+
});
|
|
273
|
+
}, []);
|
|
274
|
+
const handleOuterScrollEnd = useCallback(() => {
|
|
275
|
+
activeVerticalScroller.current = null;
|
|
276
|
+
}, []);
|
|
277
|
+
const handleResourceNameScrollEnd = useCallback(() => {
|
|
278
|
+
activeVerticalScroller.current = null;
|
|
279
|
+
}, []);
|
|
237
280
|
const commonRowProps = {
|
|
238
281
|
dates,
|
|
239
282
|
dateColumnWidth,
|
|
240
|
-
scrollOffset,
|
|
241
283
|
eventsByResourceId,
|
|
242
|
-
renderResourceNameLabel: props.renderResourceNameLabel,
|
|
243
284
|
onPressCell: props.onPressCell,
|
|
244
285
|
onLongPressCell: props.onLongPressCell,
|
|
245
286
|
delayLongPressCell: props.delayLongPressCell,
|
|
@@ -250,94 +291,169 @@ export function ResourcesCalendar(props) {
|
|
|
250
291
|
eventTextStyle: props.eventTextStyle,
|
|
251
292
|
eventEllipsizeMode: props.eventEllipsizeMode,
|
|
252
293
|
cellContainerStyle: props.cellContainerStyle,
|
|
253
|
-
allowFontScaling: props.allowFontScaling
|
|
294
|
+
allowFontScaling: props.allowFontScaling,
|
|
295
|
+
inlineBand: isInlineBand ? {
|
|
296
|
+
scrollOffset,
|
|
297
|
+
renderResourceNameLabel: props.renderResourceNameLabel
|
|
298
|
+
} : undefined
|
|
254
299
|
};
|
|
255
|
-
|
|
300
|
+
const resourceNameColumn = !isInlineBand ? /*#__PURE__*/_jsxs(ScrollView, {
|
|
301
|
+
ref: resourceNameScrollRef,
|
|
302
|
+
style: [styles.resourceNameColumn, {
|
|
303
|
+
width: resourceColumnWidth
|
|
304
|
+
}],
|
|
305
|
+
contentContainerStyle: {
|
|
306
|
+
width: resourceColumnWidth
|
|
307
|
+
},
|
|
256
308
|
stickyHeaderIndices: [0],
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
309
|
+
showsVerticalScrollIndicator: false,
|
|
310
|
+
bounces: false,
|
|
311
|
+
overScrollMode: "never",
|
|
312
|
+
onScroll: handleResourceNameScroll,
|
|
313
|
+
onScrollEndDrag: handleResourceNameScrollEnd,
|
|
314
|
+
onMomentumScrollEnd: handleResourceNameScrollEnd,
|
|
315
|
+
scrollEventThrottle: 16,
|
|
316
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
317
|
+
style: [styles.resourceNameColumn, styles.resourceNameColumnFixed],
|
|
318
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
319
|
+
style: [styles.resourceNameHeaderSpacer, {
|
|
320
|
+
height: headerHeight
|
|
321
|
+
}]
|
|
322
|
+
}), fixedResources.map(resource => /*#__PURE__*/_jsx(View, {
|
|
323
|
+
style: [styles.resourceNameCell, {
|
|
324
|
+
height: rowHeights.get(resource.id)
|
|
325
|
+
}],
|
|
326
|
+
children: props.renderResourceNameLabel ? props.renderResourceNameLabel(resource) : /*#__PURE__*/_jsx(View, {
|
|
327
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
328
|
+
allowFontScaling: props.allowFontScaling,
|
|
329
|
+
style: styles.resourceNameFixedLabelText,
|
|
330
|
+
numberOfLines: 1,
|
|
331
|
+
children: resource.name
|
|
332
|
+
})
|
|
333
|
+
})
|
|
334
|
+
}, resource.id))]
|
|
335
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
336
|
+
children: [scrollableResources.map(resource => /*#__PURE__*/_jsx(View, {
|
|
337
|
+
style: [styles.resourceNameCell, {
|
|
338
|
+
height: rowHeights.get(resource.id)
|
|
339
|
+
}],
|
|
340
|
+
children: props.renderResourceNameLabel ? props.renderResourceNameLabel(resource) : /*#__PURE__*/_jsx(View, {
|
|
341
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
342
|
+
allowFontScaling: props.allowFontScaling,
|
|
343
|
+
style: styles.resourceNameFixedLabelText,
|
|
344
|
+
numberOfLines: 1,
|
|
345
|
+
children: resource.name
|
|
346
|
+
})
|
|
347
|
+
})
|
|
348
|
+
}, resource.id)), /*#__PURE__*/_jsx(View, {
|
|
349
|
+
style: {
|
|
350
|
+
height: props.bottomSpacing
|
|
351
|
+
}
|
|
352
|
+
})]
|
|
353
|
+
})]
|
|
354
|
+
}) : null;
|
|
355
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
356
|
+
style: styles.container,
|
|
357
|
+
children: [resourceNameColumn, /*#__PURE__*/_jsxs(ScrollView, {
|
|
358
|
+
ref: outerScrollRef,
|
|
359
|
+
style: styles.calendarBody,
|
|
360
|
+
stickyHeaderIndices: [0],
|
|
361
|
+
onScroll: handleOuterScroll,
|
|
362
|
+
onScrollEndDrag: handleOuterScrollEnd,
|
|
363
|
+
onMomentumScrollEnd: handleOuterScrollEnd,
|
|
268
364
|
scrollEventThrottle: 16,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
365
|
+
overScrollMode: "never",
|
|
366
|
+
bounces: props.onRefresh != null,
|
|
367
|
+
refreshControl: props.onRefresh != null ? /*#__PURE__*/_jsx(RefreshControl, {
|
|
368
|
+
refreshing: props.refreshing ?? false,
|
|
369
|
+
onRefresh: props.onRefresh
|
|
370
|
+
}) : undefined,
|
|
371
|
+
children: [/*#__PURE__*/_jsx(ScrollView, {
|
|
372
|
+
ref: headerScrollRef,
|
|
373
|
+
horizontal: true,
|
|
374
|
+
showsHorizontalScrollIndicator: false,
|
|
375
|
+
bounces: false,
|
|
376
|
+
overScrollMode: "never",
|
|
377
|
+
onScroll: handleHeaderScroll,
|
|
378
|
+
scrollEventThrottle: 16,
|
|
379
|
+
"data-component-name": "resources-calendar-header-row",
|
|
380
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
381
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
382
|
+
onLayout: e => setHeaderHeight(e.nativeEvent.layout.height),
|
|
383
|
+
children: [!props.hiddenMonth && /*#__PURE__*/_jsx(View, {
|
|
384
|
+
style: styles.monthHeaderRow,
|
|
385
|
+
children: monthGroups.map(({
|
|
386
|
+
year,
|
|
387
|
+
month
|
|
388
|
+
}, index) => {
|
|
389
|
+
const {
|
|
390
|
+
start: cellStart,
|
|
391
|
+
width: cellWidth
|
|
392
|
+
} = monthGroupOffsets[index];
|
|
393
|
+
const textLeft = Math.max(8, scrollOffset - cellStart + 8);
|
|
394
|
+
return /*#__PURE__*/_jsx(View, {
|
|
395
|
+
style: [styles.monthHeaderCell, {
|
|
396
|
+
width: cellWidth
|
|
397
|
+
}],
|
|
398
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
399
|
+
style: {
|
|
400
|
+
marginLeft: textLeft
|
|
401
|
+
},
|
|
402
|
+
children: props.renderMonthLabel ? props.renderMonthLabel(year, month) : /*#__PURE__*/_jsx(View, {
|
|
403
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
404
|
+
numberOfLines: 1,
|
|
405
|
+
allowFontScaling: props.allowFontScaling,
|
|
406
|
+
style: styles.monthHeaderText,
|
|
407
|
+
children: dayjs(`${year}-${month}-01`).format('YYYY/MM')
|
|
408
|
+
})
|
|
409
|
+
})
|
|
410
|
+
})
|
|
411
|
+
}, `${year}-${month}`);
|
|
412
|
+
})
|
|
413
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
414
|
+
style: styles.headerRow,
|
|
415
|
+
children: dates.map(date => /*#__PURE__*/_jsx(View, {
|
|
416
|
+
"data-component-name": "resources-calendar-date-cell",
|
|
417
|
+
style: [styles.dateCellContainer, {
|
|
418
|
+
width: dateColumnWidth
|
|
419
|
+
}, props.dateCellContainerStyle?.(date)],
|
|
420
|
+
children: props.renderDateLabel ? props.renderDateLabel(date) : /*#__PURE__*/_jsx(View, {
|
|
291
421
|
children: /*#__PURE__*/_jsx(Text, {
|
|
292
|
-
numberOfLines: 1,
|
|
293
422
|
allowFontScaling: props.allowFontScaling,
|
|
294
|
-
|
|
295
|
-
children: dayjs(`${year}-${month}-01`).format('YYYY/MM')
|
|
423
|
+
children: dayjs(date).format('D(ddd)')
|
|
296
424
|
})
|
|
297
425
|
})
|
|
298
|
-
})
|
|
299
|
-
}
|
|
300
|
-
})
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
426
|
+
}, date.getTime()))
|
|
427
|
+
})]
|
|
428
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
429
|
+
children: fixedResources.map(resource => /*#__PURE__*/_jsx(ResourceRow, {
|
|
430
|
+
resource: resource,
|
|
431
|
+
...commonRowProps,
|
|
432
|
+
onLayout: height => handleRowLayout(resource.id, height)
|
|
433
|
+
}, resource.id))
|
|
434
|
+
})]
|
|
435
|
+
})
|
|
436
|
+
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
437
|
+
ref: bodyScrollRef,
|
|
438
|
+
horizontal: true,
|
|
439
|
+
showsHorizontalScrollIndicator: false,
|
|
440
|
+
bounces: false,
|
|
441
|
+
overScrollMode: "never",
|
|
442
|
+
onScroll: handleBodyScroll,
|
|
443
|
+
scrollEventThrottle: 16,
|
|
444
|
+
"data-component-name": "resources-calendar-body-row",
|
|
445
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
446
|
+
children: scrollableResources.map(resource => /*#__PURE__*/_jsx(ResourceRow, {
|
|
317
447
|
resource: resource,
|
|
318
|
-
...commonRowProps
|
|
448
|
+
...commonRowProps,
|
|
449
|
+
onLayout: height => handleRowLayout(resource.id, height)
|
|
319
450
|
}, resource.id))
|
|
320
|
-
})
|
|
321
|
-
})
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
bounces: false,
|
|
327
|
-
overScrollMode: "never",
|
|
328
|
-
onScroll: handleBodyScroll,
|
|
329
|
-
scrollEventThrottle: 16,
|
|
330
|
-
"data-component-name": "resources-calendar-body-row",
|
|
331
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
332
|
-
children: scrollableResources.map(resource => /*#__PURE__*/_jsx(ResourceRow, {
|
|
333
|
-
resource: resource,
|
|
334
|
-
...commonRowProps
|
|
335
|
-
}, resource.id))
|
|
336
|
-
})
|
|
337
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
338
|
-
style: {
|
|
339
|
-
height: props.bottomSpacing
|
|
340
|
-
}
|
|
451
|
+
})
|
|
452
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
453
|
+
style: {
|
|
454
|
+
height: props.bottomSpacing
|
|
455
|
+
}
|
|
456
|
+
})]
|
|
341
457
|
})]
|
|
342
458
|
});
|
|
343
459
|
}
|
|
@@ -373,11 +489,6 @@ const styles = StyleSheet.create({
|
|
|
373
489
|
borderRightWidth: CELL_BORDER_WIDTH,
|
|
374
490
|
borderColor: 'lightslategrey'
|
|
375
491
|
},
|
|
376
|
-
resourceNameCellContainer: {
|
|
377
|
-
width: 80,
|
|
378
|
-
borderRightWidth: CELL_BORDER_WIDTH,
|
|
379
|
-
borderColor: 'lightslategrey'
|
|
380
|
-
},
|
|
381
492
|
resourceRow: {
|
|
382
493
|
flexDirection: 'column',
|
|
383
494
|
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
@@ -395,16 +506,44 @@ const styles = StyleSheet.create({
|
|
|
395
506
|
borderRightWidth: CELL_BORDER_WIDTH,
|
|
396
507
|
borderColor: 'lightslategrey'
|
|
397
508
|
},
|
|
509
|
+
container: {
|
|
510
|
+
flexDirection: 'row',
|
|
511
|
+
flex: 1
|
|
512
|
+
},
|
|
513
|
+
calendarBody: {
|
|
514
|
+
flex: 1
|
|
515
|
+
},
|
|
398
516
|
resourceNameColumn: {
|
|
399
|
-
|
|
517
|
+
borderRightWidth: CELL_BORDER_WIDTH,
|
|
518
|
+
borderRightColor: 'lightslategrey',
|
|
519
|
+
flexGrow: 0,
|
|
520
|
+
flexShrink: 0
|
|
521
|
+
},
|
|
522
|
+
resourceNameColumnFixed: {
|
|
523
|
+
backgroundColor: 'white'
|
|
524
|
+
},
|
|
525
|
+
resourceNameHeaderSpacer: {
|
|
526
|
+
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
527
|
+
borderBottomColor: 'lightslategrey'
|
|
528
|
+
},
|
|
529
|
+
resourceNameCell: {
|
|
530
|
+
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
531
|
+
borderBottomColor: 'lightslategrey',
|
|
532
|
+
justifyContent: 'center',
|
|
533
|
+
paddingHorizontal: 4,
|
|
534
|
+
minHeight: 30
|
|
400
535
|
},
|
|
401
|
-
|
|
536
|
+
resourceNameFixedLabelText: {
|
|
537
|
+
fontSize: 12,
|
|
538
|
+
color: 'black'
|
|
539
|
+
},
|
|
540
|
+
resourceNameInlineBand: {
|
|
402
541
|
width: '100%',
|
|
403
542
|
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
404
543
|
borderColor: 'lightslategrey',
|
|
405
544
|
backgroundColor: '#EEEEEE'
|
|
406
545
|
},
|
|
407
|
-
|
|
546
|
+
resourceNameInlineBandText: {
|
|
408
547
|
fontSize: 12,
|
|
409
548
|
color: 'black'
|
|
410
549
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","useRef","useState","RefreshControl","ScrollView","StyleSheet","Text","TouchableOpacity","View","generateDates","groupDatesByMonth","dayjs","ResourcesCalendarEventPosition","EVENT_GAP","jsx","_jsx","jsxs","_jsxs","DEFAULT_DATE_COLUMN_WIDTH","DEFAULT_EVENT_HEIGHT","CELL_BORDER_WIDTH","ResourceRow","resource","dates","dateColumnWidth","scrollOffset","eventsByResourceId","renderResourceNameLabel","onPressCell","onLongPressCell","delayLongPressCell","onPressEvent","onLongPressEvent","delayLongPressEvent","eventHeight","eventTextStyle","eventEllipsizeMode","cellContainerStyle","allowFontScaling","resourceEvents","get","id","eventPosition","style","styles","resourceRow","children","resourceNameFixedLabel","marginLeft","resourceNameFixedLabelText","name","resourceRowContentArea","map","date","dateIndex","djs","filteredEvents","filter","event","startDjs","start","format","isBefore","sort","a","b","aStartDjs","bStartDjs","aDiffDays","end","startOf","diff","bDiffDays","rowNums","getRowNums","resourceId","cellEvents","rowsLength","length","eventIndex","ii","includes","push","contentCellContainer","width","zIndex","onPress","onLongPress","delayLongPress","activeOpacity","rowIndex","height","marginBottom","rawStartDjs","endDjs","diffDays","isPrevDateEvent","startDate","toDate","days","rowNum","backgroundColor","borderColor","borderStyle","undefined","borderWidth","borderRadius","prevDateEvent","numberOfLines","ellipsizeMode","eventTitle","color","title","getTime","ResourcesCalendar","props","fixedRowCount","fromDate","monthGroups","Map","events","list","set","monthGroupOffsets","offset","group","fixedResources","resources","slice","scrollableResources","headerScrollRef","bodyScrollRef","activeScroller","activeScrollerTimer","lastScrollX","setScrollOffset","releaseActiveScroller","current","handleHeaderScroll","x","nativeEvent","contentOffset","clearTimeout","setTimeout","scrollTo","animated","handleBodyScroll","commonRowProps","stickyHeaderIndices","refreshControl","refreshing","onRefresh","ref","horizontal","showsHorizontalScrollIndicator","bounces","overScrollMode","onScroll","scrollEventThrottle","hiddenMonth","monthHeaderRow","year","month","index","cellStart","cellWidth","textLeft","Math","max","monthHeaderCell","renderMonthLabel","monthHeaderText","headerRow","dateCellContainer","dateCellContainerStyle","renderDateLabel","bottomSpacing","create","flexDirection","justifyContent","alignItems","overflow","borderRightWidth","borderRightColor","borderTopWidth","borderTopColor","fontSize","borderBottomWidth","borderBottomColor","resourceNameCellContainer","minHeight","paddingBottom","resourceNameColumn","paddingHorizontal","marginTop","borderTopStartRadius","borderBottomStartRadius"],"sourceRoot":"../../../../src","sources":["calendar/resources-calendar/ResourcesCalendar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAKrE,SAKEC,cAAc,EACdC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,gBAAgB,QACX,cAAc;AACrB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,0BAAuB;AACxE,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,8BAA8B,MAAM,kDAA+C;AAC1F,SAASC,SAAS,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA+BjD,MAAMC,yBAAyB,GAAG,EAAE;AACpC,MAAMC,oBAAoB,GAAG,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uF,iBAAiB,EAAE,CAAC;IACpBf,aAAa,EAAE,KAAK;IACpBE,UAAU,EAAE,QAAQ;IACpBc,SAAS,EAAErL,SAAS;IACpBmC,UAAU,EAAEnC;EACd,CAAC;EACD8F,aAAa,EAAE;IACb3D,UAAU,EAAE,CAAC,CAAC;IACdmJ,oBAAoB,EAAE,CAAC;IACvBC,uBAAuB,EAAE;EAC3B,CAAC;EACDtF,UAAU,EAAE;IACV4E,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","useRef","useState","RefreshControl","ScrollView","StyleSheet","Text","TouchableOpacity","View","generateDates","groupDatesByMonth","dayjs","ResourcesCalendarEventPosition","EVENT_GAP","jsx","_jsx","jsxs","_jsxs","DEFAULT_DATE_COLUMN_WIDTH","DEFAULT_RESOURCE_COLUMN_WIDTH","DEFAULT_EVENT_HEIGHT","CELL_BORDER_WIDTH","ResourceRow","resource","dates","dateColumnWidth","eventsByResourceId","onPressCell","onLongPressCell","delayLongPressCell","onPressEvent","onLongPressEvent","delayLongPressEvent","eventHeight","eventTextStyle","eventEllipsizeMode","cellContainerStyle","allowFontScaling","onLayout","inlineBand","resourceEvents","get","id","eventPosition","style","styles","resourceRow","e","nativeEvent","layout","height","children","resourceNameInlineBand","marginLeft","scrollOffset","renderResourceNameLabel","resourceNameInlineBandText","name","resourceRowContentArea","map","date","dateIndex","djs","filteredEvents","filter","event","startDjs","start","format","isBefore","sort","a","b","aStartDjs","bStartDjs","aDiffDays","end","startOf","diff","bDiffDays","rowNums","getRowNums","resourceId","cellEvents","rowsLength","length","eventIndex","ii","includes","push","contentCellContainer","width","zIndex","onPress","onLongPress","delayLongPress","activeOpacity","rowIndex","marginBottom","rawStartDjs","endDjs","diffDays","isPrevDateEvent","startDate","toDate","days","rowNum","backgroundColor","borderColor","borderStyle","undefined","borderWidth","borderRadius","prevDateEvent","numberOfLines","ellipsizeMode","eventTitle","color","title","getTime","ResourcesCalendar","props","isInlineBand","resourceNameLayout","fixedRowCount","fromDate","monthGroups","deduped","Map","events","set","values","list","monthGroupOffsets","offset","group","fixedResources","resources","slice","scrollableResources","resourceColumnWidth","rowHeights","setRowHeights","handleRowLayout","prev","next","headerHeight","setHeaderHeight","headerScrollRef","bodyScrollRef","outerScrollRef","resourceNameScrollRef","activeScroller","activeScrollerTimer","lastScrollX","setScrollOffset","activeVerticalScroller","releaseActiveScroller","current","handleHeaderScroll","x","contentOffset","clearTimeout","setTimeout","scrollTo","animated","handleBodyScroll","handleOuterScroll","y","handleResourceNameScroll","handleOuterScrollEnd","handleResourceNameScrollEnd","commonRowProps","resourceNameColumn","ref","contentContainerStyle","stickyHeaderIndices","showsVerticalScrollIndicator","bounces","overScrollMode","onScroll","onScrollEndDrag","onMomentumScrollEnd","scrollEventThrottle","resourceNameColumnFixed","resourceNameHeaderSpacer","resourceNameCell","resourceNameFixedLabelText","bottomSpacing","container","calendarBody","onRefresh","refreshControl","refreshing","horizontal","showsHorizontalScrollIndicator","hiddenMonth","monthHeaderRow","year","month","index","cellStart","cellWidth","textLeft","Math","max","monthHeaderCell","renderMonthLabel","monthHeaderText","headerRow","dateCellContainer","dateCellContainerStyle","renderDateLabel","create","flexDirection","justifyContent","alignItems","overflow","borderRightWidth","borderRightColor","borderTopWidth","borderTopColor","fontSize","borderBottomWidth","borderBottomColor","minHeight","paddingBottom","flex","flexGrow","flexShrink","paddingHorizontal","marginTop","borderTopStartRadius","borderBottomStartRadius"],"sourceRoot":"../../../../src","sources":["calendar/resources-calendar/ResourcesCalendar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAKrE,SAKEC,cAAc,EACdC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,gBAAgB,QACX,cAAc;AACrB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,0BA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EAAE,CAAC;IACvBC,uBAAuB,EAAE;EAC3B,CAAC;EACDrH,UAAU,EAAE;IACV0G,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -28,6 +28,7 @@ type ResourcesCalendarProps = {
|
|
|
28
28
|
cellContainerStyle?: (resource: CalendarResource, date: Date) => ViewStyle;
|
|
29
29
|
hiddenMonth?: boolean;
|
|
30
30
|
allowFontScaling?: boolean;
|
|
31
|
+
resourceNameLayout?: 'fixed-column' | 'inline-band';
|
|
31
32
|
};
|
|
32
33
|
export declare function ResourcesCalendar(props: ResourcesCalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
33
34
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesCalendar.d.ts","sourceRoot":"","sources":["../../../../../src/calendar/resources-calendar/ResourcesCalendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EAMf,MAAM,cAAc,CAAC;AAOtB,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,IAAI,CAAC;IACb,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACpD,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACtE,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5E,mBAAmB,CAAC,EAAE,MAAM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,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,CAAC;IACrD,kBAAkB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACzD,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC;IACnD,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;CACrD,CAAC;AAkOF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAwX9D"}
|
package/package.json
CHANGED
|
@@ -47,9 +47,11 @@ type ResourcesCalendarProps = {
|
|
|
47
47
|
cellContainerStyle?: (resource: CalendarResource, date: Date) => ViewStyle;
|
|
48
48
|
hiddenMonth?: boolean;
|
|
49
49
|
allowFontScaling?: boolean;
|
|
50
|
+
resourceNameLayout?: 'fixed-column' | 'inline-band';
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
const DEFAULT_DATE_COLUMN_WIDTH = 60;
|
|
54
|
+
const DEFAULT_RESOURCE_COLUMN_WIDTH = 80;
|
|
53
55
|
const DEFAULT_EVENT_HEIGHT = 22;
|
|
54
56
|
const CELL_BORDER_WIDTH = 0.5;
|
|
55
57
|
|
|
@@ -57,9 +59,7 @@ type ResourceRowProps = {
|
|
|
57
59
|
resource: CalendarResource;
|
|
58
60
|
dates: Date[];
|
|
59
61
|
dateColumnWidth: number;
|
|
60
|
-
scrollOffset: number;
|
|
61
62
|
eventsByResourceId: Map<string, CalendarEvent[]>;
|
|
62
|
-
renderResourceNameLabel?: (resource: CalendarResource) => React.JSX.Element;
|
|
63
63
|
onPressCell?: (resource: CalendarResource, date: Date) => void;
|
|
64
64
|
onLongPressCell?: (resource: CalendarResource, date: Date) => void;
|
|
65
65
|
delayLongPressCell?: number;
|
|
@@ -71,15 +71,18 @@ type ResourceRowProps = {
|
|
|
71
71
|
eventEllipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';
|
|
72
72
|
cellContainerStyle?: (resource: CalendarResource, date: Date) => ViewStyle;
|
|
73
73
|
allowFontScaling?: boolean;
|
|
74
|
+
onLayout?: (height: number) => void;
|
|
75
|
+
inlineBand?: {
|
|
76
|
+
scrollOffset: number;
|
|
77
|
+
renderResourceNameLabel?: (resource: CalendarResource) => React.JSX.Element;
|
|
78
|
+
};
|
|
74
79
|
};
|
|
75
80
|
|
|
76
81
|
function ResourceRow({
|
|
77
82
|
resource,
|
|
78
83
|
dates,
|
|
79
84
|
dateColumnWidth,
|
|
80
|
-
scrollOffset,
|
|
81
85
|
eventsByResourceId,
|
|
82
|
-
renderResourceNameLabel,
|
|
83
86
|
onPressCell,
|
|
84
87
|
onLongPressCell,
|
|
85
88
|
delayLongPressCell,
|
|
@@ -91,33 +94,38 @@ function ResourceRow({
|
|
|
91
94
|
eventEllipsizeMode,
|
|
92
95
|
cellContainerStyle,
|
|
93
96
|
allowFontScaling,
|
|
97
|
+
onLayout,
|
|
98
|
+
inlineBand,
|
|
94
99
|
}: ResourceRowProps) {
|
|
95
100
|
const resourceEvents = eventsByResourceId.get(resource.id) ?? [];
|
|
96
101
|
const eventPosition = new ResourcesCalendarEventPosition();
|
|
97
102
|
|
|
98
103
|
return (
|
|
99
|
-
<View
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
<View
|
|
105
|
+
style={styles.resourceRow}
|
|
106
|
+
onLayout={(e) => onLayout?.(e.nativeEvent.layout.height)}
|
|
107
|
+
>
|
|
108
|
+
{inlineBand != null && (
|
|
109
|
+
<View style={styles.resourceNameInlineBand}>
|
|
110
|
+
<View style={{ marginLeft: inlineBand.scrollOffset + 4 }}>
|
|
111
|
+
{inlineBand.renderResourceNameLabel ? (
|
|
112
|
+
inlineBand.renderResourceNameLabel(resource)
|
|
113
|
+
) : (
|
|
106
114
|
<Text
|
|
107
115
|
allowFontScaling={allowFontScaling}
|
|
108
|
-
style={styles.
|
|
116
|
+
style={styles.resourceNameInlineBandText}
|
|
109
117
|
>
|
|
110
118
|
{resource.name}
|
|
111
119
|
</Text>
|
|
112
|
-
|
|
113
|
-
|
|
120
|
+
)}
|
|
121
|
+
</View>
|
|
114
122
|
</View>
|
|
115
|
-
|
|
123
|
+
)}
|
|
116
124
|
<View style={styles.resourceRowContentArea}>
|
|
117
125
|
{dates.map((date, dateIndex) => {
|
|
118
126
|
const djs = dayjs(date);
|
|
119
127
|
|
|
120
|
-
//
|
|
128
|
+
// Filter events that start on this date, or events that started before this date and continue into the first cell
|
|
121
129
|
const filteredEvents = resourceEvents
|
|
122
130
|
.filter((event) => {
|
|
123
131
|
const startDjs = dayjs(event.start);
|
|
@@ -141,7 +149,7 @@ function ResourceRow({
|
|
|
141
149
|
return dayjs(a.start).diff(dayjs(b.start));
|
|
142
150
|
});
|
|
143
151
|
|
|
144
|
-
//
|
|
152
|
+
// Place events considering occupied row numbers to avoid overlap
|
|
145
153
|
const rowNums = eventPosition.getRowNums({
|
|
146
154
|
resourceId: resource.id,
|
|
147
155
|
date,
|
|
@@ -179,7 +187,7 @@ function ResourceRow({
|
|
|
179
187
|
if (typeof event === 'number') {
|
|
180
188
|
return (
|
|
181
189
|
<View
|
|
182
|
-
key={
|
|
190
|
+
key={`spacer-${rowIndex}`}
|
|
183
191
|
style={{
|
|
184
192
|
height: eventHeight,
|
|
185
193
|
marginBottom: EVENT_GAP,
|
|
@@ -197,7 +205,7 @@ function ResourceRow({
|
|
|
197
205
|
const isPrevDateEvent =
|
|
198
206
|
dateIndex === 0 && rawStartDjs.isBefore(djs);
|
|
199
207
|
|
|
200
|
-
//
|
|
208
|
+
// Calculate event width based on the number of days it spans
|
|
201
209
|
let width =
|
|
202
210
|
(diffDays + 1) * dateColumnWidth -
|
|
203
211
|
EVENT_GAP * 2 -
|
|
@@ -206,7 +214,7 @@ function ResourceRow({
|
|
|
206
214
|
width += EVENT_GAP + 1;
|
|
207
215
|
}
|
|
208
216
|
|
|
209
|
-
//
|
|
217
|
+
// Record position info
|
|
210
218
|
eventPosition.push({
|
|
211
219
|
resourceId: resource.id,
|
|
212
220
|
startDate: startDjs.toDate(),
|
|
@@ -268,7 +276,8 @@ type ScrollViewRef = React.ComponentRef<typeof ScrollView>;
|
|
|
268
276
|
|
|
269
277
|
export function ResourcesCalendar(props: ResourcesCalendarProps) {
|
|
270
278
|
const dateColumnWidth = props.dateColumnWidth ?? DEFAULT_DATE_COLUMN_WIDTH;
|
|
271
|
-
const
|
|
279
|
+
const isInlineBand = props.resourceNameLayout === 'inline-band';
|
|
280
|
+
const fixedRowCount = isInlineBand ? 0 : (props.fixedRowCount ?? 0);
|
|
272
281
|
|
|
273
282
|
const dates = useMemo(
|
|
274
283
|
() => generateDates(props.fromDate, props.toDate),
|
|
@@ -278,8 +287,12 @@ export function ResourcesCalendar(props: ResourcesCalendarProps) {
|
|
|
278
287
|
const monthGroups = useMemo(() => groupDatesByMonth(dates), [dates]);
|
|
279
288
|
|
|
280
289
|
const eventsByResourceId = useMemo(() => {
|
|
281
|
-
const
|
|
290
|
+
const deduped = new Map<string, CalendarEvent>();
|
|
282
291
|
for (const event of props.events) {
|
|
292
|
+
deduped.set(event.id, event);
|
|
293
|
+
}
|
|
294
|
+
const map = new Map<string, CalendarEvent[]>();
|
|
295
|
+
for (const event of deduped.values()) {
|
|
283
296
|
const list = map.get(event.resourceId) ?? [];
|
|
284
297
|
list.push(event);
|
|
285
298
|
map.set(event.resourceId, list);
|
|
@@ -305,8 +318,25 @@ export function ResourcesCalendar(props: ResourcesCalendarProps) {
|
|
|
305
318
|
[props.resources, fixedRowCount]
|
|
306
319
|
);
|
|
307
320
|
|
|
321
|
+
const resourceColumnWidth =
|
|
322
|
+
props.resourceColumnWidth ?? DEFAULT_RESOURCE_COLUMN_WIDTH;
|
|
323
|
+
|
|
324
|
+
const [rowHeights, setRowHeights] = useState<Map<string, number>>(new Map());
|
|
325
|
+
const handleRowLayout = useCallback((resourceId: string, height: number) => {
|
|
326
|
+
setRowHeights((prev) => {
|
|
327
|
+
if (prev.get(resourceId) === height) return prev;
|
|
328
|
+
const next = new Map(prev);
|
|
329
|
+
next.set(resourceId, height);
|
|
330
|
+
return next;
|
|
331
|
+
});
|
|
332
|
+
}, []);
|
|
333
|
+
|
|
334
|
+
const [headerHeight, setHeaderHeight] = useState(0);
|
|
335
|
+
|
|
308
336
|
const headerScrollRef = useRef<ScrollViewRef>(null);
|
|
309
337
|
const bodyScrollRef = useRef<ScrollViewRef>(null);
|
|
338
|
+
const outerScrollRef = useRef<ScrollViewRef>(null);
|
|
339
|
+
const resourceNameScrollRef = useRef<ScrollViewRef>(null);
|
|
310
340
|
const activeScroller = useRef<'header' | 'body' | null>(null);
|
|
311
341
|
const activeScrollerTimer = useRef<ReturnType<typeof setTimeout> | null>(
|
|
312
342
|
null
|
|
@@ -314,9 +344,11 @@ export function ResourcesCalendar(props: ResourcesCalendarProps) {
|
|
|
314
344
|
const lastScrollX = useRef(0);
|
|
315
345
|
const [scrollOffset, setScrollOffset] = useState(0);
|
|
316
346
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
//
|
|
347
|
+
const activeVerticalScroller = useRef<'outer' | 'resourceName' | null>(null);
|
|
348
|
+
|
|
349
|
+
// Sync the label position after scrolling stops.
|
|
350
|
+
// When the activeScroller timeout fires, treat it as scroll end
|
|
351
|
+
// and commit the current lastScrollX value to state.
|
|
320
352
|
const releaseActiveScroller = useCallback(() => {
|
|
321
353
|
activeScroller.current = null;
|
|
322
354
|
setScrollOffset(lastScrollX.current);
|
|
@@ -360,12 +392,38 @@ export function ResourcesCalendar(props: ResourcesCalendarProps) {
|
|
|
360
392
|
[releaseActiveScroller]
|
|
361
393
|
);
|
|
362
394
|
|
|
395
|
+
const handleOuterScroll = useCallback(
|
|
396
|
+
(event: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
397
|
+
if (activeVerticalScroller.current === 'resourceName') return;
|
|
398
|
+
activeVerticalScroller.current = 'outer';
|
|
399
|
+
const y = event.nativeEvent.contentOffset.y;
|
|
400
|
+
resourceNameScrollRef.current?.scrollTo({ y, animated: false });
|
|
401
|
+
},
|
|
402
|
+
[]
|
|
403
|
+
);
|
|
404
|
+
|
|
405
|
+
const handleResourceNameScroll = useCallback(
|
|
406
|
+
(event: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
407
|
+
if (activeVerticalScroller.current === 'outer') return;
|
|
408
|
+
activeVerticalScroller.current = 'resourceName';
|
|
409
|
+
const y = event.nativeEvent.contentOffset.y;
|
|
410
|
+
outerScrollRef.current?.scrollTo({ y, animated: false });
|
|
411
|
+
},
|
|
412
|
+
[]
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
const handleOuterScrollEnd = useCallback(() => {
|
|
416
|
+
activeVerticalScroller.current = null;
|
|
417
|
+
}, []);
|
|
418
|
+
|
|
419
|
+
const handleResourceNameScrollEnd = useCallback(() => {
|
|
420
|
+
activeVerticalScroller.current = null;
|
|
421
|
+
}, []);
|
|
422
|
+
|
|
363
423
|
const commonRowProps = {
|
|
364
424
|
dates,
|
|
365
425
|
dateColumnWidth,
|
|
366
|
-
scrollOffset,
|
|
367
426
|
eventsByResourceId,
|
|
368
|
-
renderResourceNameLabel: props.renderResourceNameLabel,
|
|
369
427
|
onPressCell: props.onPressCell,
|
|
370
428
|
onLongPressCell: props.onLongPressCell,
|
|
371
429
|
delayLongPressCell: props.delayLongPressCell,
|
|
@@ -377,119 +435,220 @@ export function ResourcesCalendar(props: ResourcesCalendarProps) {
|
|
|
377
435
|
eventEllipsizeMode: props.eventEllipsizeMode,
|
|
378
436
|
cellContainerStyle: props.cellContainerStyle,
|
|
379
437
|
allowFontScaling: props.allowFontScaling,
|
|
438
|
+
inlineBand: isInlineBand
|
|
439
|
+
? {
|
|
440
|
+
scrollOffset,
|
|
441
|
+
renderResourceNameLabel: props.renderResourceNameLabel,
|
|
442
|
+
}
|
|
443
|
+
: undefined,
|
|
380
444
|
};
|
|
381
445
|
|
|
382
|
-
|
|
446
|
+
const resourceNameColumn = !isInlineBand ? (
|
|
383
447
|
<ScrollView
|
|
448
|
+
ref={resourceNameScrollRef}
|
|
449
|
+
style={[styles.resourceNameColumn, { width: resourceColumnWidth }]}
|
|
450
|
+
contentContainerStyle={{ width: resourceColumnWidth }}
|
|
384
451
|
stickyHeaderIndices={[0]}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
452
|
+
showsVerticalScrollIndicator={false}
|
|
453
|
+
bounces={false}
|
|
454
|
+
overScrollMode="never"
|
|
455
|
+
onScroll={handleResourceNameScroll}
|
|
456
|
+
onScrollEndDrag={handleResourceNameScrollEnd}
|
|
457
|
+
onMomentumScrollEnd={handleResourceNameScrollEnd}
|
|
458
|
+
scrollEventThrottle={16}
|
|
391
459
|
>
|
|
460
|
+
{/* [0] sticky: header height spacer + fixed resource name rows */}
|
|
461
|
+
<View style={[styles.resourceNameColumn, styles.resourceNameColumnFixed]}>
|
|
462
|
+
<View
|
|
463
|
+
style={[styles.resourceNameHeaderSpacer, { height: headerHeight }]}
|
|
464
|
+
/>
|
|
465
|
+
{fixedResources.map((resource) => (
|
|
466
|
+
<View
|
|
467
|
+
key={resource.id}
|
|
468
|
+
style={[
|
|
469
|
+
styles.resourceNameCell,
|
|
470
|
+
{ height: rowHeights.get(resource.id) },
|
|
471
|
+
]}
|
|
472
|
+
>
|
|
473
|
+
{props.renderResourceNameLabel ? (
|
|
474
|
+
props.renderResourceNameLabel(resource)
|
|
475
|
+
) : (
|
|
476
|
+
<View>
|
|
477
|
+
<Text
|
|
478
|
+
allowFontScaling={props.allowFontScaling}
|
|
479
|
+
style={styles.resourceNameFixedLabelText}
|
|
480
|
+
numberOfLines={1}
|
|
481
|
+
>
|
|
482
|
+
{resource.name}
|
|
483
|
+
</Text>
|
|
484
|
+
</View>
|
|
485
|
+
)}
|
|
486
|
+
</View>
|
|
487
|
+
))}
|
|
488
|
+
</View>
|
|
489
|
+
<View>
|
|
490
|
+
{/* Scrollable resource name rows */}
|
|
491
|
+
{scrollableResources.map((resource) => (
|
|
492
|
+
<View
|
|
493
|
+
key={resource.id}
|
|
494
|
+
style={[
|
|
495
|
+
styles.resourceNameCell,
|
|
496
|
+
{ height: rowHeights.get(resource.id) },
|
|
497
|
+
]}
|
|
498
|
+
>
|
|
499
|
+
{props.renderResourceNameLabel ? (
|
|
500
|
+
props.renderResourceNameLabel(resource)
|
|
501
|
+
) : (
|
|
502
|
+
<View>
|
|
503
|
+
<Text
|
|
504
|
+
allowFontScaling={props.allowFontScaling}
|
|
505
|
+
style={styles.resourceNameFixedLabelText}
|
|
506
|
+
numberOfLines={1}
|
|
507
|
+
>
|
|
508
|
+
{resource.name}
|
|
509
|
+
</Text>
|
|
510
|
+
</View>
|
|
511
|
+
)}
|
|
512
|
+
</View>
|
|
513
|
+
))}
|
|
514
|
+
<View style={{ height: props.bottomSpacing }} />
|
|
515
|
+
</View>
|
|
516
|
+
</ScrollView>
|
|
517
|
+
) : null;
|
|
518
|
+
|
|
519
|
+
return (
|
|
520
|
+
<View style={styles.container}>
|
|
521
|
+
{/* Left: fixed resource name column (fixed-column mode only) */}
|
|
522
|
+
{resourceNameColumn}
|
|
523
|
+
|
|
524
|
+
{/* Right: calendar body */}
|
|
392
525
|
<ScrollView
|
|
393
|
-
ref={
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
526
|
+
ref={outerScrollRef}
|
|
527
|
+
style={styles.calendarBody}
|
|
528
|
+
stickyHeaderIndices={[0]}
|
|
529
|
+
onScroll={handleOuterScroll}
|
|
530
|
+
onScrollEndDrag={handleOuterScrollEnd}
|
|
531
|
+
onMomentumScrollEnd={handleOuterScrollEnd}
|
|
399
532
|
scrollEventThrottle={16}
|
|
400
|
-
|
|
533
|
+
overScrollMode="never"
|
|
534
|
+
bounces={props.onRefresh != null}
|
|
535
|
+
refreshControl={
|
|
536
|
+
props.onRefresh != null ? (
|
|
537
|
+
<RefreshControl
|
|
538
|
+
refreshing={props.refreshing ?? false}
|
|
539
|
+
onRefresh={props.onRefresh}
|
|
540
|
+
/>
|
|
541
|
+
) : undefined
|
|
542
|
+
}
|
|
401
543
|
>
|
|
402
|
-
<
|
|
403
|
-
{
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
544
|
+
<ScrollView
|
|
545
|
+
ref={headerScrollRef}
|
|
546
|
+
horizontal
|
|
547
|
+
showsHorizontalScrollIndicator={false}
|
|
548
|
+
bounces={false}
|
|
549
|
+
overScrollMode="never"
|
|
550
|
+
onScroll={handleHeaderScroll}
|
|
551
|
+
scrollEventThrottle={16}
|
|
552
|
+
data-component-name="resources-calendar-header-row"
|
|
553
|
+
>
|
|
554
|
+
<View>
|
|
555
|
+
<View
|
|
556
|
+
onLayout={(e) => setHeaderHeight(e.nativeEvent.layout.height)}
|
|
557
|
+
>
|
|
558
|
+
{!props.hiddenMonth && (
|
|
559
|
+
<View style={styles.monthHeaderRow}>
|
|
560
|
+
{monthGroups.map(({ year, month }, index) => {
|
|
561
|
+
const { start: cellStart, width: cellWidth } =
|
|
562
|
+
monthGroupOffsets[index]!;
|
|
563
|
+
const textLeft = Math.max(8, scrollOffset - cellStart + 8);
|
|
564
|
+
return (
|
|
565
|
+
<View
|
|
566
|
+
key={`${year}-${month}`}
|
|
567
|
+
style={[styles.monthHeaderCell, { width: cellWidth }]}
|
|
568
|
+
>
|
|
569
|
+
<View style={{ marginLeft: textLeft }}>
|
|
570
|
+
{props.renderMonthLabel ? (
|
|
571
|
+
props.renderMonthLabel(year, month)
|
|
572
|
+
) : (
|
|
573
|
+
<View>
|
|
574
|
+
<Text
|
|
575
|
+
numberOfLines={1}
|
|
576
|
+
allowFontScaling={props.allowFontScaling}
|
|
577
|
+
style={styles.monthHeaderText}
|
|
578
|
+
>
|
|
579
|
+
{dayjs(`${year}-${month}-01`).format('YYYY/MM')}
|
|
580
|
+
</Text>
|
|
581
|
+
</View>
|
|
582
|
+
)}
|
|
583
|
+
</View>
|
|
584
|
+
</View>
|
|
585
|
+
);
|
|
586
|
+
})}
|
|
587
|
+
</View>
|
|
588
|
+
)}
|
|
589
|
+
|
|
590
|
+
<View style={styles.headerRow}>
|
|
591
|
+
{dates.map((date) => (
|
|
410
592
|
<View
|
|
411
|
-
key={
|
|
412
|
-
|
|
593
|
+
key={date.getTime()}
|
|
594
|
+
data-component-name="resources-calendar-date-cell"
|
|
595
|
+
style={[
|
|
596
|
+
styles.dateCellContainer,
|
|
597
|
+
{ width: dateColumnWidth },
|
|
598
|
+
props.dateCellContainerStyle?.(date),
|
|
599
|
+
]}
|
|
413
600
|
>
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
<
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
>
|
|
424
|
-
{dayjs(`${year}-${month}-01`).format('YYYY/MM')}
|
|
425
|
-
</Text>
|
|
426
|
-
</View>
|
|
427
|
-
)}
|
|
428
|
-
</View>
|
|
601
|
+
{props.renderDateLabel ? (
|
|
602
|
+
props.renderDateLabel(date)
|
|
603
|
+
) : (
|
|
604
|
+
<View>
|
|
605
|
+
<Text allowFontScaling={props.allowFontScaling}>
|
|
606
|
+
{dayjs(date).format('D(ddd)')}
|
|
607
|
+
</Text>
|
|
608
|
+
</View>
|
|
609
|
+
)}
|
|
429
610
|
</View>
|
|
430
|
-
)
|
|
431
|
-
})}
|
|
432
|
-
</View>
|
|
433
|
-
)}
|
|
434
|
-
|
|
435
|
-
<View style={styles.headerRow}>
|
|
436
|
-
{dates.map((date) => (
|
|
437
|
-
<View
|
|
438
|
-
key={date.getTime()}
|
|
439
|
-
data-component-name="resources-calendar-date-cell"
|
|
440
|
-
style={[
|
|
441
|
-
styles.dateCellContainer,
|
|
442
|
-
{ width: dateColumnWidth },
|
|
443
|
-
props.dateCellContainerStyle?.(date),
|
|
444
|
-
]}
|
|
445
|
-
>
|
|
446
|
-
{props.renderDateLabel ? (
|
|
447
|
-
props.renderDateLabel(date)
|
|
448
|
-
) : (
|
|
449
|
-
<View>
|
|
450
|
-
<Text allowFontScaling={props.allowFontScaling}>
|
|
451
|
-
{dayjs(date).format('D(ddd)')}
|
|
452
|
-
</Text>
|
|
453
|
-
</View>
|
|
454
|
-
)}
|
|
611
|
+
))}
|
|
455
612
|
</View>
|
|
456
|
-
|
|
457
|
-
</View>
|
|
613
|
+
</View>
|
|
458
614
|
|
|
615
|
+
<View>
|
|
616
|
+
{fixedResources.map((resource) => (
|
|
617
|
+
<ResourceRow
|
|
618
|
+
key={resource.id}
|
|
619
|
+
resource={resource}
|
|
620
|
+
{...commonRowProps}
|
|
621
|
+
onLayout={(height) => handleRowLayout(resource.id, height)}
|
|
622
|
+
/>
|
|
623
|
+
))}
|
|
624
|
+
</View>
|
|
625
|
+
</View>
|
|
626
|
+
</ScrollView>
|
|
627
|
+
|
|
628
|
+
<ScrollView
|
|
629
|
+
ref={bodyScrollRef}
|
|
630
|
+
horizontal
|
|
631
|
+
showsHorizontalScrollIndicator={false}
|
|
632
|
+
bounces={false}
|
|
633
|
+
overScrollMode="never"
|
|
634
|
+
onScroll={handleBodyScroll}
|
|
635
|
+
scrollEventThrottle={16}
|
|
636
|
+
data-component-name="resources-calendar-body-row"
|
|
637
|
+
>
|
|
459
638
|
<View>
|
|
460
|
-
{
|
|
639
|
+
{scrollableResources.map((resource) => (
|
|
461
640
|
<ResourceRow
|
|
462
641
|
key={resource.id}
|
|
463
642
|
resource={resource}
|
|
464
643
|
{...commonRowProps}
|
|
644
|
+
onLayout={(height) => handleRowLayout(resource.id, height)}
|
|
465
645
|
/>
|
|
466
646
|
))}
|
|
467
647
|
</View>
|
|
468
|
-
</
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
<ScrollView
|
|
472
|
-
ref={bodyScrollRef}
|
|
473
|
-
horizontal
|
|
474
|
-
showsHorizontalScrollIndicator={false}
|
|
475
|
-
bounces={false}
|
|
476
|
-
overScrollMode="never"
|
|
477
|
-
onScroll={handleBodyScroll}
|
|
478
|
-
scrollEventThrottle={16}
|
|
479
|
-
data-component-name="resources-calendar-body-row"
|
|
480
|
-
>
|
|
481
|
-
<View>
|
|
482
|
-
{scrollableResources.map((resource) => (
|
|
483
|
-
<ResourceRow
|
|
484
|
-
key={resource.id}
|
|
485
|
-
resource={resource}
|
|
486
|
-
{...commonRowProps}
|
|
487
|
-
/>
|
|
488
|
-
))}
|
|
489
|
-
</View>
|
|
648
|
+
</ScrollView>
|
|
649
|
+
<View style={{ height: props.bottomSpacing }} />
|
|
490
650
|
</ScrollView>
|
|
491
|
-
|
|
492
|
-
</ScrollView>
|
|
651
|
+
</View>
|
|
493
652
|
);
|
|
494
653
|
}
|
|
495
654
|
|
|
@@ -525,11 +684,6 @@ const styles = StyleSheet.create({
|
|
|
525
684
|
borderRightWidth: CELL_BORDER_WIDTH,
|
|
526
685
|
borderColor: 'lightslategrey',
|
|
527
686
|
},
|
|
528
|
-
resourceNameCellContainer: {
|
|
529
|
-
width: 80,
|
|
530
|
-
borderRightWidth: CELL_BORDER_WIDTH,
|
|
531
|
-
borderColor: 'lightslategrey',
|
|
532
|
-
},
|
|
533
687
|
resourceRow: {
|
|
534
688
|
flexDirection: 'column',
|
|
535
689
|
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
@@ -547,16 +701,44 @@ const styles = StyleSheet.create({
|
|
|
547
701
|
borderRightWidth: CELL_BORDER_WIDTH,
|
|
548
702
|
borderColor: 'lightslategrey',
|
|
549
703
|
},
|
|
704
|
+
container: {
|
|
705
|
+
flexDirection: 'row',
|
|
706
|
+
flex: 1,
|
|
707
|
+
},
|
|
708
|
+
calendarBody: {
|
|
709
|
+
flex: 1,
|
|
710
|
+
},
|
|
550
711
|
resourceNameColumn: {
|
|
551
|
-
|
|
712
|
+
borderRightWidth: CELL_BORDER_WIDTH,
|
|
713
|
+
borderRightColor: 'lightslategrey',
|
|
714
|
+
flexGrow: 0,
|
|
715
|
+
flexShrink: 0,
|
|
716
|
+
},
|
|
717
|
+
resourceNameColumnFixed: {
|
|
718
|
+
backgroundColor: 'white',
|
|
719
|
+
},
|
|
720
|
+
resourceNameHeaderSpacer: {
|
|
721
|
+
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
722
|
+
borderBottomColor: 'lightslategrey',
|
|
723
|
+
},
|
|
724
|
+
resourceNameCell: {
|
|
725
|
+
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
726
|
+
borderBottomColor: 'lightslategrey',
|
|
727
|
+
justifyContent: 'center',
|
|
728
|
+
paddingHorizontal: 4,
|
|
729
|
+
minHeight: 30,
|
|
730
|
+
},
|
|
731
|
+
resourceNameFixedLabelText: {
|
|
732
|
+
fontSize: 12,
|
|
733
|
+
color: 'black',
|
|
552
734
|
},
|
|
553
|
-
|
|
735
|
+
resourceNameInlineBand: {
|
|
554
736
|
width: '100%',
|
|
555
737
|
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
556
738
|
borderColor: 'lightslategrey',
|
|
557
739
|
backgroundColor: '#EEEEEE',
|
|
558
740
|
},
|
|
559
|
-
|
|
741
|
+
resourceNameInlineBandText: {
|
|
560
742
|
fontSize: 12,
|
|
561
743
|
color: 'black',
|
|
562
744
|
},
|